Condition command
Has anyone successfully made their own user defined condition or event?
Basically I'm trying to make a cute little editor to quickly tweak MR settings and I'm trying to create custom events in order to dim/enable controls based on whether or not certain MR features are on/off like FG, caustics etc. I made a global proc that queries and returns a boolean value but I'm having trouble getting the condition command to use that script. The documentation uses pre-defined dependency conditions in the example (and I can't find those to find out exactly how they went about writing them, like "SomethingSelected" and "UndoAvailable" etc). This is so frustrating because I really thought it would be simple enough, maybe I need a break. Sigh* |
Not sure I understand exactly what you're going for, can you give a pseudocode example?
|
Let's say I want my condition to be based on whether or not final gathering is on/off
and I create a global proc to query and return if it's true or false. Code:
global proc int getFG_orWhatever(){ Code:
condition -i -st getFG_orWhatever isFG_enabled; Code:
// Create a new condition, called "UndoNorRedo", which is true if |
Once I get my license reactivated, I'll take a look into it for you.
Try executing: Code:
whatIs UndoAvailable; |
Thanks ^^. Trying to look that up was actually one of the first things I tried, I even tried the 'SomethingSelected' since the docs used that in the example for the dimWhen command, which is really why I need this condition to work.
|
Hey Genny, sorry, I took a look around and found that it's defined in the core of Maya, so you can't define your own.
|
Aww lame, I had a feeling but I was holding out hope, thanks a ton for the help though. I was trying to be stingy with the global variables, guess I have to smear some more of those around and thrown in some scriptJobs.
|
Or pass an array :)
|
Hmm and have the script nab the various values from the array? Maybe I'm not looking at that right or even how it applies here so could you elaborate?
I was thinking, since I have a checkBox connected to say MR's fg attr, I would create a global var for the layout containing other ui elements that are fg related and create a scriptJob that's based on a change in the fg attr and enables/disables the layout and thus all its child controls. The custom condition would have allowed me to do that without having to define a global var but that's a no go. In this case I guess the global vars shouldn't be too much because there are really only so many Mr features, GI, FG, Caustics, AO and last but not least Raytrace which will have final say on whether all their controls will be enabled or not. Argh I'm babbling on. |
All times are GMT. The time now is 09:15 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018