I need to obtain the motion path attached to a curve in maya using Python. This is the situation as shown in the editor:

Description of situation

I want to obtain motionPath1 by calling a method on curve3 since they look like they are related.

However, I have tried pleny of list methods (listAttr, listHierarchy, etc) but they only return the curveShape3.

What is the command, if it exists at all, to get the name of the motion path in Python knowing the object curve3?


1 Answer 1


enter image description here

You need to get motion path node name from curve shape.

import maya.cmds as cmd
shape = cmd.listRelatives( 'curve3' )
mPath = cmd.listConnections( shape, type = 'motionPath')
print mPath

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .