Hi,
I am not into API yet, but what if you also parented a locator under A with
same position and rotation as B and after unparenting B just set it's
transforms according to locator still under A
Bad?

tomas

st 17. 3. 2021 o 21:20 João Victor <joaovictor...@gmail.com> napísal(a):

> Hi guys, could somebody help me in a doubt?
>
> I am trying to parent B to A, then move A, then unparent B. But at the end
> of these operations, B can´t return to his original position, he must keeps
> where A brought him.
> How can I do that in the API?
>
> My current code is:
>
> *q1 = getMObject("A")*
> *q2 = getMObject("B")*
>
> *p = new_om.MFnDagNode(q1)*
> *p.addChild(q2)*
>
> *u = new_om.MDagModifier()*
>
> *u.reparentNode(q2)   # here B returns to original position, thats the
> problem*
> *u.doIt()*
>
> 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 python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/89a295a8-835c-4a23-8dd5-6bc0399d55e4n%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/89a295a8-835c-4a23-8dd5-6bc0399d55e4n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAEUzAD0Cyib-raXJVNGU_SFwiEWKsRQfLggHc%3DXHWsP67s%3D3tg%40mail.gmail.com.

Reply via email to