I need to access the world translation/rotation of one object to the other.
So far:
I cannot do direct connection since both objects are in different heirarchy
I cannot also do parent constraint because the previous rigger mess with the scaling, so now there is shearing. (No, I’m not willing to do a scale constraint. Only translation and rotation).
I was hoping the world matrix socket would help me. There is an output but there is no input.
Is there a way around this?
You can see an illustration of the problem here:
Thank you.
EDIT: This is still unresolved.
Based on the comments below: There is no World Matrix Input.
(1) I guess the remaining question would be is there a feature/node equivalent to the World Matrix Input?
(2) Also, be noted that both driven and driver objects are in hierarchies. The reason I’m pointing out is that the solutions below work if they are not in hierarchy.
Thanks for the response but as stated above, both objects are in hierarchy, so it won’t work.
For example
Driven’s Parent (20,30,60)
…Driven Object (0,0,0)
Supposing the driver’s world rotation is (10,20,30) if plug directly to “object’s translate and rotate inputs.”
It would result to a world rotation of (30,50,90) which is driven’s object rotation plus its parent
Back to the question, is there a world matrix input?
Insert a multMatrix between the source and the decomposeMatrix, and multiply the worldMatrix * parentInverseMatrix, connect the sum of that into the decomposeMatrix matrixIn.
Thanks for the response but it doesn’t work as expected. For clarity, this is what I illustrated above:
"hanks for the response but as stated above, both objects are in hierarchy, so it won’t work.
For example
Driven’s Parent (20,30,60)
…Driven Object (0,0,0)
Supposing the driver’s world rotation is (10,20,30) if plug directly to “object’s translate and rotate inputs.”
It would result to a world rotation of (30,50,90) which is driven’s object rotation plus its parent
Back to the question, is there a world matrix input?
Thanks for the confirmation.
The solutions presented above by others works but only if the driven object is NOT parented/hierarchy.
Unfortunately, my driven object is parented/hierarchy.
You need to account for it being parented by using the “parent inverse matrix” of the driven object as well as that of the driver. If you’re unfamiliar with the maths I would highly recommend a crash course on maya matrices (Kimon Matara’s posts are excellent) - multiplying matrices effectively transforms matrices between ranks in a hierarchy.
Maya gives us an object’s world matrix for free - use the multMatrix node to multiply the driver’s world matrix by the driven’s parent inverse matrix. This will effectively “subtract” all transformations of the parent from the target position, leaving you with the child’s local transforms. (I’m not quite sure what the advantage is of Katz’ solution above - seems like it would just give you the local transforms of the object anyway?)
Heh, my answer wasn’t meant to be “an approach”. I just thought bentraje didn’t know how to get transform values out of a matrix. Some good tips in this thread, thanks!