PDA

View Full Version : Expression help please



zapper1998
12-21-2011, 12:03 PM
I have a item i want to rotate on its Bank axis, after the Cylinder shaft moves on it X axis.??

How do i do that expression wise??

100440


100437
100438
100439

mike

nickdigital
12-21-2011, 12:23 PM
Using the Expression Builder in the Graph Editor is a quick and easy way to get familiar with expressions.

The expression you want just uses the X channel of your driver. I made a null called "Driver" and a null called "Bank". In the "Bank" object's bank channel I have an expression of


( [Driver.Position.X] )

When I move "Driver" in X the "Bank" object banks accordingly.

zapper1998
12-22-2011, 12:06 PM
ok i see
I think.. hehehe
let me try it
thank you

Mike

zapper1998
12-22-2011, 01:01 PM
ok this is what i have..
attached scene file.. 60 frames of movement.
same objects..
100471

The MasterCyl_right_Leg:Alignment_Pin, is what I am using as ref..
The Bank Null i will use as the pivot for what is attached to the guard.
I think I need to change the pivot point of the Guard Object..

What do u think??

I need the Guard to stay level with the ground...
I will try to a few things
New to expressions.. it looks like fun and i know they are great to use..
Just need a little help getting started

Thank you for your help
most appreciated

Mike

nickdigital
12-22-2011, 03:47 PM
Well, your "Bank" object's Bank channel is tied to the X channel of the "Driver" null. But your "Driver" null has no keyframes on it.

If the idea is to keep the rotation of the "foot" level with the ground...why not use IK?

See the attached file.

I disabled the expression on your "Bank" object and am using IK's "Match Goal Orientation" on an "IK" null.

zapper1998
12-23-2011, 12:50 PM
Ok I see how this is working
But I can not seem to get the Alignment Pin and the Guard Pin to stay together

100515

100516

100517

Thank you for the Help

nickdigital
12-23-2011, 03:25 PM
I parented your Pin, Shaft and Guard object to a single null so they all stay registered to each other. The Shaft is then targeting back towards the main arm. I removed that IK null and have the Guard Matching the goal of the IK null now.

Is this what you're looking for? There might be some nulls that do nothing now, I didn't go through and clean this scene up completely.

[edit]
For whatever reason the forum isn't letting me upload the revised lwo file. The only change is that the shaft is pointing down Z+.

zapper1998
12-23-2011, 08:44 PM
i was having difficulties uploading to..