Defining New System Globals (SDK)

3DS Max Plug-In SDK

Defining New System Globals (SDK)

You can define new system global variables with the define_system_global() function. It has the following signature:

void define_system_global(TCHAR* name,

Value* (*getter)(), 

Value* (*setter)(Value*)); 

Where name points to the string naming the new global and getter and setter are pointers to the getter and setter functions for the variable. For example:

{

... 

define_system_global("frameRate", get_frame_rate, set_frame_rate); 

... 

}

 

...

 

Value*

get_frame_rate()

{

return Integer::intern(GetFrameRate()); 

}

Value*

set_frame_rate(Value* val)

{

SetFrameRate(val->to_int()); 

return val; 

}