PDA

View Full Version : Declaring global variables in custom attributes?


loocas
12-17-2007, 09:52 AM
Hi there,

I have a problem with some custom attributes I've been designing for my rigs.

Currently, I'm using a variable, a controller, that I want to assign to my UI elements (sliders, spinners etc...) so that they're bound together. I then use these spinners/sliders to drive a lot of my float_script() controllers in my rigs.

The problem is that the global variable that I declared early on when working on the script, doesn't exist at startup, which causes the UI elements to go wrong and therefore the entire rig gets broken :cry:

Is there any way to declare the global variable before Max evaulates all the other elements in the rig? But, I need a solution that gets carried in the scene, i.e.: I don't want to write the var. declaration in a stdplugs/stdscripts script in max's directory, because I'd have to share that on all machines etc... etc...

The variable is a very very basic Bezier_Float() declaration, i.e.: global myVar = Bezier_Float() that I want to use later on in my custom attributes definitions so that the UI elements get tied together.

Thanks in advance for any tips/hints :thumbsup:

vize
12-17-2007, 12:23 PM
how about persistent globals? they are saved with .max file

a ze to neresis na maxaree? :)

loocas
12-17-2007, 01:38 PM
how about persistent globals? they are saved with .max file

- Thanks a lot!! ;)

a ze to neresis na maxaree? :)

- ani nevim :D nejak me nenapadlo ptat se na neco takovyho na maxaree.

CGTalk Moderation
12-17-2007, 01:38 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.