[Closed] fighting transforms
Greetings
I’m really struggling with making some simple controls for a mechanical assembly, and hoping someone can help.
Given a hierarchy of objects parent>child>grandchild
I have a slider that waggles the grandchild around its local Y axis… easy.
I want another slider that waggles the parent and child around the grandchilds local Y axis, while keeping the grandchild stationary.
Fundamentally I want to present the user with one object to animate, (a control object) and have all animation keys that would need any adjustment residing solely on that object (or that object contains instances to other tracks, but just so they are all displayed on the timeline for manipulation when the sphere is selected). This torso is part of a much larger mechanical assembly, so keeping the number of animated control objects down is critical.
The attached scene file contains part of a stripped down suspended torso, and a sphere which is acting as the control object. The control object has 6 sliders, 4 of them work a treat. 2 of them are driving me nuts.
So far, Chest Tilt, Hip Tilt, Hip Turn, and Hip roll, all seem to work ok. The slider values feed in as scalars to float expressions on the various object’s rotation tracks.
Chest Turn, and Chest roll both involve applying transforms in another object’s space and pivot, and counter rotating the effect on children. I can sometimes get them working correctly, but not consistently, and not as the whole object changes orientation. I also can’t quite figure out how to store this on the helper. I was thinking of applying a similar method to what the other sliders use, but with position expressions, and rotation scripts as separate entities in position and rotations list controllers, so the user only needs to worry about animating the slider…but one thing at a time.
I can’t help shake the feeling that there must be a far simpler way of doing this…
Thanks for the help
Mikie
sorry friend.
i’m really don’t understand the problem. is it a question about how to make the right rig?
solve the problem once it needs solving
No worries. The fact that I am horrendously confused is making it hard to write a clear description.
Let me try again.
Lets say you have 3 objects in a parent>child>grandchild relationship.
a. I have a working slider which rotates the parent in it’s local Z
(the child and grandchild rotate as well, as intended)
b. I have a working slider which rotates the child in it’s local Y
(the grandchild inherits this, as intended)
c. I have a working slider that rotates the grandchild In it’s local Y
Problem 1.
I want a slider d. that reverses c.
I.E. rotate the parent, and child around the pivot of the grandchild in it’s local Y, while keeping the grandchild stationary.
I’ve had inconsistent success using the ‘around’ and ‘in coorrdsys’ contexts, on the parent and child, while counter rotating the grandchild, but am sure there is a more stable (matrix maths?) solution. (or I am just going about this the wrong way)
Problem 2.
I want to make sure all the keys associated with this animation are located on the helper object. In my example I’ve done this with expression controllers, but again, there might be a better way to do it.
Thanks again
Mikie
in coordsys local is the right way for applying rotation. but if you want to do it with math it’s a rotation of transform matrix in its own space. in MXS there is a group of PreRotate functions to do it.
expression controller is probably the cheapest way to do it. and i would do it this way.
another solution might be one-way controller wiring. but again, i think that expression controller works faster then wire controller.
Thanks! I’d better freshen up on my matrix maths, I even get my left and right confused while dancing, let alone multiplying matrices. I don’t quite see the difference between rotate and pre-Rotate, but I’m sure a quick google will clear that up.
Just looked at various threads about transform matrices, and math. I clearly have a lot more to learn before I can do anything there.
This is the bit of code that almost works. It keeps the hips stationary, and rotates the other objects around the hip pivot point, in the hip’s coordinate system.
on chestRollSP changed val do
(
oldVal = chestRollLbl.text as float
diff = val - oldVal
with redraw off
(
hipRollSP.value += diff
in coordsys $Hip_Upper about $Hip_Upper rotate $Chest (eulerangles 0 -diff 0)
in coordsys $Hip_Upper about $Hip_Upper rotate $Hip_lower (eulerangles 0 -diff 0)
)
hipRollLbl.text = (hipRollSP.value as string)
chestRollLbl.text = (chestRollSP.value as string)
)
The main issue with the above, is that any resultant animation keys are not stored on the helper. In the example above, they would be stored on the Chest and $Hip_Lower objects. I guess worst case I could instance those controllers on the helper, to make them easier to get to?