Methods do no need to reference the module.

pm.ls(type='camera')[0].getParent().getTranslation().z

-brian
www.meljunky.com 

-------- Original Message --------
Subject: [Maya-Python] Basic question about pyMel
From: Simon Davies <[email protected]>
Date: Mon, March 23, 2015 12:59 pm
To: [email protected]

Hi all,

I understand that if I import pyMel into Maya like this:

from pymel.core import *

I can then build up pyMel functions like this:

ls(type='camera')[0].getParent().getTranslation().z

However if I import pyMel with a name space instead:

import pymel.core as pm

Would the pyMel methods above all need prefixing with pm like this?

pm.ls(type='camera')[0].pm.getParent().pm.getTranslation().z

The above code doesn't work, so how should it be written if I import pymel as pm?

Thanks a lot.

--
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/33fcd70f-b4c2-496f-b05d-a41196a428ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/20150323111411.4b67a6573d13e8dd18091ea81788b1e6.4b8c60eefb.wbe%40email06.secureserver.net.
For more options, visit https://groups.google.com/d/optout.