PDA

View Full Version : Conditional expressions?


Steve Warner
07-22-2003, 11:19 PM
Is it possible to do conditional expressions? The manual doesn't seem to show any examples of this, but then again, I'm easily confused by expressions and might just be missing it. I'd like to tie the bank channel of my object to its heading, but only if the heading has changed significantly over the course of time. If the heading remains constant for any given number of frames, I'd like the bank channel to gradually return to a base setting.

As a side note, I'd really love to see LW implement the type of object oriented scripting that's found in Flash. It would be great if I could take my ActionScript knowledge and apply that to LightWave objects. :drool:

Thanks in advance,

Steve

Kvaalen
07-22-2003, 11:46 PM
Yes it is possible to have conditions. In the Expression Builder you can find more info about it but I think it is like this:

[Value1]=(or some othe sign)[Value2]:[If yes do this]?[If no do this].

Hope this helps :thumbsup:

aurora
07-23-2003, 12:13 AM
Well theres the clamp, range and/or select but I am not sure how you could check it over time (frames). This is one of the 2 things I really like about Maya. Its Mel script would allow you to do this no prob. I hope somebody else has better insight into this then I do, Sorry.

Kvaalen
07-23-2003, 12:32 AM
It is possible to get the value of an item over time.

For instance:

[ITEM.POSITION.X,TIME]

or:

[ITEM.POSITION.X,FRAME]

After the TIME and Frame you can put a -1 or what ever you want.
(Note: If you write it after the TIME it goes back in seconds.)

aurora
07-23-2003, 12:52 AM
Man that is so cool, that must be the word of the day for me. I have not used expressions as much as I should and really need to start working with them more. Especially with this new short I want to start man it would help out so much. Me thinks I'm going to spend tonight going over the expression docs again tonight and start playing with them more.

Mike Pauza
07-23-2003, 04:11 AM
Hey Steve!

Just emailed you an example scene dude.

-Mike

Kvaalen
07-23-2003, 09:55 AM
Originally posted by aurora
Man that is so cool, that must be the word of the day for me. I have not used expressions as much as I should and really need to start working with them more. Especially with this new short I want to start man it would help out so much. Me thinks I'm going to spend tonight going over the expression docs again tonight and start playing with them more.

You are planning on making a short? Cool.

If you want to learn more about expressions, I'd advise you to first of all read the manual (the little that they have there) and then use the expression builder to learn more about what exists and what it can do. :thumbsup:

aurora
07-23-2003, 02:22 PM
Kvaalen, Thanks!
I read through the manual last. That sure did not take long. I also went out and went through The Expression Glossary at
http://www.lightwaveoz.org/BrainFood/Brainiac/glossary.html
and Luxology's Expression Builder Tut. Today I play!
As for the short. I have been planning it for about a year now. Its basically a music video/story for my daughter. I have the thing storyboarded and layedout to the hilt. I have a couple of the models pretty much done and have played with most of the effects I need including some rather nasty volume HV needs with volumetric lighting. Nasty in that its rendertime intensive as in my first trials took 2 days for 36 frames, argh!!!!! But worth it. I can need that scene twice but I can deal with it in post so I only need to render it once. I tried several cheat methods but they just did not compare.
Right now I'm working on lanscaping a couple of huge portions of it and planning on writting a tut on how I'm building the terrain. In fact I think I may take Timothy Albees siren song and make several tuts on stuff I do throughout the process. My only hold up I have right now is I'm still trying to decide on the texturing style I want. I don't want to go full celshade nor photoreal which leaves a huge realm to explore inbetween.

Mike- Any chance I can see how you set that expression up for Steve? I'm curious to see if its something like what I'm going to try today.

Mike Pauza
07-23-2003, 02:50 PM
I "cheated" and did it without a conditional statement, but I think this does what Steve asked for:


http://www.3dpiranha.com/LeanExpression%20copy.gif




This constrains the the motorcycle object's bank to be proportional to angular velocity of the heading (how fast it's turning).

-Mike

Steve Warner
07-23-2003, 04:25 PM
Kvaalen, Aurora, and Mike,

:bowdown: :bowdown: :bowdown:

Thank you so much for your help!

Mike, I tried the sample you sent me and it's a godsend. It's exactly what I needed, and will save me loads of time.

Thanks, guys!

Steve

CGTalk Moderation
01-15-2006, 05:00 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.