I tend to agree, Justin. As far as your assumptions, you're pretty much
dead on--I take the approach that this node should only be created by my
framework, and is immediately re-parented to another object, so there
should never be two instances of it in the scene root. and actually, as
far as namespaces are concerned, they get escaped by the script anyway.
But, I do like to be precise, so I appreciate the pointer to the API
commands!
Thanks!
On 3/22/2014 4:03 AM, Justin Israel wrote:
What if you did it through the Maya API, and made use of the actual
MObject knowing exactly which node it is pointing at, instead of the
ambiguous maya paths?
import maya.OpenMaya as om
dagFn = om.MFnDagNode()
group = dagFn.create("transform", "testGRP")
dagFn.setObject(group)
groupPath = dagFn.fullPathName()
print groupPath
# |testGRP
But I will be honest. Given that the currency in the Maya commands is
string paths, I don't think it is wrong to format a full path of
"|testGRP" if a call to cmds.group(empty=True, world=True,
name="testGRP") returns your "testGRP". Am I right in assuming that if
you are creating it with world=True, you are placing it at the root of
the scene anyways? The only thing that might be faulty with that is if
you are in a different namespace, right? But overall, the Maya API
might be more "precise".
--
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/532DCB9B.8010404%40gmail.com.
For more options, visit https://groups.google.com/d/optout.