create ball, follow curve


createCurveWarp maya function, only found after looking here


import maya.cmds

cmds.curve(d=1, bez=True, p=[(0,0,0),(1,2,4),(2,4,6),(4,6,6)]) #defines every point

cmds.polySphere(r=0.4)

cmds.createCurveWarp('pSphere1','bezier1') #had to search a while for this, no command documentation page for it

#to do similar action without warping, use "cmds.pathAnimation()"

for i in range(11): #for 0.1 each time i'd expect it to not be 11

    cmds.currentTime((i*10), edit=True)

    cmds.setAttr("curveWarp1.offset",(i/10)) #offset attribute

    cmds.setKeyframe("curveWarp1.offset")

Leave a comment

Log in with itch.io to leave a comment.