View Full Version : expressions help
02-11-2006, 10:00 PM
Can someone tell me exactly how to get an expression to work in the Motion Options" panel? I've done some reading on creating expressions, and have taken a shot at it, but there is something I'm missing in the implementation.
I simply want to duplicate what Channel Follower does, with the benfit of it working with IK. here's my process...
I select Bone 1(the bone to be "followed"). I open the Motion panel. I select "expression".
Then, I choose the channel "Rotation.P" in the drop down at the top. Click "after IK"
In the "expression" box, I write object.bone2.Rotation.P. (Bone 2 is the "following" bone). Basically, Bone 2 will be following Bone 1.
I hit "continue". Nothing happens.
When I re-open the expression box, my work is gone. No more expression. Do I need brackets or parentethese? I am so new to expressions, but want to learn. It seems there is extremely unforgiving syntax, and I'm not dead on with it.
Please remember, this is for the Motion panel, not the graph editor. Thanks in advance...
02-11-2006, 10:41 PM
After digging some more, I found a post by Larry which helped...
In the Motion Panel, the old syntax must be used (with Time in the expression). Also, I needed to hit "enter" on the keyboard for it to accept. Stupid. Both myself and LW.
02-11-2006, 10:48 PM
Not sure I fully understand you (it's late and I'm tired) but...
First of all let me say that imho this part of LW is the worst part of LW! It's motion system is abit of a mess. And whether something is set to evaluate before or after IK seems to be quite arbitrary, nevermind what the interface tells you.
Second, you seem to be confusing what item the expression goes on, or maybe you just wrote your post wrong. The expression goes on the item whose motion you want to modify (that's the norm anyway, motion modifiers could be coded to work otherwise). So the expression goes on the "following" bone, not the bone that's being "followed". If you want bone2 to mimic what bone does, the expressions go on bone2.
Third, there are two types of expression syntaxes/notations, lscript and bracket notation. I always use the former because it allows dynamic feedback. Why they added bracket notation is still a mystery to me. Your expression (to be applied to bone2 to make bone2 mimic bone1) in either notation would look something like this:
[object.bone2.Rotation.P] //just put brackets around what you wrote previously.
Fourth, why not use Follower (not channel follower)? It has the same option to evaluate after IK as the expression motion modifier does.
EDIT: Crap, too late. Glad you solved it. Enter, Num-Enter or tab will do. A bit annoying at first, but you get used to it.
02-11-2006, 11:20 PM
you're right, I worded my post incorrectly...I meant what you said.
Follower does work also...I could have sworn "afterIk" was broken, but it works just as well as using the xpression.
BUT, as always, when you do something in Lightwave that seems to work, it ALWAYS creates another problem. In this case, it seems that everything is rotating the way it should now, except that the arm flies away from the IK goal. If I turn off the expression on the motion panel, the arm stays locked to the goal, like it should.
this just doesn't work very well.
I turned off "after ik". Now the arm stays locked like it should. It is broken, like I said, but still works "after ik". Why is that button even needed?
02-11-2006, 11:20 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.