thanks a lot for the suggestion Tomas! but I can´t use CMDS for parenting the new "helper locator", because I am looking for reduce the time of the loop.. and it have to be made about 30k times in the loop. For this reason I am trying to use the api instead of CMDS. :)
Em quarta-feira, 17 de março de 2021 às 17:25:33 UTC-3, tomas mikulak escreveu: > 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 <joaovi...@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_m...@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/4728bffb-4076-4e80-a61c-2e4054b5b5a8n%40googlegroups.com.