Let me check if I got.. If I: 1) store the matrix of the B ("ORIGINAL_B_pos") (before parenting to A) 2) parent B to A 3) move A (which will bring B to another place, to "NEW_B_pos") 4) unparent B (so B will go back to "ORIGINAL_B_pos" ) 5) apply matrix in B (after this 5th step, B will go to "NEW_B_pos" ?)
Em qua., 17 de mar. de 2021 às 17:35, tomas mikulak <mikulakto...@gmail.com> escreveu: > and if you just use variable to save world matrix of parented B and after > unparent just use data. Still guessing, don't know how slow it might be > > st 17. 3. 2021 o 21:32 João Victor <joaovictor...@gmail.com> napísal(a): > >> 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 >> <https://groups.google.com/d/msgid/python_inside_maya/4728bffb-4076-4e80-a61c-2e4054b5b5a8n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to a topic in the > Google Groups "Python Programming for Autodesk Maya" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/python_inside_maya/PTE_CUQsO_c/unsubscribe > . > To unsubscribe from this group and all its topics, 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/CAEUzAD3br5mf1XrFQb7kRqYBH9RyqHvuMHnG3F5nLJ1-R5YuFQ%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAEUzAD3br5mf1XrFQb7kRqYBH9RyqHvuMHnG3F5nLJ1-R5YuFQ%40mail.gmail.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/CAJZGTKWM%3D%2B0YHsz4OZ3hb5DpeJMtUwneDgSP_OESihQ67FXZ3g%40mail.gmail.com.