MAXScript Value Constructors (SDK)

3DS Max Plug-In SDK

MAXScript Value Constructors (SDK)

In the course of implementing new extensions to MAXScript, you will encounter the need to create MAXScript values, perhaps to pass back results or to work with other parts of the MAXScript API. This topic describes the MAXScript value classes, their constructors and how to cooperate with the automatic garbage collector.

All computable values in MAXScript are instances of classes derived from Value. MAXScript is polymorphic across all Value subclasses. These values are allocated in a separate, garbage collected heap, and carry their own runtime typing info.

All non-static instances of the Value class family should be heap-allocated with the 'new' operator or one of the following intern() functions so that garbage collection will work.

Certain classes with immutable instances provide interning functions in place of C++ constructors that may implement caches or other interning mechanisms. In particular, Name instances are always be created with Name::intern() to ensure pointer equality on names.

static Value* Float::intern(float init_val);

static Value* Integer::intern(int init_val);

static Value* Name::intern(char* str);

static Value* Name::find_intern(char* str);

static Value* MSTime::intern(TimeValue t);

 

AngAxisValue (const AngAxis& iaa);

AngAxisValue (const Matrix3& m);

AngAxisValue (const Quat& q);

AngAxisValue (float angle, Point3 axis);

AngAxisValue (float* angles);

AngAxisValue (Value* angle, Value* axis);

AngAxisValue (Value*);

Array (int init_size);

ColorValue (AColor col);

ColorValue (BMM_Color_64& col);

ColorValue (Color col);

ColorValue (COLORREF col);

ColorValue (float r, float g, float b, float a = 1.0f);

ColorValue (Point3 col);

ColorValue (Point3Value* col);

EulerAnglesValue (const AngAxis&);

EulerAnglesValue (const Matrix3&);

EulerAnglesValue (const Quat&);

EulerAnglesValue (float ax, float ay, float az);

Matrix3Value (const AngAxis& aa);

Matrix3Value (const Matrix3& im);

Matrix3Value (const Point3& row0, const Point3& row1,

const Point3& row2, Point3& row3); 

Matrix3Value (const Quat& q);

Matrix3Value (float* angles);

Matrix3Value (int i);

MSInterval (Interval i);

MSInterval (TimeValue s, TimeValue e);

Point2Value (float x, float y);

Point2Value (POINT ipoint);

Point2Value (Point2 ipoint);

Point2Value (Value* x, Value* y);

Point3Value (float x, float y, float z);

Point3Value (Point3 init_point);

Point3Value (Value* x, Value* y, Value* z);

QuatValue (AngAxis& aa);

QuatValue (const Quat& init_quat);

QuatValue (float w, float x, float y, float z);

QuatValue (float* angles);

QuatValue (Matrix3& m);

QuatValue (Value* val);

QuatValue (Value* w, Value* x, Value* y, Value* z);

RayValue (Point3 init_origin, Point3 init_dir);

RayValue (Ray init_ray);