PDA

View Full Version : Expression Editor Workflow Q



rdolishny
03-05-2008, 09:54 AM
I have a simple character rig and wondered about building an expression that moves the body forward a bit depending on the average position of the goals.

So if I move the left foot goal 1 meter forward on x, keeping the right foot goal still, the body will move .5 meter forward.

Using the expression builder on the x position of the body I think I've created a utility\average2inputs using the x positions of the goals, but I get "a referenced channel does not exist".

Here is the expression:

([>>>goal.left.Position.X<<<]* / 2 ) + ([goal.right.Position.X]* / 2 )

And here, in spanish, is what I'm ultimately trying to accomplish.

http://www.youtube.com/watch?v=uZXJNBLbjTw

4dartist
03-05-2008, 10:20 AM
1st off i think you'll have to lose the periods.. :(
(so goalleft.Position.X) not (goal.left.Position.X)
-That should fix the reference error.

2nd. what are the * for? I would lose those.
-that should fix a parse error.

([goal_L.Position.X]/2) + ([goal_R.Position.X]/2)
-worked flawless for me.



If having periods in your null names, you can try relativity, not sure if that excepts periods in the name. I usually just use standard expressions like you are though, they work perfectly fine for me.

Phil
03-05-2008, 10:41 AM
Relativity might always make lighter work of this. *shrug* Your expression then reduces from :

([>>>goal.left.Position.X<<<]* / 2 ) + ([goal.right.Position.X]* / 2 )

to

(X(REL(goal.left),t)/2)+(X(REL(goal.right),t)/2)

The REL() references are there so that you can clone the hierarchy (e.g. multiple characters and the references to goal.left and goal.right will find the right control objects in the hierarchy.

rdolishny
03-05-2008, 10:50 AM
1st off i think you'll have to lose the periods.. :(
(so goalleft.Position.X) not (goal.left.Position.X)
-That should fix the reference error.

2nd. what are the * for? I would lose those.
-that should fix a parse error.

([goal_L.Position.X]/2) + ([goal_R.Position.X]/2)
-worked flawless for me.



If having periods in your null names, you can try relativity, not sure if that excepts periods in the name. I usually just use standard expressions like you are though, they work perfectly fine for me.


Some great responses. I named the character with a period and it looks like that's the problem! Maybe the '*' was a flag to tell me that there was a problem. I used Expression Builder so I have no idea what I'm doing.

And I'm going to have to look up REL that sounds interesting as well.

But am I on the right track as per that spanish youtube demo?

4dartist
03-05-2008, 10:59 AM
Looks like you're on the right track to me.

Are you writing this expression to control the root of a character like the video? I wouldn't say I'm an expert rigger/character animator, but honestly, it would drive me nuts to not have complete independent control of the root of a character. The root doesn't always seem to be right in the center, even in a simple walk cycle. In a walk cycle the root may sway back and forth as weight is placed on each leg. I dunno, im just thinking out loud. Expressions are a blast though so even if you didn't end up using it in a character it's a pretty neat idea and learning tool.

rdolishny
03-05-2008, 11:36 AM
I'm just making this up myself, but in a test I'm going to post later today I have a character jumping into frame. I just want the body to sort of move along with the feet, cause my feet are moving around quite a bit. Maybe have a null move along, and the root be a child of the null (so i can still tweak it as you are suggesting).

But I find rigging such a personal preference thing. All the books and articles online I've read all talk about "do this, this and this" and I am trying after a few years to do it again and get my rigs to do what I want, not what other people think they should do.

Even if they are probably right. :)

4dartist
03-05-2008, 01:15 PM
Haha ya, sounds like a good plan to me. :) I started with Timothy Albee's rigs and animated that way, but over time i would change small things here and there, and in the end I have my own sort of hybrid of that. But the foundation was helpful for sure. Once you understand how all the tools work, you kinda get the bug to improve/streamline to fit your own needs better. :D

rdolishny
03-05-2008, 07:05 PM
I'm just making this up myself, but in a test I'm going to post later today I have a character jumping into frame.

Here is the animation (http://www.youtube.com/watch?v=5fGb4TwC20c) I did with hammer and chisel. I'll try the suggestions next test tomorrow. Nothing earth shattering, this is a proof on concept; more going on under the hood (or will be) with those expressions. Thanks, guys.