create a curve with two spans? possible?

10 views
Skip to first unread message

e955...@gmail.com

unread,
Oct 15, 2014, 8:06:54 AM10/15/14
to python_in...@googlegroups.com
hi,

im trying to create a linear curve, set using two coodinate points. And then after this line has been drawn i am using the rebuildCurve command to add the number of spans in the curve. However the number of spans i want is 2. but the minimum the rebuildCurve command seems to create is 4.

Does anyone know of a way simply to split a curve in half so i has two spans, within python?

here is my current code:

##########################################################
import maya.cmds as cmds

cmds.curve(n='samsCurve',d=1, p=[(0,0,0), (1,0,0)])
cmds.rebuildCurve(d=1, rt=0, s=2)
##########################################################

thankyou all,
Sam

Anthony Tan

unread,
Oct 15, 2014, 9:58:18 AM10/15/14
to python_in...@googlegroups.com
You could insert a knot halfway?

cmds.insertKnotCurve(p=0.5, rpo=True) # assuming the curve is 0-1

e955...@gmail.com

unread,
Oct 15, 2014, 11:57:25 AM10/15/14
to python_in...@googlegroups.com
BINGO!, thanks alot. thought it should be easy,

Sam

Reply all
Reply to author
Forward
0 new messages