There have been some great explanations here already, but I felt like
chiming in still.

The line of code in your example is a bunch of methods chained together (method
chaining <http://stackoverflow.com/questions/1103985>). Each returns a new
object and then you call a method on that object. It is possible to rewrite
the code in an expanded view. This creates more variables, but it should
make it more obvious as to why you are only adding one "pm." prefix.

Here is the code expanded:

cameras = pm.ls(type='camera')cameraTransform =
cameras[0].getParent()transformMatrix =
cameraTransform.getTranslation()print "Value of z: %s" %
tranformMatrix.z

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CANESWi32gubjin8xm1V6YQWDn%2B1uYgmsYZ-dgDQQrnO06t2H2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to