PDA

View Full Version : Is this possible in XPresso?


FredSpeaks
11-03-2005, 12:24 AM
I am wondering if it is possible in XPresso (possibly with the COFFEE node) to create a variable with a set of possible parameters. Such a a variable size, with the possibilites of small medium, and large. Then I can set specific values based on this choice. If this is possible, how would I go about it?

Per-Anders
11-03-2005, 12:49 AM
i believe what you want are the "logic" nodes, "Compare" and "Condition". compare allows you to set a true/false value (same as used in the nodes "on" ports) based on another value, e.g. if the value in port 1 is higher than whatever the value in port 2 is, then the output will be "true". the condition node allows you to input an integer switch value that goes from 0 to whatever you want. then whatever that input value is, it will output what's inputed to the port with the same value. e.g. if you have a condition node with a switch and two inuts, the first input has 10 as it's input, the second has 15, if the switch input is set to 1, then the output will be 15, if it's set to 0, then the output will be 10 etc, it can also handle otehr datatypes, so you can have thinking particle groups in there for instance, and have it set a different particle group based on each value.

the COFFEE node coudl also do this all using the "if" statement, this is a standard scripting/coding command that is generally pretty simple to understand, it follows "if a condition is met then do this" in coding with COFFEE that comes down to

if (my condition) { do something }

where "my condition" could be anything along the lines of a>b or a==b etc, and "do something" can be any code, for instance setting the output to a value then breaking out of the script by using the "return" command.

FredSpeaks
11-03-2005, 01:05 AM
Thanks mdme_sadie. What I am looking for is some way to make the entering of the possible variations easier. I am coming from a programing environment that is a cross of BASIC and PASCAL. In it I could declare a variable say "SIZE" and then set all the variations that "SIZE" could have; ie "Small", "Medium", and "Large". I'm wondering if there is a way to use a User Data field to have a drop list of the variations for "SIZE".

Thanks

Per-Anders
11-03-2005, 01:15 AM
unfortunately user data fields can't have dropdowns as standard (simply down to the way user data is handled as far as i can see), a dropdown in cinema is actually a "LONG" or "INT" value, i.e. an integer, with string fields for each option. as you can't do this with USER data you just have to use an integer user data field and imagine it's value to be 0=small 1=medium etc.

what you would use is a condition node for this, just add as many inputs as you need.

you can use "Bool" values, but it takes a bit of effort to make the other ones switch off when you click a new one (would require using the COFFEE node, check the guitar pluck example further down to see how you can control a Bool's on/off state via a coffee node), but it's a direct approach at least, as each value is either on or off.

finally you could use a string user data field. for that you'd use the compare node to see if the string is equal to "Small" or "Medium" or "Large" etc, but the user would have to type that in manually.

FredSpeaks
11-03-2005, 01:39 AM
Thanks. Not what I wanted to hear, but thanks none the less.

CGTalk Moderation
11-03-2005, 01:39 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.