Thanks,
I had that solution listed as a "workaround" in my code as well. I am
interested to know why it works on some nodes but not on the locator.
Br,
Johan
On Thursday, March 5, 2015 at 5:42:49 PM UTC+1, johan Borgström wrote:
>
> I am using PyMel to create some locators in a scene. I give the locator a
> name at creation and parent the locator to a group. The second iteration of
> the script I get a MayaNodeError (Maya Node does not exist (or is not
> unique)).
>
> This behaviour seems a little bit weird to me. If I do the same but
> instead create a polyCube it works as expected. I could use various
> workarounds, for instance parent and then rename, which works fine...
>
> This is some sample code to reproduce the error:
> # polyCube, works fine
> for x in range(10):
> grp = pm.group(em=True)
> t = pm.polySphere(n='test', ch=False)[0]
> pm.parent(t, grp)
>
>
> # Error: MayaNodeError: Maya Node does not exist (or is not unique)::
> u'test'
> for x in range(10):
> grp = pm.group(em=True)
> t = pm.spaceLocator(n='test')
> pm.parent(t, grp)
>
>
> # workaround
> for x in range(10):
> grp = pm.group(em=True)
> t = pm.spaceLocator()
> pm.parent(t, grp)
> t.rename('test')
>
>
> Does anyone have an idea why this does not work?
>
> Best Regards,
> Johan
>
--
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/2d6f5b84-6b4c-44a3-b502-21d8b37018c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.