PDA

View Full Version : Expression Problem - Please help


instruct9r
03-19-2006, 09:20 AM
Hi.
I have one problem with writing expression for speeding up one deformer's offset.

To be sure you will understand me i've attach file that contains simple scene

Scene (http://www.creaturetd.com/forums/download.php?id=70)

Play the scene then change the attribute "Speed" of the circle controler. It's working OK.

But try to animate for example from 1 to 2, only while in incresasing process the deformer became really fast them its working ok....
Could someone fix this please??

10x

Mikademius
03-19-2006, 09:35 AM
It's working fine here...

instruct9r
03-19-2006, 09:53 AM
try this.

Set key on the speed attr to 1 for frame 50, then set key on the attr to 2 for frame 100. go to frame 150 and play, see how it work, then go to frame 60 and play to see. Between frame 50 and 100 its running super fast then after frame 100 its normalized again. thats the problem.

Mikademius
03-19-2006, 10:41 AM
well, your graph looks like this...
I'm trying to figure out why.

instruct9r
03-19-2006, 10:50 AM
The scene should have only one Expression. Delete all keys and try again. I may forgot to delete something... sorry about that. I can't understand how to make this expression to wotk :banghead:

Mikademius
03-19-2006, 11:02 AM
the scene only has one expression. I just baked the offset.
What I'm thinking:
The value of the offset will always ascend because it's hooked up with time and when you key the speed you accellerate it, but when you stop increasing the speed it goes back to ascending at a smooth range wit the time as input only. Hence the graph. If you ditch the time and just key the speed you can see it run smoothly. So when you have ONE attribute ascending it will run smoothly, when you have TWO you kind of get a double translate.

Maybe this will work better:

sineAttrs.offset += ((ctrl.speed)/5);

instruct9r
03-19-2006, 12:03 PM
COOL man.. :scream:

I was thinkink the operator "+=" is for increasing. Thats why i didn't try with that.

Thank you.

cheers

Mikademius
03-19-2006, 12:11 PM
well, the += does only add itself + the value you put in.
e.g:

$hello += 1;
is the same as
$hello = $hello + 1;


++ is for increasing

instruct9r
03-19-2006, 12:34 PM
yep... i have a lot to learn about MEL and expressions

thanks:applause:

Mikademius
03-19-2006, 01:48 PM
no problem ;) I learn something new everyday :) MEL is too big to learn in a quicky...

CGTalk Moderation
03-19-2006, 01:48 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.