|
I did a couple things.
I created a position node that would represent the main position of the strut. This node is important because it will maintain a clean transform relative to the main control. This Main_Strut_Position would also be link_constrained to the Main_CTRL, as to inherit all position and rotation information from the Main_CTRL. This Main_Strut_Position was initially lined up to the WheelDummy position in the Z, vertical axis.
Next I created a Strut_Position_CTRL. This helper has the transform_script on it. I created two variables in the transform script. strut, which is the Main_Strut_Position node and wheel which is the dummy you have linked to the rotating wheels.
Something to note, all of your objects even the helpers appeared to be scaled on the object themselves. That is really BAD!!! A lot of your objects had a matrix such as this, (matrix3 [0.045969,0,0.122881] [-0.123223,0,0.0460972] [0,-0.113414,0] [-2.65555,-0.0039885,0.160968]). You can see the scale in the rotation and that should never be the case. You will want to clean this up on all of your objects. Utilities > Reset_Transform is your friend. You can check your transforms by selecting your object, going into the listener and type $.transform.
If you are going to scale things do them in the sub-object mode as the objects themselves should have a clean rotation matrix. For example. (matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0])
The first three rows should almost always be the example I provided above. The last row will be the position of your object but in this example the object is at the origin.
Also, if you need to scale helpers, I suggest using Point helpers as you can control the visual size and not the actual object scale. Never scale a dummy.
Here is a transform script I set on the Strut_Position_CTRL node.
-- set a default matrix
matrx = matrix3 [1,0,0] [0,1,0] [0,0, 1] [0,0,0]
-- make sure our dependent objects actually exist if (strut != undefined) and (wheel != undefined) do (
-- get the base transform
matrx = strut.transform
-- zero out the difference between the wheel transform and the strut
offset_matrx = wheel.transform * inverse strut.transform
-- set the return matrix x.position to be the current position plus the wheel offset
matrx.pos.x += offset_matrx.pos.x )
-- return either the default matrix or the calculated matrix
matrx
Randall Hess
Senior Technical Animator
THQ, Volition Inc.
|