Help! Maya Python - Motion Paths

Help! Maya Python - Motion Paths

Anonymous
Not applicable
1,264 Views
1 Reply
Message 1 of 2

Help! Maya Python - Motion Paths

Anonymous
Not applicable

I am trying to create a script, where I have a camera and a NURBS circle and I attach it as a motion path, but I can't seem to make it work:

path = cmds.circle( n="motion path", nr=(0, 1, 0), c=(0, 0, 0), r=5 )

cam = cmds.camera(n="shot cam")

cmds.select( cam, path )

cmds.pathAnimation()

please, anyone, I am not sure why it won't follow the path. The video is what I want, but with my script, the camera doesn't follow the motion path.

0 Likes
1,265 Views
1 Reply
Reply (1)
Message 2 of 2

mspeer
Consultant
Consultant

Hi!

Your cam object has 2 objects, so in the end you select 3 objects for the pathAnimation.

 

Try this:

path = cmds.circle( n="motion path", nr=(0, 1, 0), c=(0, 0, 0), r=5 )
cam = cmds.camera(n="shot cam")
cmds.select( cam[0], path )
cmds.pathAnimation()