how can I write complex expressions

   5443   5   1
User Avatar
Member
114 posts
Joined: July 2005
Offline
I need to write a more complex expression for controling for example the tx of an object in this maner:

if ($FF==15) than
tx=bla, bla;
else
tx=2xbla;
endif

but I don't know where to put it. maybe there is a CHOPS op that let you write code inside.
another one will be:
can I use a parameter/attribute which I declared, like $BLA, with parameter/attribute in the above statement?

thx
User Avatar
Member
252 posts
Joined: July 2005
Offline
You put it right in the translate X channel. Just start typing in there.

You can do logic and anything else. You can keyframe animate from frame 1 to 10, then from 21 to 30 and put your expression on the curve between frames 10 and 21 using the Graph Editor if you want.

No crazy “Expression Editor” like in some other packages. You just put it where you want it.

Quick example: Try putting sin(10*$F) in the translate X channel. Your object will move back and forth.

Does that answer your question, or did you mean something else? Also open up the Textport and type “exhelp”. It will give you a listing of all expressions available to you. For more info on a particular expression type it again with the expression name: “exhelp sin”.

-Craig
User Avatar
Member
7714 posts
Joined: July 2005
Offline
To supplement Craig's post, type this into a parameter:
if( $FF == 15, bla, bla*2 )
User Avatar
Member
412 posts
Joined: July 2005
Offline
No crazy “Expression Editor” like in some other packages.

actually there is a crazy expression editor.

if you go to alias/variables (alt+A), there is an expression tab. you can make your expressions in there and give them names. then in your channel/parameter, you can just refer to that global expression by giving its name..

oh and craig is right, you can just type right in there as well.. just if it's a long one, you can just refer to it doign the above method in case you like that method.

hth,
dave
Dave Quirus
User Avatar
Member
114 posts
Joined: July 2005
Offline
well, I was thinging a bit further to write “do case” stuff and “while”, cascade if's and put inside some motion ecuations. I guess the expression alias will do the trick.

thx all for your help
User Avatar
Member
252 posts
Joined: July 2005
Offline
Some of those things are much better to do in CHOPs, depending on what you are trying to do. And it saves a lot of the expression writing and looking up syntax and allows you to play around and try different things, as well as see visually what your channels are doing.

-Craig
  • Quick Links