Notifications
Clear all

[Closed] Declaring global variables in custom attributes?

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

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

2 Replies

how about persistent globals? they are saved with .max file

a ze to neresis na maxaree?

1 Reply
(@loocas)
Joined: 11 months ago

Posts: 0
  • Thanks a lot!!

a ze to neresis na maxaree?

  • ani nevim nejak me nenapadlo ptat se na neco takovyho na maxaree.