So this is the code ( it is quite simple so I didn“t use paste bin, I hope 
it is okey)

import maya.OpenMaya as OpenMaya

cmds.polyCube()
mSel = OpenMaya.MSelectionList(); mSel.add('pCube1')
mDagPath = OpenMaya.MDagPath()
mSel.getDagPath(0, mDagPath)
mDagPath.fullPathName()

that is what I learn in a cgcircuit course. they say that MObject or 
MDagPath are handles that you need to use to access maya data. Okey. no 
problem.
The thing that I am trying to understand in the code I posted is this:
I am creating an object mDagPath that is requiered as an argument --> 
mSel.getDagPath(0, mDagPath)
by doing that, I can use that object method .fullPathName(). 

what I want to understand is what is happening there. what happens when you 
pass an object as argument? why doing that allows you to use some methods 
of that object.
in my mind it would be more intuitive something like :

import maya.OpenMaya as OpenMaya

cmds.polyCube()
mDagPath = OpenMaya.MDagPath()
mDagPath.fullPathName('pCube1')

does my question make any sence?

thnks

-- 
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/d7383962-8cee-4e9c-b57d-df86ea8226f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to