PDA

View Full Version : forcing evaluation of expressions


neonoodle
05-21-2007, 11:37 PM
Hi,
I have a character rig that has a few expressions on the joints to control scaling. It works great, but every time I undo, the expressions don't evaluate until I refresh the time slider. I wrote a little script that undoes and then sets the current frame so that the expression reloads but I can't undo multiple times because the second time just undoes the script. Is there any way to solve this problem so that the expressions evaluate on undo? or is there a way to turn off history for a command so it doesn't appear in the undo queue?

scottiedoo
05-22-2007, 02:00 AM
Hey Dave, how is it going...

Stumbled across your post and had an idea. I did a quick test and I think it may work but you could try this...

You could create a scriptJob that will fire off a command when you do and undo that will eval the expression.. for example:


scriptJob -event Undo evalMyExpression;
global proc evalMyExpression() {
expression -e myExpressionName;
}

You could put that command to edit the expression which will evaluate it in either a scriptNode for that scene or make your own script and have it sourced to active it. Whichever...

Thats the best idea I have right now, I haven't had time to actually find something better at the moment. I'll let you know if I figure anything else out or if there is a better way.

EDIT:
Just added you could put the command inline with the scriptJob so the command is "expression -e myExpressionName" rather than actually having to have a procedure to do it

Cheers,
Scott

CGTalk Moderation
05-22-2007, 02:00 AM
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.