added everything

This commit is contained in:
Metario
2017-04-17 06:17:10 -06:00
commit 9c6ff74f19
6121 changed files with 1625704 additions and 0 deletions

View File

@ -0,0 +1,498 @@
/* 3DMath.h - the 3D math family of classes - vectors, rays, quat, matrices for MAXScript
*
* Copyright (c) John Wainwright, 1996
*
*
*/
#ifndef _H_3DMATH
#define _H_3DMATH
#include "Max.h"
extern ScripterExport void _QuatToEuler(Quat &q, float *ang);
extern ScripterExport void _EulerToQuat(float *ang, Quat &q);
/* ------------------------ Point3Value ------------------------------ */
applyable_class (Point3Value)
class Point3Value : public Value
{
public:
Point3 p;
ENABLE_STACK_ALLOCATE(Point3Value);
ScripterExport Point3Value(Point3 init_point);
ScripterExport Point3Value(float x, float y, float z);
ScripterExport Point3Value(Value* x, Value* y, Value* z);
classof_methods(Point3Value, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
# define is_point3(p) ((p)->tag == class_tag(Point3Value))
static Value* make(Value**arg_list, int count);
/* operations */
#include "defimpfn.h"
# include "vectpro.h"
use_generic ( coerce, "coerce");
use_generic ( copy, "copy");
use_generic ( get, "get");
use_generic ( put, "put");
/* built-in property accessors */
def_property ( x );
def_property ( y );
def_property ( z );
Point3 to_point3() { return p; }
AColor to_acolor() { return AColor (p.x / 255.0f, p.y / 255.0f, p.z / 255.0f); }
Point2 to_point2() { return Point2 (p.x, p.y); }
void to_fpvalue(FPValue& v) { v.p = new Point3 (p); v.type = (ParamType2)TYPE_POINT3; }
COLORREF to_colorref() { return RGB((int)p.x, (int)p.y, (int)p.z); }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
class ConstPoint3Value : public Point3Value
{
public:
ScripterExport ConstPoint3Value(float x, float y, float z)
: Point3Value (x, y, z) { }
void collect() { delete this; }
BOOL is_const() { return TRUE; }
Value* set_x(Value** arg_list, int count) { throw RuntimeError (_T("Constant vector, not settable")); return NULL; }
// Win64 Cleanup: Shuler
Value* set_y(Value** arg_list, int count) { throw RuntimeError (_T("Constant vector, not settable")); return NULL; }
// Win64 Cleanup: Shuler
Value* set_z(Value** arg_list, int count) { throw RuntimeError (_T("Constant vector, not settable")); return NULL; }
// Win64 Cleanup: Shuler
};
// The following function has been added
// in 3ds max 4.2. If your plugin utilizes this new
// mechanism, be sure that your clients are aware that they
// must run your plugin with 3ds max version 4.2 or higher.
inline IPoint3 to_ipoint3(Value* val) {
Point3 p = val->to_point3();
return IPoint3((int)p.x, (int)p.y, (int)p.z); }
// End of 3ds max 4.2 Extension
/* ------------------------ RayValue ------------------------------ */
applyable_class (RayValue)
class RayValue : public Value
{
public:
Ray r;
ENABLE_STACK_ALLOCATE(RayValue);
ScripterExport RayValue(Point3 init_origin, Point3 init_dir);
ScripterExport RayValue(Ray init_ray);
classof_methods (RayValue, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
/* operations */
use_generic ( copy, "copy");
/* built-in property accessors */
def_property ( pos );
def_property_alias ( position, pos );
def_property ( dir );
Ray to_ray() { return r; }
void to_fpvalue(FPValue& v) { v.ray = new Ray (r); v.type = TYPE_RAY; }
# define is_ray(r) ((r)->tag == class_tag(RayValue))
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
/* ------------------------ QuatValue ------------------------------ */
applyable_class (QuatValue)
class QuatValue : public Value
{
public:
Quat q;
ENABLE_STACK_ALLOCATE(QuatValue);
ScripterExport QuatValue(const Quat& init_quat);
ScripterExport QuatValue(float w, float x, float y, float z);
ScripterExport QuatValue(Value* w, Value* x, Value* y, Value* z);
ScripterExport QuatValue(Value* val);
ScripterExport QuatValue(AngAxis& aa);
ScripterExport QuatValue(float* angles);
ScripterExport QuatValue(Matrix3& m);
classof_methods (QuatValue, Value);
# define is_quat(o) ((o)->tag == class_tag(QuatValue))
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
/* operations */
#include "defimpfn.h"
# include "quatpro.h"
use_generic ( copy, "copy");
/* built-in property accessors */
def_property ( w );
def_property ( x );
def_property ( y );
def_property ( z );
def_property ( angle );
def_property ( axis );
Quat to_quat() { return q; }
AngAxis to_angaxis() { return AngAxis(q); }
void to_fpvalue(FPValue& v) { v.q = new Quat (q); v.type = TYPE_QUAT; }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
/* ------------------------ AngleAxis ------------------------------ */
applyable_class (AngAxisValue)
class AngAxisValue : public Value
{
public:
AngAxis aa;
ENABLE_STACK_ALLOCATE(AngAxisValue);
ScripterExport AngAxisValue(const AngAxis& iaa);
ScripterExport AngAxisValue(const Quat& q);
ScripterExport AngAxisValue(const Matrix3& m);
ScripterExport AngAxisValue(float* angles);
ScripterExport AngAxisValue(float angle, Point3 axis);
ScripterExport AngAxisValue(Value*);
ScripterExport AngAxisValue(Value* angle, Value* axis);
classof_methods (AngAxisValue, Value);
# define is_angaxis(o) ((o)->tag == class_tag(AngAxisValue))
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
/* operations */
#include "defimpfn.h"
use_generic( coerce, "coerce" );
use_generic( eq, "=");
use_generic( ne, "!=");
use_generic( random, "random");
use_generic( copy, "copy");
/* built-in property accessors */
def_property ( angle );
def_property ( axis );
def_property ( numrevs );
AngAxis to_angaxis() { return aa; }
Quat to_quat() { return Quat (aa); }
void to_fpvalue(FPValue& v) { v.aa = new AngAxis (aa); v.type = TYPE_ANGAXIS; }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
/* ------------------------ EulerAngles ------------------------------ */
applyable_class (EulerAnglesValue)
class EulerAnglesValue : public Value
{
public:
float angles[3];
ENABLE_STACK_ALLOCATE(EulerAnglesValue);
ScripterExport EulerAnglesValue(float ax, float ay, float az);
ScripterExport EulerAnglesValue(const Quat&);
ScripterExport EulerAnglesValue(const Matrix3&);
ScripterExport EulerAnglesValue(const AngAxis&);
classof_methods (EulerAnglesValue, Value);
# define is_eulerangles(o) ((o)->tag == class_tag(EulerAnglesValue))
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
/* operations */
#include "defimpfn.h"
use_generic( coerce, "coerce" );
use_generic( eq, "=");
use_generic( ne, "!=");
use_generic( random, "random");
use_generic( copy, "copy");
/* built-in property accessors */
def_property ( x );
def_property ( y );
def_property ( z );
def_property ( x_rotation );
def_property ( y_rotation );
def_property ( z_rotation );
AngAxis to_angaxis() { return AngAxis (to_quat()); }
Quat to_quat() { Quat q; _EulerToQuat(angles, q); return Quat (q); }
void to_fpvalue(FPValue& v) { Quat q; _EulerToQuat(angles, q); v.q = new Quat (q); v.type = TYPE_QUAT; }
float* to_eulerangles() { return angles; }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
/* ------------------------ Matrix ------------------------------ */
applyable_class (Matrix3Value)
class Matrix3Value : public Value
{
public:
Matrix3 m;
ENABLE_STACK_ALLOCATE(Matrix3Value);
ScripterExport Matrix3Value(int i);
ScripterExport Matrix3Value(const Matrix3& im);
ScripterExport Matrix3Value(const Quat& q);
ScripterExport Matrix3Value(const AngAxis& aa);
ScripterExport Matrix3Value(float* angles);
ScripterExport Matrix3Value(const Point3& row0, const Point3& row1, const Point3& row2, const Point3& row3);
classof_methods (Matrix3Value, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
# define is_matrix3(p) ((p)->tag == class_tag(Matrix3Value))
/* operations */
#include "defimpfn.h"
# include "matpro.h"
use_generic( copy, "copy");
/* built-in property accessors */
def_property ( row1 );
def_property ( row2 );
def_property ( row3 );
def_property ( row4 );
def_property ( translation );
def_property ( pos );
def_property ( rotation );
def_property ( scale );
use_generic( get, "get");
use_generic( put, "put");
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
Matrix3& to_matrix3() { return m; }
Quat to_quat() { return Quat (m); }
void to_fpvalue(FPValue& v) { v.m = new Matrix3; *v.m = m; v.type = TYPE_MATRIX3; }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
/* ------------------------ Point2Value ------------------------------ */
applyable_class (Point2Value)
class Point2Value : public Value
{
public:
Point2 p;
ENABLE_STACK_ALLOCATE(Point2Value);
ScripterExport Point2Value(Point2 ipoint);
ScripterExport Point2Value(POINT ipoint);
ScripterExport Point2Value(float x, float y);
ScripterExport Point2Value(Value* x, Value* y);
classof_methods(Point2Value, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
# define is_point2(p) ((p)->tag == class_tag(Point2Value))
static Value* make(Value**arg_list, int count);
/* operations */
#include "defimpfn.h"
use_generic( plus, "+" );
use_generic( minus, "-" );
use_generic( times, "*" );
use_generic( div, "/" );
use_generic( uminus, "u-");
use_generic( eq, "=");
use_generic( ne, "!=");
use_generic( random, "random");
use_generic( length, "length");
use_generic( distance, "distance");
use_generic( normalize, "normalize");
use_generic( copy, "copy");
use_generic( get, "get");
use_generic( put, "put");
/* built-in property accessors */
def_property ( x );
def_property ( y );
Point2 to_point2() { return p; }
void to_fpvalue(FPValue& v) { v.p2 = new Point2(p); v.type = TYPE_POINT2; }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
// The following function has been added
// in 3ds max 4.2. If your plugin utilizes this new
// mechanism, be sure that your clients are aware that they
// must run your plugin with 3ds max version 4.2 or higher.
inline IPoint2 to_ipoint2(Value* val) {
Point2 p = val->to_point2();
return IPoint2((int)p.x, (int)p.y); }
// End of 3ds max 4.2 Extension
/* ------------------------ Point4Value ------------------------------ */
applyable_class (Point4Value)
class Point4Value : public Value
{
public:
Point4 p;
ENABLE_STACK_ALLOCATE(Point4Value);
ScripterExport Point4Value(Point4 init_point);
ScripterExport Point4Value(float x, float y, float z, float w);
ScripterExport Point4Value(Value* x, Value* y, Value* z, Value* w);
classof_methods(Point4Value, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
# define is_point4(p) ((p)->tag == class_tag(Point4Value))
static Value* make(Value**arg_list, int count);
/* operations */
#include "defimpfn.h"
# include "vectpro.h"
use_generic ( coerce, "coerce");
use_generic ( copy, "copy");
use_generic ( get, "get");
use_generic ( put, "put");
/* built-in property accessors */
def_property ( x );
def_property ( y );
def_property ( z );
def_property ( w );
Point4 to_point4() { return p; }
Point3 to_point3() { return Point3 (p.x, p.y, p.z); }
AColor to_acolor() { return AColor (p.x, p.y, p.z, p.w); }
Point2 to_point2() { return Point2 (p.x, p.y); }
void to_fpvalue(FPValue& v) { v.p4 = new Point4 (p); v.type = (ParamType2)TYPE_POINT4; }
COLORREF to_colorref() { return RGB((int)(p.x*255.f), (int)(p.y*255.f), (int)(p.z*255.f)); }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
// The following class has been added
// in 3ds max 4.2. If your plugin utilizes this new
// mechanism, be sure that your clients are aware that they
// must run your plugin with 3ds max version 4.2 or higher.
// Wraps Box2 in SDK which is a sub-class of the RECT structure in windows
applyable_class (Box2Value)
class Box2Value : public Value
{
public:
Box2 b;
ScripterExport Box2Value();
ScripterExport Box2Value(Box2 box);
ScripterExport Box2Value(RECT rect);
ScripterExport Box2Value(IPoint2 ul, IPoint2 lr);
ScripterExport Box2Value(int x, int y, int w, int h);
ScripterExport Box2Value(Value* x, Value* y, Value* w, Value* h);
classof_methods(Box2Value, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
# define is_box2(p) ((p)->tag == class_tag(Box2Value))
static Value* make(Value**arg_list, int count);
/* operations */
#include "defimpfn.h"
# include "boxpro.h"
/* built-in property accessors */
def_property ( x );
def_property ( y );
def_property ( w );
def_property ( h );
def_property ( left );
def_property ( top );
def_property ( right );
def_property ( bottom );
def_property ( center );
Box2& to_box2() { return b; }
};
// End of 3ds max 4.2 Extension
#endif

View File

@ -0,0 +1,18 @@
/*
* array_protocol.h - def_generics for Array protocol
*
* see def_abstract_generics.h for more info.
*
*
* Copyright <20> John Wainwright 1996
*
*/
def_generic (get, "get");
def_generic (put, "put");
def_visible_generic(append, "append");
def_visible_generic(deleteItem, "deleteItem");
def_visible_generic(findItem, "findItem");
def_visible_generic(join, "join");
def_visible_generic(sort, "sort");

View File

@ -0,0 +1,125 @@
/* Arrays.h - the Array family of classes for MAXScript
*
* Copyright (c) John Wainwright, 1996
*
*
*/
#ifndef _H_ARRAYS
#define _H_ARRAYS
#include "Collect.h"
/* ------------------------ Array ------------------------------ */
visible_class (Array)
class Array : public Value, public Collection
{
public:
int size; // array size
int data_size; // allocated array buffer size (in Value*'s)
Value** data; // the array elements (uninitialized are set to undefined)
ScripterExport static CRITICAL_SECTION array_update; // for syncing array updates
ScripterExport Array(int init_size);
ScripterExport ~Array() { if (data) free(data); }
classof_methods (Array, Value);
static Value* make(Value** arg_list, int count);
static void setup();
Value*& operator[](const int i) const { return data[i]; } // access ith array entry.
# define is_array(v) ((v)->tag == class_tag(Array))
BOOL _is_collection() { return 1; }
BOOL _is_selection() { return 1; }
void gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
// operations
#include "defimpfn.h"
# include "arraypro.h"
use_generic( plus, "+" );
use_generic( copy, "copy" );
use_generic( coerce, "coerce");
ScripterExport Value* map(node_map& m);
ScripterExport Value* map_path(PathName* path, node_map& m);
ScripterExport Value* find_first(BOOL (*test_fn)(INode* node, int level, void* arg), void* test_arg);
ScripterExport Value* get_path(PathName* path);
// built-in property accessors
def_property ( count );
ScripterExport Value* append(Value*);
ScripterExport Value* join(Value*);
ScripterExport Value* sort();
ScripterExport Value* push(Value*);
ScripterExport Value* drop();
ScripterExport Value* get(int index);
ScripterExport BOOL deep_eq(Value* other);
// get selection iterator for an array
SelectionIterator* selection_iterator();
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
void to_fpvalue(FPValue& v);
};
/* ------------------------ BitArray ------------------------------ */
visible_class (BitArrayValue)
class BitArrayValue : public Value
{
public:
BitArray bits; // the bits
ScripterExport BitArrayValue();
ScripterExport BitArrayValue(BitArray& b);
ScripterExport BitArrayValue(int count);
classof_methods (BitArrayValue, Value);
static Value* make(Value** arg_list, int count);
# define is_BitArrayValue(v) ((v)->tag == class_tag(BitArrayValue))
// BOOL _is_collection() { return 1; }
BOOL _is_selection() { return 1; }
void collect() { delete this; }
void sprin1(CharStream* s);
void can_hold(int index) { if (bits.GetSize() <= index) bits.SetSize(index); }
// operations
#include "defimpfn.h"
# include "arraypro.h"
use_generic( plus, "+" );
use_generic( minus, "-" );
def_generic( uminus, "u-");
use_generic( times, "*" );
use_generic( copy, "copy" );
use_generic( coerce, "coerce");
ScripterExport Value* map(node_map& m);
// built-in property accessors
def_property ( count );
def_property ( numberSet );
def_property ( isEmpty );
SelectionIterator* selection_iterator();
BitArray& to_bitarray() { return bits; }
void to_fpvalue(FPValue& v) { v.bits = &bits; v.type = TYPE_BITARRAY; }
# define is_bitarray(b) ((b)->tag == class_tag(BitArrayValue))
};
#endif

View File

@ -0,0 +1,14 @@
/*
* atmspro.h - def_generics for the operations on MAX atmosphere objects
*
* Copyright <20> John Wainwright 1996
*
*/
/* gizmo operations */
#ifndef NO_ATMOSPHERICS // russom - 04/11/02
def_visible_generic ( getGizmo, "getGizmo");
def_visible_generic ( deleteGizmo, "deleteGizmo");
def_visible_generic ( appendGizmo, "appendGizmo");
#endif // NO_ATMOSPHERICS

View File

@ -0,0 +1,3 @@
// Protocols for biped export classes
def_visible_generic(SetNonUniformScale, "SetNonUniformScale");

View File

@ -0,0 +1,344 @@
/*
* built_in_properties.h - known core property defs for MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
// MUST BE maintained in alpha order for parser lookup table use
// sort path props as though concatenated with '.', nested props as though
// prefixed with '*.'
def_nested_prop ( angle )
def_nested_prop ( axis )
def_nested_prop ( b )
def_nested_prop ( blue )
def_nested_prop ( controller )
def_nested_prop ( g )
def_nested_prop ( green )
def_nested_prop ( isAnimated )
def_nested_prop ( keys )
def_nested_prop ( r )
def_nested_prop ( red )
def_nested_prop_alias ( track, controller )
def_nested_prop ( w )
def_nested_prop ( x )
def_nested_prop ( x_rotation )
def_nested_prop ( y )
def_nested_prop ( y_rotation )
def_nested_prop ( z )
def_nested_prop ( z_rotation )
def_property ( a )
def_property ( alpha )
def_property ( angle )
def_property ( autoParam )
def_property ( autoUpdate )
def_property ( axis )
def_property ( axisTM )
def_property ( b )
def_property ( bias )
def_property ( blue )
def_property ( bottom )
def_property ( boxDisp )
def_property ( categories )
def_property ( category )
def_property ( center )
def_property ( children )
def_property ( classes )
def_property ( classID )
def_property ( closedInU )
def_property ( closedInV )
def_property ( clp )
def_property ( config )
def_property ( constantVelocity )
def_property ( continuity)
def_property ( controller )
def_property ( controllers )
def_property ( count )
def_property ( creatable )
def_property ( cubic )
def_property ( curvatureAngle )
def_property ( curvatureDistance )
def_property ( curveCVs )
def_property ( curves )
def_property ( curveStartPoint )
def_property ( curveStartPoint1 )
def_property ( curveStartPoint2 )
def_property ( degradeOnMove )
def_property ( dir )
def_property ( disabled )
def_property ( displacementMapping )
def_property ( display )
def_property ( displayCurveCVLattices )
def_property ( displayCurves )
def_property ( displayDependents )
def_property ( displayLattices )
def_property ( displayShadedLattice )
def_property ( displaySurfaces )
def_property ( displaySurfCVLattices )
def_property ( displayTrimming )
def_property ( distance )
def_property ( easeFrom )
def_property ( easeTo)
def_property ( edge )
def_property ( edge1 )
def_property ( edge2 )
def_property ( edges )
def_property ( effectsChannel )
def_property ( end )
def_property ( endsOverlap )
def_property ( extrudeVector )
def_property ( faces )
def_property ( fileName )
def_property ( flip1 )
def_property ( flip2 )
def_property ( flipNormals )
def_property ( flipTrim )
def_property ( flipTrim1 )
def_property ( flipTrim2 )
def_property ( frame )
def_property ( freeHandle )
def_property ( g )
def_property ( generateUVs1 )
def_property ( generateUVs2 )
def_property ( green )
def_property ( h )
def_property ( hidden )
def_property ( hue )
def_property ( ignoreAnimation )
def_property ( ignoreCameras )
def_property ( ignoreHelpers )
def_property ( ignoreLights )
def_property ( ignoreShapes )
def_property ( imports )
def_property ( index )
def_property ( inTangent )
def_property ( inTangentLength )
def_property ( inTangentType )
def_property ( isAnimated )
def_property ( isClosed )
def_property ( isEmpty )
def_property ( isoULines )
def_property ( isoVLines )
def_property ( keys )
def_property ( left )
def_property ( length1 )
def_property ( length2 )
def_property ( mat )
def_property_alias ( material, mat )
def_property ( matID )
def_property ( max )
def_property_alias ( maximum, max )
def_property ( merge )
def_property ( mesh )
def_property ( meshApproxType )
def_property ( meshUSteps )
def_property ( meshVSteps )
def_property ( min )
def_property_alias ( minimum, min )
def_property ( modifiers )
def_property ( name )
def_property ( normal )
def_property ( normalized )
def_property ( numberSet )
def_property ( numChannels )
def_property ( numcpvverts )
def_property ( numCurves )
def_property ( numCVs )
def_property ( numfaces )
def_property ( numGizmos )
def_property ( numKnots )
def_property_alias ( nummaterials, numsubs )
def_property ( numObjects )
def_property ( numPoints )
def_property ( numrevs )
def_property ( numsplines )
def_property ( numsubs )
def_property ( numTrimPoints )
def_property ( numtverts )
def_property ( numUCurves )
def_property ( numUCVs )
def_property ( numUKnots )
def_property ( numUPoints )
def_property ( numVCurves )
def_property ( numVCVs )
def_property ( numverts )
def_property ( numVKnots )
def_property ( numVPoints )
def_property ( nurbsID )
def_property ( nurbsSet )
def_property ( object )
def_property ( objectoffsetpos )
def_property ( objectoffsetrot )
def_property ( objectoffsetscale )
def_property ( objecttransform )
def_property ( offset )
def_property ( optimize )
def_property ( order )
def_property ( outTangent )
def_property ( outTangentLength )
def_property ( outTangentType )
def_property ( parallel )
def_property ( parameter )
def_property ( parameterRangeMax )
def_property ( parameterRangeMin )
def_property ( parent )
def_property ( parent1 )
def_property ( parent1ID )
def_property ( parent2 )
def_property ( parent2ID )
def_property ( parentID )
def_property ( pivot )
def_2_prop_path ( pivot, x )
def_2_prop_path ( pivot, y )
def_2_prop_path ( pivot, z )
def_property ( points )
def_property ( pos )
def_2_prop_path ( pos, controller )
def_2_prop_path ( pos, isAnimated )
def_2_prop_path ( pos, keys )
def_2_prop_path_alias ( pos, track, pos, controller )
def_2_prop_path ( pos, x )
def_2_prop_path ( pos, y )
def_2_prop_path ( pos, z )
def_property_alias ( position, pos )
def_2_prop_path_alias ( position, controller, pos, controller )
def_2_prop_path_alias ( position, isAnimated, pos, isAnimated )
def_2_prop_path_alias ( position, keys, pos, keys )
def_2_prop_path_alias ( position, track, pos, controller )
def_2_prop_path_alias ( position, x, pos, x)
def_2_prop_path_alias ( position, y, pos, y )
def_2_prop_path_alias ( position, z, pos, z )
def_property ( pVec )
def_property ( r )
def_property ( radius )
def_property ( rail )
def_property ( rail1 )
def_property ( rail1ID )
def_property ( rail2 )
def_property ( rail2ID )
def_property ( railID )
def_property ( red )
def_property ( renderable )
def_property ( renderApproximation )
def_property ( renderConfig )
def_property ( renderCurvatureAngle )
def_property ( renderCurvatureDistance )
def_property ( renderIsoULines )
def_property ( renderIsoVLines )
def_property ( renderMeshApproxType )
def_property ( renderMeshUSteps )
def_property ( renderMeshVSteps )
def_property ( renderSpacialEdge )
def_property ( renderViewDependent )
def_property ( right )
def_property ( rigid )
def_property ( rotation )
def_2_prop_path ( rotation, angle )
def_2_prop_path ( rotation, axis )
def_2_prop_path ( rotation, controller )
def_2_prop_path ( rotation, isAnimated )
def_2_prop_path ( rotation, keys )
def_2_prop_path_alias ( rotation, track, rotation, controller )
def_2_prop_path ( rotation, x_rotation )
def_2_prop_path ( rotation, y_rotation )
def_2_prop_path ( rotation, z_rotation )
def_property ( row1 )
def_property ( row2 )
def_property ( row3 )
def_property ( row4 )
def_property ( s )
def_property ( saturation )
def_property ( scale )
def_2_prop_path ( scale, axis )
def_2_prop_path ( scale, controller )
def_2_prop_path ( scale, isAnimated )
def_2_prop_path ( scale, keys )
def_2_prop_path_alias ( scale, track, scale, controller )
def_2_prop_path ( scale, x )
def_2_prop_path ( scale, y )
def_2_prop_path ( scale, z )
def_property ( seed )
def_property ( selected )
def_property ( selectedCurveCVs )
def_property ( selectedCurves )
def_property ( selectedEdges )
def_property ( selectedFaces )
def_property ( selectedImports )
def_property ( selectedPoints )
def_property ( selectedSurfaces )
def_property ( selectedSurfCVs )
def_property ( selectedVertices )
def_property_alias ( selectedVerts, selectedVertices )
def_property ( selSetNames )
def_property ( spacialEdge )
def_property ( splitMesh )
def_property ( start )
def_property ( steps )
def_property ( subdivisionDisplacement )
def_property ( superclassID )
def_property ( surfaces )
def_property ( surfCVs )
def_property ( sweep )
def_property ( target )
def_property ( tension )
def_property ( tension1 )
def_property ( tension2 )
def_property ( textureSurface1 )
def_property ( textureSurface2 )
def_property ( ticks )
def_property ( time )
def_property ( top )
def_property_alias ( track, controller )
def_property ( transform )
def_property ( translation )
def_property ( tree )
def_property ( trim )
def_property ( trim1 )
def_property ( trim2 )
def_property ( trimCurve )
def_property ( trimCurve1 )
def_property ( trimCurve2 )
def_property ( type )
def_property ( uEdgesOverlap )
def_property ( uOrder )
def_property ( uParam )
def_property ( uParameterRangeMax )
def_property ( uParameterRangeMin )
def_property ( uTangent )
def_property ( v )
def_property ( value)
def_property ( vEdgesOverlap )
def_property ( vertices)
def_property_alias ( verts, vertices )
def_property ( viewApproximation )
def_property ( viewConfig )
def_property ( viewCurvatureAngle )
def_property ( viewCurvatureDistance )
def_property ( viewDependent )
def_property ( viewIsoULines )
def_property ( viewIsoVLines )
def_property ( viewMeshApproxType )
def_property ( viewMeshUSteps )
def_property ( viewMeshVSteps )
def_property ( viewSpacialEdge )
def_property ( viewViewDependent )
def_property ( vOrder )
def_property ( vParam )
def_property ( vParameterRangeMax )
def_property ( vParameterRangeMin )
def_property ( vTangent )
def_property ( w )
def_property ( w_locked )
def_property ( weight )
def_property ( x )
def_property ( x_locked )
def_property ( x_rotation )
def_property ( y )
def_property ( y_locked )
def_property ( y_rotation )
def_property ( z )
def_property ( z_locked )
def_property ( z_rotation )

View File

@ -0,0 +1,40 @@
/*
* bitmap_protocol.h - protocol for MAX bitmaps
*
* Copyright <20> John Wainwright 1996
*
*/
// BitMap
def_visible_primitive( openBitMap, "openBitMap" );
def_visible_primitive( selectBitMap, "selectBitMap" );
def_visible_generic ( display, "display" );
def_visible_generic ( unDisplay, "unDisplay" );
def_visible_generic ( save, "save" );
use_generic ( close, "close" );
def_visible_generic ( gotoFrame, "gotoFrame" );
def_visible_generic ( getTracker, "getTracker" );
def_visible_generic ( deleteTracker, "deleteTracker" );
// def_visible_generic ( perspectiveMatch, "perspectiveMatch" );
use_generic ( copy, "copy" );
def_visible_generic ( zoom, "zoom" );
def_visible_generic ( crop, "crop" );
def_visible_generic ( setAsBackground, "setAsBackground" );
def_visible_generic ( getPixels, "getPixels" );
def_visible_generic ( setPixels, "setPixels" );
def_visible_generic ( getIndexedPixels, "getIndexedPixels" );
def_visible_generic ( setIndexedPixels, "setIndexedPixels" );
def_visible_generic ( getChannel, "getChannel" );
def_visible_generic ( getChannelAsMask, "getChannelAsMask" );
// BitMapWIndow
// MotionTracker
def_visible_generic ( resample, "resample");
def_visible_generic ( reset, "reset");
def_visible_generic ( clearCacheEntry, "clearCacheEntry");
def_visible_generic ( setCacheEntry, "setCacheEntry");

View File

@ -0,0 +1,164 @@
/*
* BitMaps.h - MAX bitmap access classes
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_BITMAPS
#define _H_BITMAPS
#include "Max.h"
#include "MAXObj.h"
#include "COMMDLG.H"
#include "bmmlib.h"
class MAXBitMapWindow;
class MotionTracker;
class MAXBitMap;
typedef struct // entry in MAXBitMap window table
{
HWND window;
MAXBitMap* mbm;
} mbm_window;
/* ------------------------ MAXBitMap ------------------------------ */
applyable_class (MAXBitMap)
class MAXBitMap : public Value
{
public:
BitmapInfo bi; // our BitMapInfo
Bitmap* bm; // the actual bitmap
Tab<MotionTracker*> trackers; // any motion trackers
MotionTracker* dragger; // tracker currently under drag
WNDPROC main_window_proc; // original display window proc if ours installed
GBuffer* gb; // GBuffer if non-NULL
GBufReader* gbr; // current GBuffer reader if non-NULL
short flags;
static Tab<mbm_window> windows; // table of MAXBitMap windows currently open
ScripterExport MAXBitMap();
ScripterExport MAXBitMap(BitmapInfo bi, Bitmap* bm);
~MAXBitMap();
static void setup();
static MAXBitMap* find_window_mbm(HWND hwnd);
classof_methods (MAXBitMap, Value);
# define is_bitmap(o) ((o)->tag == class_tag(MAXBitMap))
void collect() { delete this; }
void gc_trace();
ScripterExport void sprin1(CharStream* s);
Value* new_motionTracker();
void install_window_proc();
#include "defimpfn.h"
def_visible_generic ( display, "display");
def_visible_generic ( unDisplay, "unDisplay" );
def_visible_generic ( save, "save" );
def_visible_generic ( gotoFrame, "gotoFrame");
def_visible_generic ( close, "close");
def_visible_generic ( getTracker, "getTracker" );
def_visible_generic ( deleteTracker, "deleteTracker" );
use_generic ( copy, "copy" );
def_visible_generic ( zoom, "zoom" );
def_visible_generic ( crop, "crop" );
def_visible_generic ( setAsBackground, "setAsBackground" );
def_visible_generic ( getPixels, "getPixels" );
def_visible_generic ( setPixels, "setPixels" );
def_visible_generic ( getIndexedPixels, "getIndexedPixels" );
def_visible_generic ( setIndexedPixels, "setIndexedPixels" );
def_visible_generic ( getChannel, "getChannel" );
def_visible_generic ( getChannelAsMask, "getChannelAsMask" );
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void to_fpvalue(FPValue& v) { v.bm = new PBBitmap (bi); v.type = TYPE_BITMAP; }
};
#define BM_SAVED 0x0001 // bitmap has been written to and output steam is open
#define BM_READONLY 0x0002 // existing bitmap opened (and so readonly).
#define BM_FILEBACKED 0x0004 // bitmap is backed by a file
/* -------------------- MotionTracker -------------------------- */
applyable_class (MotionTracker)
class MotionTracker : public Value
{
public:
MAXBitMap* mbm; // the bitmap I'm tracking
int index; // which tracker in that bitmap
int cur_frame; // frame I last tracked
POINT center; // current feature center
RECT bounds; // feature bounds relative to center
RECT motion_bounds; // maximum frame-to-frame motion relative to feature center
POINT mouse_down_at; // mouse pos at mousedown
int handle_x; // handle pos at mouse_down..
int handle_y; // handle pos at mouse_down..
int handle; // which handle is dragging
BYTE* target; // current target image as 3 BYTE RGB per pixel
POINT* track_cache; // keeps a cache of tracking coords, one per frame (inval if change gizmo)
short compare_mode; // feature matching space: rgb color, luminence, edge-filtered, etc.
float match_distance; // last tracking match 'distance'
HBITMAP id_bitmap; // unbelievable - I need to use a bitmap copy to do XOR text drawing
short flags;
MotionTracker(MAXBitMap* imbm, int iindex);
~MotionTracker();
classof_methods(MotionTracker, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
void gc_trace();
void track();
void clear_track_cache();
void set_center(int x, int y);
void set_index(int i);
void copy_target();
void draw(HWND hWnd);
void draw_gizmo(HDC hdc);
void inval_gizmo();
BOOL start_drag(HWND hwnd, int wParam, long lParam);
void drag(HWND hwnd, int wParam, long lParam);
void end_drag(HWND hwnd);
void move(HWND hwnd, int dx, int dy);
void deselect(HWND hwnd);
def_visible_generic ( resample, "resample");
def_visible_generic ( reset, "reset");
def_property ( center );
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
};
#define MT_GIZMO_SELECTED 0x0001
#define MT_GIZMO_MOVED 0x0002
#define MT_ENABLED 0x0004
#define MT_MATCH_RGB 0
#define MT_MATCH_GRAY 1
#define MT_MATCH_EDGE 2
#define MT_MATCH_RANK 3
#define MT_NO_HANDLE 0 // handle codes...
#define MT_CENTER 1
#define MT_TOPLEFT_BOUNDS 2
#define MT_BOTLEFT_BOUNDS 3
#define MT_TOPRIGHT_BOUNDS 4
#define MT_BOTRIGHT_BOUNDS 5
#define MT_TOPLEFT_MBOUNDS 6
#define MT_BOTLEFT_MBOUNDS 7
#define MT_TOPRIGHT_MBOUNDS 8
#define MT_BOTRIGHT_MBOUNDS 9
#endif

View File

@ -0,0 +1,13 @@
// Protocol for BigMatrix class
use_generic( get, "get");
use_generic( put, "put");
use_generic( identity, "identity"); //Should actually be mapped_generic
use_generic( plus, "+");
def_visible_generic( invert, "invert");
def_visible_generic( transpose, "transpose");
def_visible_generic( clear, "clear");
def_visible_generic( setSize, "setSize");

View File

@ -0,0 +1,11 @@
// Protocols for Box classes
use_generic( eq, "=");
use_generic( ne, "!=");
use_generic( scale, "scale");
use_generic( translate, "translate");
def_visible_generic( isEmpty, "isEmpty");
def_visible_generic( contains, "contains");
def_visible_generic( rectify, "rectify");
def_visible_generic( empty, "empty");

View File

@ -0,0 +1,11 @@
/*
* class_ids.h - OLE Automation class id defs for MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
/* our class ID */
// {7FA22CB1-D26F-11d0-B260-00A0240CEEA3}
DEFINE_GUID(CLSID_MAXScript, 0x7fa22cb1, 0xd26f, 0x11d0, 0xb2, 0x60, 0x0, 0xa0, 0x24, 0xc, 0xee, 0xa3);

View File

@ -0,0 +1,149 @@
/* CodeTree.h - the CodeTree class - parser output
*
* Copyright (c) John Wainwright, 1996
*
*
*/
#ifndef _H_CODETREE
#define _H_CODETREE
class CodeTree : public Value
{
public:
Value* fn; /* the function to apply */
short count; /* number of arguments */
Value** arg_list; /* the argument list */
long pos; /* source stream pos */
CodeTree(CharStream* source, Value* codeFn, ...);
~CodeTree();
void gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
ScripterExport Value* eval();
Value* add(Value* arg1, ...);
Value* append(Value* arg);
Value* put(int index, Value* arg);
};
/* Maker class, a special CodeTree node that encodes runtime object
* instantiation. contains a reference to a maker
* static method on the class to be instantiated. It is
* supplied an arg_list like any other codetree fn apply
*/
class Maker : public Value
{
value_cf maker; /* the maker class static fn */
short count; /* number of arguments */
Value** arg_list; /* the argument list */
public:
Maker(value_cf maker_fn, ...);
Maker(Value** arg_list, int count, value_cf maker_fn);
~Maker();
void gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
ScripterExport Value* eval();
Value* add(Value* arg1, ...);
Value* append(Value* arg);
};
/* ------------- debugging support classes -------------- */
// SourceFileWrapper wraps a piece of code in a source file
// context. Evaling this pushes the 'source-file' thread-local,
// evals the wrapped code & pops source-file.
class SourceFileWrapper : public Value
{
public:
Value* file_name;
int pos;
Value* code;
MSZipPackage* package;
SourceFileWrapper(Value* file_name, Value* code, int pos = -1);
void gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s) { code->sprin1(s); }
BOOL _is_function() { return code->_is_function(); }
Value* classOf_vf(Value** arg_list, int count) { return code->classOf_vf(arg_list, count); }
Value* superClassOf_vf(Value** arg_list, int count) { return code->superClassOf_vf(arg_list, count); }
Value* isKindOf_vf(Value** arg_list, int count) { return code->isKindOf_vf(arg_list, count); }
BOOL is_kind_of(ValueMetaClass* c) { return code->is_kind_of(c); }
ScripterExport Value* eval();
ScripterExport Value* eval_no_wrapper();
ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL);
};
// SourceLineMarker instances are stuck in code
// as lines are change
class SourceLineMarker : public Value
{
public:
int pos;
SourceLineMarker(int pos);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s) { s->printf(_T("<line %d>"), pos); }
ScripterExport Value* eval() { thread_local(source_pos) = pos; return &ok; }
};
// top-level code block, provides a storage for top-level locals
// R4: CodeBlocks can now optionally be 'structured', made of on-handlers and local decls
// So it now supports call_handler() methods and property access to get at locals.
// If structured, there must at least be an 'on execute' handler which becomes the main
// executable body of the CodeBlock, and simple eval()'s onthe codeblock turn into
// call_handler(n_execute...);
// Further, locals in a structured codeblock are now effectively static, as are
// locals in rollups and plugins, they are initialized once the first time the block
// is used and have a lifetime corresponding to the lifetime of the codeblock. The
// per-execution-lifetime locals should be moved into the body of the 'on execute'
// handler. -- JBW 2/29/00
class CodeBlock : public Value
{
public:
Value* code; // the code
Value** locals; // local var array
int local_count; // " " count
HashTable* local_scope; // local name space
HashTable* handlers; // handler tables
BOOL initialized; // if locals in structured macroScript have been inited
CodeBlock();
~CodeBlock();
#define is_codeblock(v) (v->tag == INTERNAL_CODEBLOCK_TAG)
void init(Value* code, HashTable* local_scope);
void init_locals();
void collect() { delete this; }
void gc_trace();
void sprin1(CharStream* s);
void add_local();
Value* call_handler(Value* handler_or_name, Value** arg_list, int count);
Value* get_handler(Value* name);
Value* eval();
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
};
#endif

View File

@ -0,0 +1,148 @@
/* Collectable.h - Collectables include
*
* Copyright (c) John Wainwright, 1996
*
*/
#ifndef _H_COLLECTIBLE
#define _H_COLLECTIBLE
enum col_state {booting, pre_gc, in_mutator, in_mark, in_sweep, closing_down };
typedef struct free_mem free_mem; // free mem linked list entry
struct free_mem
{
free_mem* next;
free_mem* prev;
size_t size;
};
// collection flag bits ...
enum gc_flags
{
GC_IN_USE = 0x0001,
GC_GARBAGE = 0x0002,
GC_PERMANENT = 0x0004,
GC_IN_HEAP = 0x0008,
GC_NOT_NEW = 0x0010,
GC_STATIC = 0x0020,
GC_ON_STACK = 0x0040,
GC_MIGRATED_TO_HEAP = 0x0080,
};
// general purpose Collectable flag bits ...
enum gp_flags2
{
COLLECTABLE_IN_SPRIN1 = 0x0001, // used by values that can recursively call sprin1. For example, arrays
COLLECTABLE_UNUSED2 = 0x0002,
COLLECTABLE_UNUSED3 = 0x0004,
COLLECTABLE_UNUSED4 = 0x0008,
COLLECTABLE_UNUSED5 = 0x0010,
COLLECTABLE_UNUSED6 = 0x0020,
COLLECTABLE_UNUSED7 = 0x0040,
COLLECTABLE_UNUSED8 = 0x0080,
};
class Value;
class ValueMapper;
#define ALLOCATOR_STACK_SIZE 1024000 // initial size of allocation stack per thread
extern ScripterExport void push_alloc_frame(); // manage alloc stack...
extern ScripterExport void pop_alloc_frame();
extern ScripterExport void pop_alloc_frame(Value*& result); // pops & moves result into callers frame if only on stack
#define ENABLE_STACK_ALLOCATE(_class) \
ScripterExport void* operator new (size_t sz) { return stack_alloc(sz); } \
ScripterExport void* operator new (size_t sz, char flag) { return Collectable::operator new (sz, flag); }
// free-list is kept in a number of separate size-related sub-lists, specifically
// for the high-bandwidth low size allocs.
// the heads of these are in the free_list static array in Collectable.
// each consecutive sub-list is for chunks one GC_ALLOC_MULTIPLE greater than the previous.
// the following defines determine the number of sub-lists.
#define GC_NUM_SUBLISTS 128
#define GC_LOW_SUBLIST 16 // <16, 16, 20, 24, 28, 32, ... 512, >512
#define GC_SUBLIST_INDEX_SHIFT 4 // log2(LOW_SUBLIST)
class Collectable
{
public:
Collectable* next; // in heap: links (in whichever collector list this value is in);
// on stack: pointer to heap migrated value, NULL if not migrated
Collectable* prev;
static CRITICAL_SECTION heap_update; // for syncing allocation list updates
byte flags; // collection flags - see enum gc_flags
byte flags2; // general purpose flags - only to be used by Collectable - see enum gp_flags2
short flags3; // general purpose flags - can be used by Values
static Collectable* collectable_list; // head of the collectable list
static Collectable* permanent_list; // head of the permanent list
static free_mem* free_list[GC_NUM_SUBLISTS]; // head of the free list
static size_t heap_allocated; // running count of MAXScript heap usage
static size_t heap_size; // alloc'd heap size
// LAM: 2/23/01 - need to export following for ms_make_collectable (see below) to link in DLXs.
ScripterExport static col_state state; // current collector state
ScripterExport static bool fullCollectNextHoldFlush; // if true, perform gc on next Hold system flush
static bool gc_light; // if true, no Hold system flush during current gc
ScripterExport Collectable();
ScripterExport ~Collectable();
static ScripterExport void for_all_values(void (*map_fn)(Value* val), ValueMapper* mapper = NULL, ValueMetaClass* c = NULL);
ScripterExport static void* heap_alloc(size_t sz);
ScripterExport static void* stack_alloc(size_t sz);
ScripterExport static void heap_free(void* p);
ScripterExport void* operator new (size_t sz, char flag);
ScripterExport void* operator new (size_t sz) { return heap_alloc(sz); }
ScripterExport void operator delete (void* val);
ScripterExport void operator delete (void* val, char flag) { Collectable::operator delete(val); }
static void mark();
static void sweep();
static void setup(size_t);
ScripterExport static void gc();
static void coalesce_free_list();
virtual void collect() = 0; // does the actual collecting, needs to be virtual to get right size to operator delete
virtual void gc_trace() { mark_in_use(); } // the marking scanner, default is mark me in use
static void close_down();
static void drop_maxwrapper_refs();
ScripterExport void make_collectable();
void make_permanent(); // no long exported, must use make_heap_permanent AND use its result as the made-permament value
void make_static(); // " " " make_heap_static AND " " "
ScripterExport static void push_alloc_stack_frame();
ScripterExport static void pop_alloc_stack_frame();
int is_marked() { return (flags & GC_IN_USE); }
int is_not_marked()
{
assert (!is_on_stack()); // debugging new stack-based collector
return !is_marked();
}
int is_garbage() { return is_not_marked(); }
int is_permanent() { return (flags & GC_PERMANENT); }
void mark_in_use() { flags |= GC_IN_USE; }
void unmark_in_use() { flags &= ~GC_IN_USE; }
int has_heap_copy() { return (flags & (GC_IN_HEAP | GC_MIGRATED_TO_HEAP | GC_STATIC)); }
int is_in_heap() { return (flags & GC_IN_HEAP); }
int is_on_stack() { return (flags & GC_ON_STACK); }
};
// mapping object for Collectable::for_all_values()
class ValueMapper
{
public:
virtual void map(Value* val)=0;
};
ScripterExport void ms_free(void* p);
ScripterExport void* ms_malloc(size_t sz);
inline void ms_make_collectable(Collectable* v) { if (v != NULL && Collectable::state != closing_down) v->make_collectable(); }
#endif

View File

@ -0,0 +1,34 @@
/* Collection.h - MAXScript Collection classes
*
* Copyright (c) John Wainwright, 1996
*
*
*/
#ifndef _H_COLLECTION
#define _H_COLLECTION
class PathName;
class Collection
{
public:
# define is_collection(v) ((v)->_is_collection())
virtual Value* map_path(PathName* path, value_vf vfn_ptr, value_cf cfn_ptr, Value** arg_list, int count);
virtual Value* find_first(BOOL (*test_fn)(INode* node, int level, void* arg), void* test_arg);
virtual Value* get_path(PathName* path_name);
};
class SelectionIterator
{
public:
# define is_selection(v) ((v)->_is_selection())
virtual int next() { return -1; }
virtual BOOL more() { return FALSE; }
virtual void rewind() { }
virtual BOOL selected(int index) { return FALSE; }
};
#endif

View File

@ -0,0 +1,22 @@
/*
* color_protocol.h - def_generics for MAXScript Color protocol
*
* see def_abstract_generics.h for more info.
*
*
* Author John Wainwright
* Copyright <20> Autodesk Inc., 1997
*
*/
use_generic( plus, "+" );
use_generic( minus, "-" );
use_generic( times, "*" );
use_generic( div, "/" );
use_generic( uminus, "u-");
use_generic( eq, "=");
use_generic( ne, "!=");
use_generic( random, "random");
def_visible_generic( composite, "composite");

View File

@ -0,0 +1,95 @@
/* ColorValue.h - the color class for MAXScript
*
* Copyright (c) John Wainwright, 1997
*
*/
#ifndef _H_COLORVALUE
#define _H_COLORVALUE
#include "Max.h"
#include "COMMDLG.H"
#include "bmmlib.h"
#include "3DMath.h"
#define COLOR_CACHE_SIZE 1024 // must be power of 2
/* ------------------------ Color ------------------------------ */
applyable_class (ColorValue)
class ColorValue : public Value
{
public:
AColor color;
ENABLE_STACK_ALLOCATE(ColorValue);
ScripterExport ColorValue (AColor col);
ScripterExport ColorValue (Color col);
ScripterExport ColorValue (COLORREF col);
ScripterExport ColorValue (BMM_Color_64& col);
ScripterExport ColorValue (Point3 col);
ScripterExport ColorValue (Point3Value* col);
ScripterExport ColorValue (float r, float g, float b, float a = 1.0f);
static ScripterExport Value* intern(AColor col);
static ScripterExport Value* intern(float r, float g, float b, float a = 1.0f);
static ScripterExport Value* intern(BMM_Color_64& col);
classof_methods (ColorValue, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
# define is_color(c) ((c)->tag == class_tag(ColorValue))
#include "defimpfn.h"
# include "colorpro.h"
def_generic ( coerce, "coerce");
def_generic ( copy, "copy");
def_property ( red );
def_local_prop_alias ( r, red );
def_property ( green );
def_local_prop_alias ( g, green );
def_property ( blue );
def_local_prop_alias ( b, blue );
def_property ( alpha );
def_local_prop_alias ( a, alpha );
def_property ( hue );
def_local_prop_alias ( h, hue );
def_property ( saturation );
def_local_prop_alias ( s, saturation );
def_property ( value );
def_local_prop_alias ( v, value );
AColor to_acolor() { return color; }
Color to_color() { return Color (color.r, color.g, color.b); }
COLORREF to_colorref() { return RGB((int)(color.r * 255.0f), (int)(color.g * 255.0f), (int)(color.b * 255.0f)); }
Point3 to_point3() { return Point3 (color.r * 255.0, color.g * 255.0, color.b * 255.0); }
Point4 to_point4() { return Point4 (color.r, color.g, color.b, color.a); }
void to_fpvalue(FPValue& v) { v.clr = new Color (color.r, color.g, color.b); v.type = TYPE_COLOR; }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
class ConstColorValue : public ColorValue
{
public:
ScripterExport ConstColorValue (float r, float g, float b, float a = 1.0f)
: ColorValue(r, g, b, a) { }
void collect() { delete this; }
BOOL is_const() { return TRUE; }
Value* set_red(Value** arg_list, int count) { throw RuntimeError (_T("Constant color, not settable")); return NULL; }
Value* set_green(Value** arg_list, int count) { throw RuntimeError (_T("Constant color, not settable")); return NULL; }
Value* set_blue(Value** arg_list, int count) { throw RuntimeError (_T("Constant color, not settable")); return NULL; }
Value* set_alpha(Value** arg_list, int count) { throw RuntimeError (_T("Constant color, not settable")); return NULL; }
Value* set_hue(Value** arg_list, int count) { throw RuntimeError (_T("Constant color, not settable")); return NULL; }
Value* set_h(Value** arg_list, int count) { throw RuntimeError (_T("Constant color, not settable")); return NULL; }
Value* set_saturation(Value** arg_list, int count) { throw RuntimeError (_T("Constant color, not settable")); return NULL; }
Value* set_value(Value** arg_list, int count) { throw RuntimeError (_T("Constant color, not settable")); return NULL; }
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
/*
* MAX_create_protocol.h - def_generics for the create MAX objects
*
* see def_abstract_generics.h for more info.
*
*
* Copyright <20> John Wainwright 1996
*
*/
def_generic(create, "create");

View File

@ -0,0 +1,30 @@
/*
* ctbmpro.h - protocol for MAX camera tracker bitmaps
*
* Copyright <20> Autodesk, Inc 1998, John Wainwright
*
*/
//CTBitMap
def_visible_primitive ( openCTBitMap, "openCTBitMap" );
def_visible_primitive ( selectCTBitMap, "selectCTBitMap" );
use_generic ( display, "display" );
use_generic ( unDisplay, "unDisplay" );
use_generic ( save, "save" );
use_generic ( close, "close" );
use_generic ( gotoFrame, "gotoFrame" );
use_generic ( getTracker, "getTracker" );
use_generic ( deleteTracker, "deleteTracker" );
def_visible_generic ( perspectiveMatch, "perspectiveMatch" );
def_visible_generic ( loadFrames, "loadFrames" );
use_generic ( copy, "copy" );
use_generic ( zoom, "zoom" );
def_visible_generic ( resetZoom, "resetZoom" );
def_visible_generic ( setFade, "setFade" );
// CTMotionTracker
use_generic ( resample, "resample");
use_generic ( reset, "reset");
def_visible_generic ( setStruct, "setStruct");
def_visible_generic ( showTrack, "showTrack");
def_visible_generic ( invalTrack, "invalTrack");

View File

@ -0,0 +1,61 @@
/*
* MAX_controller_protocol.h - def_generics for the operations on MAX controller objects
*
* Copyright <20> John Wainwright 1996
*
*/
/* controller operations */
use_generic (copy, "copy");
/* time operations */
def_visible_generic ( supportsTimeOperations, "supportsTimeOperations");
def_mapped_generic ( deleteTime, "deleteTime");
def_mapped_generic ( reverseTime, "reverseTime");
def_mapped_generic ( scaleTime, "scaleTime");
def_mapped_generic ( insertTime, "insertTime");
def_visible_generic ( getTimeRange, "getTimeRange");
def_mapped_generic ( setTimeRange, "setTimeRange");
/* key operations */
def_mapped_generic ( addNewKey, "addNewKey");
def_mapped_generic ( deleteKeys, "deleteKeys");
def_visible_generic ( deleteKey, "deleteKey");
// def_visible_generic ( appendKey, "appendKey"); // RK: 6/19/02, Commenting these, breaks the SDK
// def_visible_generic ( assignKey, "assignKey"); // RK: 6/19/02, Commenting these, breaks the SDK
def_mapped_generic ( selectKeys, "selectKeys");
def_visible_generic ( selectKey, "selectKey");
def_mapped_generic ( deselectKeys, "deselectKeys");
def_visible_generic ( deselectKey, "deselectKey");
def_visible_generic ( isKeySelected, "isKeySelected");
def_mapped_generic ( moveKeys, "moveKeys");
def_visible_generic ( moveKey, "moveKey");
def_visible_generic ( numKeys, "numKeys");
def_visible_generic ( getKey, "getKey");
def_visible_generic ( getKeyTime, "getKeyTime");
def_visible_generic ( getKeyIndex, "getKeyIndex");
def_visible_generic ( numSelKeys, "numSelKeys");
def_mapped_generic ( sortKeys, "sortKeys");
def_mapped_generic ( reduceKeys, "reduceKeys");
def_mapped_generic ( mapKeys, "mapKeys");
/* ORT, ease curve functions */
def_mapped_generic ( addEaseCurve, "addEaseCurve");
def_mapped_generic ( deleteEaseCurve, "deleteEaseCurve");
def_visible_generic ( numEaseCurves, "numEaseCurves");
def_visible_generic ( applyEaseCurve, "applyEaseCurve");
def_visible_generic ( addMultiplierCurve, "addMultiplierCurve");
def_visible_generic ( deleteMultiplierCurve, "deleteMultiplierCurve");
def_visible_generic ( numMultiplierCurves, "numMultiplierCurves");
def_visible_generic ( getMultiplierValue, "getMultiplierValue");
def_visible_generic ( getBeforeORT, "getBeforeORT");
def_visible_generic ( getAfterORT, "getAfterORT");
def_mapped_generic ( setBeforeORT, "setBeforeORT");
def_mapped_generic ( setAfterORT, "setAfterORT");
def_mapped_generic ( enableORTs, "enableORTs");

View File

@ -0,0 +1,57 @@
/*
* defabs21.h - macros for making abstract declarations for MAXScript functions
*
* abstract def_ macros for MAX R2.1
*
* John Wainwright
* Copyright <20> Autodesk, Inc. 1998
*
*/
/* def_generic macro for abstract declaration in Value class */
#ifdef def_generic
# undef def_generic
# undef def_node_generic
# undef def_mapped_generic
# undef def_visible_generic
# undef def_struct_generic
# undef use_generic
# undef def_primitive
# undef def_mapped_primitive
# undef def_lazy_primitive
# undef def_visible_lazy_primitive
# undef def_visible_primitive
# undef def_struct_primitive
# undef def_property
# undef def_property_alias
# undef def_2_prop_path
# undef def_2_prop_path_alias
# undef def_nested_prop
# undef def_nested_prop_alias
#endif
#ifdef def_prop_getter
# undef def_prop_getter
# undef def_prop_setter
#endif
#define def_generic(fn, name)
#define def_visible_generic(fn, name) def_generic(fn, name)
#define def_struct_generic(fn, name) def_generic(fn, name)
#define def_node_generic(fn, name) def_generic(fn, name)
#define def_mapped_generic(fn, name) def_generic(fn, name)
#define use_generic(fn, name)
#define def_primitive(fn, name) // no member function declarations for primitives
#define def_visible_primitive(fn, name)
#define def_mapped_primitive(fn, name)
#define def_lazy_primitive(fn, name)
#define def_visible_lazy_primitive(fn, name)
#define def_struct_primitive(fn, _struct, name)
#define def_property(p)
#define def_property_alias(p, real_p)
#define def_2_prop_path(p1, p2)
#define def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define def_nested_prop(p1)
#define def_nested_prop_alias(p1, real_p1)

View File

@ -0,0 +1,128 @@
/*
* def_abstract_functions.h - macros for making abstract declarations for MAXScript functions
*
* This will typically be used along with protocol definition files in Value.h
* to declare all the possible scripter-visible operations on MAXScript values.
*
* MAXScript generics are scripter-visible first-class values that wrap a
* reference to a virtual function declared on class Value. All core generics
* are defined this way via a set of defining macros and protocol files for
* each suite of operations. The core generics are all globally declared
* Generic instances, with names of the form xxx_gf. Corresponding virtuals
* are declared abstractly in class Value and have names of the form xxx_vf.
*
* All thusly declared genrics have the same signature:
* Value* xxx_vf(Value** arglist, int arg_count);
* That is, they are polymorphic up to Values and take an argument list array &
* actual count which they should check for conformance at runtime.
*
* Value subclasses that implement a particular protocol should use
* def_implement_generics.h macros to declare implementations. And one
* of these classes should use def_instance_generics.h to actually globally
* instantiate the generic objects. The abstract declarations in Value
* all contain type error signals, so that any generic invoked on a
* Value subclass instance that doesn't implement the generic will
* get a runtime type error.
*
* Similarly, scripter-visible primitive functions (non-generic) are
* represented by instances of the Primitive class and declared using
* these same def macro headers & corresponding def_primitive macros.
*
* Copyright <20> John Wainwright 1996
*
*/
/* def_generic macro for abstract declaration in Value class */
#ifdef def_generic
# undef def_generic
# undef def_node_generic
# undef def_mapped_generic
# undef def_visible_generic
# undef def_struct_generic
# undef use_generic
# undef def_primitive
# undef def_mapped_primitive
# undef def_lazy_primitive
# undef def_visible_lazy_primitive
# undef def_visible_primitive
# undef def_struct_primitive
# undef def_property
# undef def_property_alias
# undef def_2_prop_path
# undef def_2_prop_path_alias
# undef def_nested_prop
# undef def_nested_prop_alias
#endif
#ifdef def_prop_getter
# undef def_prop_getter
# undef def_prop_setter
#endif
#define def_generic(fn, name) \
virtual Value* fn##_vf(Value** arglist, int arg_count) { ABSTRACT_FUNCTION(_T(#name), this, Value*); }
#define def_visible_generic(fn, name) def_generic(fn, name)
#define def_struct_generic(fn, name) def_generic(fn, name)
#define def_node_generic(fn, name) def_generic(fn, name)
#define def_mapped_generic(fn, name) def_generic(fn, name)
#define use_generic(fn, name)
#define def_primitive(fn, name) // no member function declarations for primitives
#define def_visible_primitive(fn, name)
#define def_mapped_primitive(fn, name)
#define def_lazy_primitive(fn, name)
#define def_visible_lazy_primitive(fn, name)
#define def_struct_primitive(fn, _struct, name)
#define def_property(p) \
virtual Value* get_##p(Value** arg_list, int count) { return get_property(arg_list, count); } \
virtual Value* set_##p(Value** arg_list, int count) { return set_property(arg_list, count); }
#define def_property_alias(p, real_p)
#define def_2_prop_path(p1, p2) \
virtual Value* get_##p1##_##p2(Value** arg_list, int count) \
{ \
two_value_locals(cont, result); \
vl.cont = get_##p1(&n_##p1, 1); \
vl.result = vl.cont->get_##p2(&n_##p2, 1); \
return_value(vl.result); \
} \
virtual Value* set_##p1##_##p2(Value** arg_list, int count) \
{ \
one_value_local(cont); \
Value* args[2] = { arg_list[0], n_##p2 }; \
vl.cont = get_##p1(&n_##p1, 1); \
vl.cont->set_##p2(args, 2); \
args[0] = vl.cont; args[1] = n_##p1; \
set_##p1(args, 2); \
pop_value_locals(); \
return arg_list[0]; \
}
#define def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define def_nested_prop(p1) \
virtual Value* get_nested_##p1(Value** arg_list, int count) \
{ \
two_value_locals(cont, result); \
vl.cont = _get_property(arg_list[0]); \
vl.result = vl.cont->get_##p1(&n_##p1, 1); \
return_value(vl.result); \
} \
virtual Value* set_nested_##p1(Value** arg_list, int count) \
{ \
one_value_local(cont); \
Value* args[2] = { arg_list[0], n_##p1 }; \
vl.cont = _get_property(arg_list[1]); \
vl.cont->set_##p1(args, 2); \
_set_property(arg_list[1], vl.cont); \
pop_value_locals(); \
return arg_list[0]; \
}
#define def_nested_prop_alias(p1, real_p1)
/* abstract function 'bodies'... if these are called, we have a 'type doesnt implement' error */
#define ABSTRACT_FUNCTION(m, v, t) throw NoMethodError (m, v); return (t)0
#define ABSTRACT_CONVERTER(t, l) throw ConversionError (this, _T(#l)); return (t)0
#define ABSTRACT_WIDENER(a) throw IncompatibleTypes (this, a); return (Value*)&undefined
#define ABSTRACT_GETTER() throw AccessorError (this, arg_list[0]); return (Value*)&undefined
#define ABSTRACT_SETTER() throw AccessorError (this, arg_list[1]); return (Value*)&undefined

View File

@ -0,0 +1,60 @@
/*
* def_extern_functions.h - macros for reference extern declarations
* for MAXScript functions
*
* This will typically be used along with protocol definition files in
* the code wants to reference MAXScript core function objects.
*
* see def_abstract_functions.h for more info.
*
*
* Copyright <20> John Wainwright 1996
*
*/
/* def_generic macro for extern declarations */
#ifdef def_generic
# undef def_generic
# undef def_node_generic
# undef def_mapped_generic
# undef def_visible_generic
# undef def_struct_generic
# undef use_generic
# undef def_primitive
# undef def_mapped_primitive
# undef def_lazy_primitive
# undef def_visible_lazy_primitive
# undef def_visible_primitive
# undef def_struct_primitive
# undef def_property
# undef def_property_alias
# undef def_2_prop_path
# undef def_2_prop_path_alias
# undef def_nested_prop
# undef def_nested_prop_alias
#endif
#define def_generic(fn, name) \
extern Generic fn##_gf
#define def_visible_generic(fn, name) def_generic(fn, name)
#define def_struct_generic(fn, name) def_generic(fn, name)
#define def_node_generic(fn, name) def_generic(fn, name)
#define def_mapped_generic(fn, name) def_generic(fn, name)
#define use_generic(fn, name) def_generic(fn, name)
#define def_primitive(fn, name) \
extern Primitive fn##_pf
#define def_lazy_primitive(fn, name) def_primitive(fn, name)
#define def_visible_lazy_primitive(fn, name) def_primitive(fn, name)
#define def_visible_primitive(fn, name) def_primitive(fn, name)
#define def_mapped_primitive(fn, name) def_primitive(fn, name)
#define def_struct_primitive(fn, _struct, name) def_primitive(fn, name)
#undef def_name
#define def_name(name) extern ScripterExport Value* n_##name;
#undef def_marker
#define def_marker(var, str) extern ScripterExport Name var;

View File

@ -0,0 +1,454 @@
/*
* def_implement_functions.h - macros for making implementation declarations
* for MAXscript functions
*
* This will typically be used along with protocol definition files in
* the Value subclasses that actually implement those protocols.
*
* see def_abstract_functionss.h for more info.
*
*
* Copyright <20> John Wainwright 1996
*
*/
/* def_generic macro for implementation declaration in Value subclasses */
#ifdef def_generic
# undef def_generic
# undef def_node_generic
# undef def_mapped_generic
# undef def_visible_generic
# undef def_struct_generic
# undef use_generic
# undef def_primitive
# undef def_mapped_primitive
# undef def_lazy_primitive
# undef def_visible_lazy_primitive
# undef def_visible_primitive
# undef def_struct_primitive
# undef def_property
# undef def_property_alias
# undef def_2_prop_path
# undef def_2_prop_path_alias
# undef def_nested_prop
# undef def_nested_prop_alias
#endif
#ifdef def_prop_getter
# undef def_prop_getter
# undef def_prop_setter
#endif
#define def_generic(fn, name) \
Value* fn##_vf(Value** arglist, int arg_count)
#define def_visible_generic(fn, name) def_generic(fn, name)
#define def_struct_generic(fn, name) def_generic(fn, name)
#define def_node_generic(fn, name) def_generic(fn, name)
#define def_mapped_generic(fn, name) def_generic(fn, name)
#define use_generic(fn, name) def_generic(fn, name)
#define def_primitive(fn, name) // nothing for implementation...
#define def_lazy_primitive(fn, name) def_primitive(fn, name)
#define def_visible_lazy_primitive(fn, name) def_primitive(fn, name)
#define def_visible_primitive(fn, name) def_primitive(fn, name)
#define def_mapped_primitive(fn, name) def_primitive(fn, name)
#define def_struct_primitive(fn, _struct, name) def_primitive(fn, name)
#define def_property(p) \
Value* get_##p(Value** arg_list, int count); \
Value* set_##p(Value** arg_list, int count)
#define def_prop_getter(p) \
Value* get_##p(Value** arg_list, int count)
#define def_prop_setter(p) \
Value* set_##p(Value** arg_list, int count)
#define def_property_alias(p, real_p)
#define def_2_prop_path(p1, p2) \
Value* get_##p1##_##p2(Value** arg_list, int count); \
Value* set_##p1##_##p2(Value** arg_list, int count)
#define def_2_prop_path_alias(p1, p2, real_p1, real_p2)
#define def_nested_prop(p1) \
Value* get_nested_##p1(Value** arg_list, int count); \
Value* set_nested_##p1(Value** arg_list, int count)
#define def_backpatched_setter(_prop, _superclass) \
Value* \
set_##_prop(Value** arg_list, int count) \
{ \
_superclass::set_##_prop(arg_list, count); \
back_patch(); \
return arg_list[0]; \
};
#define def_local_prop_alias(p, real_p) \
Value* get_##p(Value** arg_list, int count) { return get_##real_p(arg_list, count); } \
Value* set_##p(Value** arg_list, int count) { return set_##real_p(arg_list, count); } \
#ifdef def_time_fn
# undef def_time_fn
#endif
#define def_time_fn(_fn) \
Value* _fn##_vf(Value** arglist, int arg_count)
#undef def_name
#define def_name(name) n_##name = Name::intern(_T(#name));
#undef def_marker
#define def_marker(var, str)
/* ---------------------------- utility macros ---------------------*/
#define _def_num_bin_op(_class, _conv, _op_fn, _op, _member) \
Value* \
_class::_op_fn##_vf(Value** arg_list, int count) \
{ \
one_value_local(widened); \
Value *arg, *result; \
arg = arg_list[0]; \
if (tag != arg->tag && (vl.widened = widen_to(arg, arg_list))) \
result = vl.widened->_op_fn##_vf(arg_list, 1); \
else \
result = _class::intern(_member _op (arg_list[0])->_conv()); \
pop_value_locals(); \
return result; \
}
#define _def_bin_op(_class, _conv, _op_fn, _op, _member) \
Value* \
_class::_op_fn##_vf(Value** arg_list, int count) \
{ \
one_value_local(widened); \
Value *arg, *result; \
arg = arg_list[0]; \
if (tag != arg->tag && (vl.widened = widen_to(arg, arg_list))) \
result = vl.widened->_op_fn##_vf(arg_list, 1); \
else \
result = new _class (_member _op (arg_list[0])->_conv()); \
pop_value_locals(); \
return result; \
}
#define _def_rel_op(_class, _conv, _op_fn, _rel_op, _member) \
Value* \
_class::_op_fn##_vf(Value** arg_list, int count) \
{ \
Value *cmpnd = arg_list[0], *result; \
if (comparable(cmpnd)) \
result = (_member _rel_op cmpnd->_conv()) ? \
&true_value : &false_value; \
else \
throw IncompatibleTypes(this, cmpnd); \
return result; \
}
#define def_eq_op(_class, _conv, _member) \
Value* \
_class::eq_vf(Value** arg_list, int count) \
{ \
Value *cmpnd = arg_list[0], *result; \
if (comparable(cmpnd)) \
result = (_member == cmpnd->_conv()) ? \
&true_value : &false_value; \
else \
result = &false_value; \
return result; \
}
#define def_ne_op(_class, _conv, _member) \
Value* \
_class::ne_vf(Value** arg_list, int count) \
{ \
Value *cmpnd = arg_list[0], *result; \
if (comparable(cmpnd)) \
result = (_member == cmpnd->_conv()) ? \
&false_value : &true_value; \
else \
result = &true_value; \
return result; \
}
#define _def_num_un_op(_class, _op_fn, _op, _member) \
Value* \
_class::_op_fn##_vf(Value** arg_list, int count) \
{ \
return _class::intern(_op _member); \
}
#define _def_un_op(_class, _op_fn, _op, _member) \
Value* \
_class::_op_fn##_vf(Value** arg_list, int count) \
{ \
return new _class (_op _member); \
}
#define def_bin_op(_class, _conv, _op_fn, _op) \
_def_num_bin_op(_class, _conv, _op_fn, _op, value)
#define def_rel_op(_class, _conv, _op_fn, _rel_op) \
_def_rel_op(_class, _conv, _op_fn, _rel_op, value)
#define def_un_op(_class, _op_fn, _op) \
_def_num_un_op(_class, _op_fn, _op, value)
#define def_math_fn(_fn) \
Value* \
_fn##_cf(Value** arg_list, int count) \
{ \
check_arg_count(_fn, 1, count); \
return Float::intern((float)_fn(arg_list[0]->to_float())); \
}
#define def_angle_trig_fn(_fn) \
Value* \
_fn##_cf(Value** arg_list, int count) \
{ \
check_arg_count(_fn, 1, count); \
return Float::intern(RadToDeg((float)_fn(arg_list[0]->to_float()))); \
}
#define def_float_trig_fn(_fn) \
Value* \
_fn##_cf(Value** arg_list, int count) \
{ \
check_arg_count(_fn, 1, count); \
return Float::intern((float)_fn(DegToRad(arg_list[0]->to_float()))); \
}
#define def_math_bin_fn(_fn) \
Value* \
_fn##_cf(Value** arg_list, int count) \
{ \
check_arg_count(_fn, 2, count); \
return Float::intern((float)_fn(arg_list[0]->to_float(), \
arg_list[1]->to_float())); \
}
#define def_angle_trig_bin_fn(_fn) \
Value* \
_fn##_cf(Value** arg_list, int count) \
{ \
check_arg_count(_fn, 2, count); \
return Float::intern(RadToDeg((float)_fn(arg_list[0]->to_float(), \
arg_list[1]->to_float()))); \
}
#define def_num_prop_accessors(_class, _prop, _member, _type, _conv ) \
Value* \
_class::get_##_prop(Value** arg_list, int count) \
{ \
return _type::intern(_member); \
} \
Value* \
_class::set_##_prop(Value** arg_list, int count) \
{ \
Value* val = arg_list[0]; \
_member = val->_conv(); \
return val; \
}
#define def_prop_accessors(_class, _prop, _member, _type, _conv ) \
Value* \
_class::get_##_prop(Value** arg_list, int count) \
{ \
return new _type (_member); \
} \
Value* \
_class::set_##_prop(Value** arg_list, int count) \
{ \
Value* val = arg_list[0]; \
_member = val->_conv(); \
return val; \
}
#define def_fn_prop_accessors(_class, _prop, _getter, _setter) \
Value* \
_class::get_##_prop(Value** arg_list, int count) \
{ \
return _getter; \
} \
Value* \
_class::set_##_prop(Value** arg_list, int count) \
{ \
Value* val = arg_list[0]; \
_setter; \
return val; \
}
#define def_fn_prop_getter(_class, _prop, _getter) \
Value* \
_class::get_##_prop(Value** arg_list, int count) \
{ \
return _getter; \
}
#define def_fn_prop_setter(_class, _prop, _setter) \
Value* \
_class::set_##_prop(Value** arg_list, int count) \
{ \
Value* val = arg_list[0]; \
_setter; \
return val; \
}
#define def_float_prop_accessors(_class, _prop, _member) \
def_num_prop_accessors(_class, _prop, _member, Float, to_float)
#define def_int_prop_accessors(_class, _prop, _member) \
def_num_prop_accessors(_class, _prop, _member, Integer, to_int)
#define def_point3_prop_accessors(_class, _prop, _member) \
def_fn_prop_accessors(_class, _prop, new Point3Value (_member), _member = val->to_point3())
#define def_angle_prop_accessors(_class, _prop, _member) \
def_fn_prop_accessors(_class, _prop, Float::intern(RadToDeg(_member)), _member = DegToRad(val->to_float()))
#define def_time_bin_op(_op_fn, _op) \
_def_bin_op(MSTime, to_timevalue, _op_fn, _op, time)
#define def_time_rel_op(_op_fn, _rel_op) \
_def_rel_op(MSTime, to_timevalue, _op_fn, _rel_op, time)
#define def_time_un_op(_op_fn, _op) \
_def_un_op(MSTime, _op_fn, _op, time)
#define def_quat_bin_op(_class, _conv, _op_fn, _op) \
_def_bin_op(_class, _conv, _op_fn, _op, q)
#define def_quat_rel_op(_class, _conv, _op_fn, _rel_op) \
_def_rel_op(_class, _conv, _op_fn, _rel_op, q)
#define def_quat_un_op(_class, _op_fn, _op) \
_def_un_op(_class, _op_fn, _op, q)
#define def_new_quat_fn(_fn, _arg_count, _call) \
Value* \
QuatValue::_fn##_vf(Value** arg_list, int count) \
{ \
check_arg_count(_fn, _arg_count, count + 1); \
return new QuatValue (_call); \
}
#define def_mut_quat_fn(_fn, _arg_count, _call) \
Value* \
QuatValue::_fn##_vf(Value** arg_list, int count) \
{ \
check_arg_count(_fn, _arg_count, count + 1); \
_call; \
return this; \
}
#define def_new_mat_fn(_fn, _arg_count, _call) \
Value* \
Matrix3Value::_fn##_vf(Value** arg_list, int count) \
{ \
check_arg_count(_fn, _arg_count, count + 1); \
return new Matrix3Value (_call); \
}
#define def_mut_mat_fn(_fn, _arg_count, _call) \
Value* \
Matrix3Value::_fn##_vf(Value** arg_list, int count) \
{ \
check_arg_count(_fn, _arg_count, count + 1); \
_call; \
return this; \
}
#define def_mat_primitive(_fn, _arg_count, _call) \
Value* \
_fn##_cf(Value** arg_list, int count) \
{ \
check_arg_count(_fn, _arg_count, count); \
return new Matrix3Value (_call); \
}
#define def_mat_bin_op(_class, _conv, _op_fn, _op) \
_def_bin_op(_class, _conv, _op_fn, _op, m)
#define def_mat_rel_op(_class, _conv, _op_fn, _rel_op) \
_def_rel_op(_class, _conv, _op_fn, _rel_op, m)
#define def_mat_un_op(_class, _op_fn, _op) \
_def_un_op(_class, _op_fn, _op, m)
// LAM: 2/27/01 - modified following to invalidate foreground/background rectangle instead of just
// foreground
#define def_bool_node_fns(name, getter, setter) \
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid) \
{ \
return ((INode*)obj)->getter() ? &true_value : &false_value; \
} \
void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val) \
{ \
((INode*)obj)->setter(val->to_bool()); \
InvalidateNodeRect((INode*)obj,t); \
}
#define def_bool_node_getter(name, getter) \
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid) \
{ \
return ((INode*)obj)->getter() ? &true_value : &false_value; \
} \
void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val) \
{ \
throw RuntimeError (_T("Property not settable: "), #name); \
}
#define def_ulong_node_fns(name, getter, setter) \
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid) \
{ \
return Integer::intern((int)((INode*)obj)->getter()); \
} \
void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val) \
{ \
((INode*)obj)->setter((ULONG)val->to_int()); \
InvalidateNodeRect((INode*)obj,t); \
}
#define def_color_node_fns(name, getter, setter) \
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid) \
{ \
DWORD rgb = ((INode*)obj)->getter(); \
return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f); \
} \
void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val) \
{ \
AColor c; \
c = val->to_acolor(); \
((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255))); \
InvalidateNodeRect((INode*)obj,t); \
}
// LAM: 2/27/01 - use following for node properties that don't require a redraw
// The following defines has been added
// in 3ds max 4.2. If your plugin utilizes this new
// mechanism, be sure that your clients are aware that they
// must run your plugin with 3ds max version 4.2 or higher.
#define def_bool_node_noredraw_fns(name, getter, setter) \
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid) \
{ \
return ((INode*)obj)->getter() ? &true_value : &false_value; \
} \
void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val) \
{ \
((INode*)obj)->setter(val->to_bool()); \
}
#define def_ulong_node_noredraw_fns(name, getter, setter) \
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid) \
{ \
return Integer::intern((int)((INode*)obj)->getter()); \
} \
void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val) \
{ \
((INode*)obj)->setter((ULONG)val->to_int()); \
}
#define def_color_node_noredraw_fns(name, getter, setter) \
Value* node_get_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid) \
{ \
DWORD rgb = ((INode*)obj)->getter(); \
return ColorValue::intern(GetRValue(rgb) / 255.0f, GetGValue(rgb) / 255.0f, GetBValue(rgb) / 255.0f); \
} \
void node_set_##name(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val) \
{ \
AColor c; \
c = val->to_acolor(); \
((INode*)obj)->setter(RGB((BYTE)(c.r * 255), (BYTE)(c.g * 255), (BYTE)(c.b * 255))); \
}
// End of 3ds max 4.2 Extension

View File

@ -0,0 +1,95 @@
/*
* def_instantiate_functions.h - macros for making instantiating declarations
* for MAXScript functions
*
* This will typically be used along with protocol definition files in
* distinguished Value subclasses that will host the static instantiation
* of MAXScript function objects.
*
* see def_abstract_functions.h for more info.
*
*
* Copyright <20> John Wainwright 1996
*
*/
/* def_generic macro for instantiation declarations */
#include "Funcs.h"
#ifdef def_generic
# undef def_generic
# undef def_node_generic
# undef def_mapped_generic
# undef def_visible_generic
# undef def_struct_generic
# undef use_generic
# undef def_primitive
# undef def_mapped_primitive
# undef def_lazy_primitive
# undef def_visible_lazy_primitive
# undef def_visible_primitive
# undef def_struct_primitive
# undef def_property
# undef def_property_alias
# undef def_2_prop_path
# undef def_2_prop_path_alias
# undef def_nested_prop
# undef def_nested_prop_alias
#endif
#ifdef def_prop_getter
# undef def_prop_getter
# undef def_prop_setter
#endif
#pragma pointers_to_members(full_generality, virtual_inheritance)
#define def_generic(fn, name) \
Generic fn##_gf (&_T("%"#name), &Value::fn##_vf)
#define def_visible_generic(fn, name) \
Generic fn##_gf (_T(name), &Value::fn##_vf)
#define def_struct_generic(fn, _struct, name) \
Generic fn##_gf (_T(name), &Value::fn##_vf, _T(#_struct))
#define def_node_generic(fn, name) \
NodeGeneric fn##_gf (_T(name), &Value::fn##_vf)
#define def_mapped_generic(fn, name) \
MappedGeneric fn##_gf (_T(name), &Value::fn##_vf)
#define use_generic(fn, name)
#define def_primitive(fn, name) \
Value* fn##_cf(Value**,int); \
Primitive fn##_pf (&_T("%"#name), fn##_cf) /* scripter-hidden name */
#define def_visible_primitive(fn, name) \
Value* fn##_cf(Value**,int); \
Primitive fn##_pf (_T(name), fn##_cf)
#define def_struct_primitive(fn, _struct, name) \
Value* fn##_cf(Value**,int); \
Primitive fn##_pf (_T(name), _T(#_struct), fn##_cf)
#define def_mapped_primitive(fn, name) \
Value* fn##_cf(Value**,int); \
MappedPrimitive fn##_pf (_T(name), fn##_cf)
#define def_lazy_primitive(fn, name) \
Value* fn##_cf(Value**,int); \
Primitive fn##_pf (&_T("%"#name), fn##_cf, LAZY_PRIMITIVE)
#define def_visible_lazy_primitive(fn, name) \
Value* fn##_cf(Value**,int); \
Primitive fn##_pf (_T(name), fn##_cf, LAZY_PRIMITIVE)
#define def_property(p) \
_T(#p), &Value::get_##p, &Value::set_##p,
#define def_property_alias(p, real_p) \
_T(#p), &Value::get_##real_p, &Value::set_##real_p,
#define def_2_prop_path(p1, p2) \
_T(#p1"."#p2), &Value::get_##p1##_##p2, &Value::set_##p1##_##p2,
#define def_2_prop_path_alias(p1, p2, real_p1, real_p2) \
_T(#p1"."#p2), &Value::get_##real_p1##_##real_p2, &Value::set_##real_p1##_##real_p2,
#define def_nested_prop(p1) \
_T("*."#p1), &Value::get_nested_##p1, &Value::set_nested_##p1,
#define def_nested_prop_alias(p1, real_p1) \
_T("*."#p1), &Value::get_nested_##real_p1, &Value::set_nested_##real_p1,
#undef def_name
#define def_name(name) ScripterExport Value* n_##name;
#undef def_marker
#define def_marker(var, str) ScripterExport Name var (_T(str));

View File

@ -0,0 +1,9 @@
/*
* eval_prims.h - evaluator primitive function defs for MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
def_primitive(progn, "progn")

View File

@ -0,0 +1,23 @@
/*
* math_protocol.h - def_generics for the generic function in the Math protocol
*
* see def_abstract_generics.h for more info.
*
*
* Copyright <20> John Wainwright 1996
*
*/
def_generic(plus, "+");
def_generic(minus, "-");
def_generic(times, "*");
def_generic(div, "/");
def_generic(uminus, "u-");
use_generic(eq, "=");
def_generic(ne, "!=");
def_generic(gt, ">");
def_generic(lt, "<");
def_generic(ge, ">=");
def_generic(le, "<=");

View File

@ -0,0 +1,183 @@
/* Exception.h - exception class for MAXScript
*
* Copyright (c) John Wainwright, 1996
*
*
*/
#ifndef _H_EXCEPTION
#define _H_EXCEPTION
class Value;
class Thunk;
class ValueMetaClass;
extern TCHAR* null_string;
class ScripterExport MAXScriptException
{
public:
virtual void sprin1(CharStream* s);
};
class ScripterExport UnknownSystemException : public MAXScriptException
{
public:
UnknownSystemException() {}
void sprin1(CharStream* s);
};
class ScripterExport SignalException : public MAXScriptException
{
public:
void sprin1(CharStream* s);
};
class ScripterExport CompileError : public MAXScriptException
{
public:
TCHAR* description;
TCHAR* info;
TCHAR* line;
TCHAR* file;
CompileError (TCHAR* d, TCHAR* i, TCHAR* l, TCHAR* f = null_string);
CompileError () { description = NULL; info = null_string; line = null_string; file = null_string; }
~CompileError ();
void sprin1(CharStream* s);
void set_file(TCHAR* f);
};
class ScripterExport SyntaxError : public CompileError
{
TCHAR* wanted;
TCHAR* got;
TCHAR* line;
public:
SyntaxError (TCHAR* w, TCHAR* g, TCHAR* l = null_string, TCHAR* f = null_string);
~SyntaxError ();
void sprin1(CharStream* s);
};
class ScripterExport TypeError : public MAXScriptException
{
Value* target;
ValueMetaClass* wanted_class;
TCHAR* description;
public:
TypeError (TCHAR* d, Value* t, ValueMetaClass* c = NULL);
~TypeError ();
void sprin1(CharStream* s);
};
class ScripterExport NoMethodError : public MAXScriptException
{
Value* target;
TCHAR* fn_name;
public:
NoMethodError (TCHAR* fn, Value* t);
~NoMethodError ();
void sprin1(CharStream* s);
};
#define unimplemented(m, t) throw NoMethodError (m, t)
class ScripterExport AccessorError : public MAXScriptException
{
Value* target;
Value* prop;
public:
AccessorError (Value* t, Value* p) { target = t; prop = p; }
void sprin1(CharStream* s);
};
class ScripterExport AssignToConstError : public MAXScriptException
{
Thunk* thunk;
public:
AssignToConstError (Thunk* t) { thunk = t; }
void sprin1(CharStream* s);
};
class ScripterExport ArgCountError : public MAXScriptException
{
int wanted;
int got;
TCHAR* fn_name;
public:
ArgCountError (TCHAR* fn, int w, int g);
~ArgCountError ();
void sprin1(CharStream* s);
};
class ScripterExport RuntimeError : public MAXScriptException
{
public:
TCHAR* desc1;
TCHAR* desc2;
Value* info;
RuntimeError (TCHAR* d1);
RuntimeError (TCHAR* d1, TCHAR* d2);
RuntimeError (TCHAR* d1, Value* ii);
RuntimeError (TCHAR* d1, TCHAR* d2, Value* ii);
RuntimeError (Value* ii);
~RuntimeError ();
void init(TCHAR* d1, TCHAR* d2, Value* ii);
void sprin1(CharStream* s);
};
class ScripterExport IncompatibleTypes : public MAXScriptException
{
Value* val1;
Value* val2;
public:
IncompatibleTypes (Value* v1, Value* v2) { val1 = v1; val2 = v2; }
void sprin1(CharStream* s);
};
class ScripterExport ConversionError : public MAXScriptException
{
Value* val;
TCHAR* type;
public:
ConversionError (Value* v, TCHAR* t);
~ConversionError ();
void sprin1(CharStream* s);
};
class FunctionReturn : public MAXScriptException
{
public:
Value* return_result;
FunctionReturn (Value* v) { return_result = v; }
void sprin1(CharStream* s);
};
class LoopExit : public MAXScriptException
{
public:
Value* loop_result;
LoopExit (Value* v) { loop_result = v; }
void sprin1(CharStream* s);
};
class LoopContinue : public MAXScriptException
{
public:
LoopContinue () { }
void sprin1(CharStream* s);
};
#endif

View File

@ -0,0 +1,585 @@
/* Functions.h - the Function family class - primitives, generics
*
* Copyright (c) John Wainwright, 1996
*
*/
#ifndef _H_FUNCTION
#define _H_FUNCTION
#undef def_generic
#define def_generic(fn, name) \
ScripterExport Value* fn##_vf(Value** arglist, int arg_count)
#define FPS_CACHE_SIZE 512
/* --- function base class -- */
visible_class (Function)
class Function : public Value
{
public:
TCHAR* name;
TCHAR* struct_name; // packaged in a struct if non-null
Function() { name = NULL; struct_name = NULL; }
ScripterExport Function(TCHAR* name, TCHAR* struct_name=NULL);
ScripterExport ~Function();
classof_methods (Function, Value);
# define is_function(o) ((o)->_is_function())
BOOL _is_function() { return 1; }
ScripterExport void sprin1(CharStream* s);
ScripterExport void export_to_scripter();
};
/* ---------------- call context base class ----------------- */
class CallContext
{
CallContext* previous;
public:
CallContext() : previous(NULL) { }
CallContext(CallContext* previous) : previous(previous) { }
// called by fn applier to establish context AFTER arguments eval'd
virtual void push_context() { if (previous) previous->push_context(); }
virtual void pop_context() { if (previous) previous->pop_context(); }
};
/* ----------------------- Generics ------------------------- */
visible_class (Generic)
class Generic : public Function
{
public:
value_vf fn_ptr;
Generic() { }
ScripterExport Generic(TCHAR* name, value_vf fn, TCHAR* struct_name = NULL);
Generic(TCHAR* name) : Function(name) { }
classof_methods (Generic, Function);
BOOL _is_function() { return 1; }
ScripterExport void init(TCHAR* name, value_vf fn);
void collect() { delete this; }
ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL);
};
visible_class (MappedGeneric)
class MappedGeneric : public Generic
{
public:
MappedGeneric() { }
ScripterExport MappedGeneric(TCHAR* name, value_vf fn);
MappedGeneric(TCHAR* name) : Generic(name) { }
classof_methods (MappedGeneric, Generic);
BOOL _is_function() { return 1; }
void collect() { delete this; }
ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL);
};
visible_class (NodeGeneric)
class NodeGeneric : public MappedGeneric
{
public:
ScripterExport NodeGeneric(TCHAR* name, value_vf fn);
NodeGeneric(TCHAR* name) : MappedGeneric(name) { }
classof_methods (NodeGeneric, MappedGeneric);
BOOL _is_function() { return 1; }
void collect() { delete this; }
ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL);
};
/* -------------------------- Primitives ------------------------------ */
#define LAZY_PRIMITIVE 0x0001
visible_class (Primitive)
class Primitive : public Function
{
public:
short flags;
value_cf fn_ptr;
Primitive() { }
ScripterExport Primitive(TCHAR* name, value_cf fn, short init_flags=0);
ScripterExport Primitive(TCHAR* name, TCHAR* structure, value_cf fn, short init_flags=0);
Primitive(TCHAR* name) : Function(name) { }
classof_methods (Primitive, Function);
BOOL _is_function() { return 1; }
void collect() { delete this; }
ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL);
};
visible_class (MappedPrimitive)
class MappedPrimitive : public Primitive
{
public:
ScripterExport MappedPrimitive(TCHAR* name, value_cf fn);
classof_methods (MappedPrimitive, Primitive);
BOOL _is_function() { return 1; }
void collect() { delete this; }
ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL);
};
/* ----- */
visible_class (MAXScriptFunction)
class MAXScriptFunction : public Function
{
public:
short parameter_count;
short local_count;
short keyparm_count;
short flags;
Value** keyparms;
Value* body;
HashTable* local_scope;
value_cf c_callable_fn;
ScripterExport MAXScriptFunction(TCHAR* name, int parm_count, int keyparm_count, Value** keyparms,
int local_count, Value* body, HashTable* local_scope, short flags = 0);
~MAXScriptFunction();
classof_methods (MAXScriptFunction, Function);
BOOL _is_function() { return TRUE; }
void collect() { delete this; }
void gc_trace();
void sprin1(CharStream* s);
Value* apply(Value** arglist, int count, CallContext* cc=NULL);
Value* apply_no_alloc_frame(Value** arglist, int count, CallContext* cc=NULL);
value_cf get_c_callable_fn();
Value* operator()(Value** arg_list, int count);
};
#define FN_MAPPED_FN 0x0001 // declared a collection-mapped function
#define FN_BODY_FN 0x0002 // a loop or other body function, don't trap exits here
#define FN_HAS_REFARGS 0x0004 // function has reference arguments
#define FN_MAPPED_EVAL 0x0008 // set while evaluating a mapped function on each item
// StructMethods wrap member functions accessed on a struct instance
// their apply() sets up the appropriate struct instance thread-local
// for member data access thunks
class Struct;
class StructMethod : public Value
{
public:
Struct* this_struct;
Value* fn;
StructMethod(Struct* t, Value* f);
void gc_trace();
void collect() { delete this; }
void sprin1(CharStream* s) { fn->sprin1(s); }
BOOL _is_function() { return fn->_is_function(); }
# define is_structMethod(o) ((o)->tag == INTERNAL_STRUCT_METHOD_TAG) // LAM - defect 307069
Value* classOf_vf(Value** arg_list, int count) { return fn->classOf_vf(arg_list, count); }
Value* superClassOf_vf(Value** arg_list, int count) { return fn->superClassOf_vf(arg_list, count); }
Value* isKindOf_vf(Value** arg_list, int count) { return fn->isKindOf_vf(arg_list, count); }
BOOL is_kind_of(ValueMetaClass* c) { return fn->is_kind_of(c); }
Value* get_property(Value** arg_list, int count) { return fn->get_property(arg_list, count); }
Value* eval() { return fn->eval(); }
Value* apply(Value** arglist, int count, CallContext* cc=NULL);
Value* apply_no_alloc_frame(Value** arglist, int count, CallContext* cc=NULL); // LAM - 11/16/02
};
// LAM - 9/6/02 - defect 291499
// PluginMethods wrap member functions accessed on a plugin instance
// their apply() sets up the appropriate plugin instance thread-local
// for member data access thunks
class MSPlugin;
class PluginMethod : public Value
{
public:
MSPlugin* this_plugin;
Value* fn;
PluginMethod(MSPlugin* t, Value* f);
void gc_trace();
void collect() { delete this; }
void sprin1(CharStream* s) { fn->sprin1(s); }
BOOL _is_function() { return fn->_is_function(); }
# define is_pluginMethod(o) ((o)->tag == INTERNAL_MSPLUGIN_METHOD_TAG)
Value* classOf_vf(Value** arg_list, int count) { return fn->classOf_vf(arg_list, count); }
Value* superClassOf_vf(Value** arg_list, int count) { return fn->superClassOf_vf(arg_list, count); }
Value* isKindOf_vf(Value** arg_list, int count) { return fn->isKindOf_vf(arg_list, count); }
BOOL is_kind_of(ValueMetaClass* c) { return (c->tag == INTERNAL_MSPLUGIN_METHOD_TAG) ? 1 : Value::is_kind_of(c); }
Value* get_property(Value** arg_list, int count) { return fn->get_property(arg_list, count); }
Value* eval() { return fn->eval(); }
Value* apply(Value** arg_list, int count, CallContext* cc=NULL);
Value* apply_no_alloc_frame(Value** arg_list, int count, CallContext* cc=NULL);
};
// UserProp & UserGeneric instances represent dynamically-added, user-defined generics
// on built-in classes. They are kept in sorted tables in ValueMetaClass instances,
// suitable for bsearching.
class UserProp
{
public:
Value* prop;
value_cf getter;
value_cf setter;
UserProp (Value* p, value_cf g, value_cf s) { prop = p; getter = g; setter = s; }
};
class UserGeneric
{
public:
Value* name;
value_cf fn;
UserGeneric(Value* n, value_cf f) { name = n; fn = f; }
};
// UserGenericValue is the scripter-visible generic fn value that dispatches the
// UserGeneric 'methods' in a target object's class
visible_class (UserGenericValue)
class UserGenericValue : public Function
{
public:
Value* fn_name;
Value* old_fn; // if non-NULL, the original global fn that this usergeneric replaced
ScripterExport UserGenericValue(Value* name, Value* old_fn);
classof_methods (UserGenericValue, Function);
BOOL _is_function() { return TRUE; }
void collect() { delete this; }
void gc_trace();
Value* apply(Value** arglist, int count, CallContext* cc=NULL);
};
#define def_user_prop(_prop, _cls, _getter, _setter) \
_cls##_class.add_user_prop(#_prop, _getter, _setter)
#define def_user_generic(_fn, _cls, _name) \
_cls##_class.add_user_generic(#_name, _fn)
// ------- MAXScript Function Publishing interface ----------------------
#include "iFnPub.h"
class InterfaceMethod;
class FPMixinInterfaceValue;
class FPEnum;
// FnPub function, a function published by a plugin using theFnPub system
// automatically exposed by MAXScript boot code during intial plugin scan
visible_class (InterfaceFunction)
class InterfaceFunction : public Function
{
public:
FPInterfaceDesc* fpid;
FPFunctionDef* fd;
InterfaceFunction(FPInterface* fpi, FPFunctionDef* fd);
~InterfaceFunction();
classof_methods (InterfaceFunction, Function);
BOOL _is_function() { return TRUE; }
void collect() { delete this; }
void gc_trace();
void sprin1(CharStream* s);
Value* apply(Value** arglist, int count, CallContext* cc=NULL);
Value* get_property(Value** arg_list, int count);
// parameter conversion utilities
ScripterExport static void val_to_FPValue(Value* v, ParamType2 type, FPValue& fpv, FPEnum* e=NULL);
ScripterExport static Value* FPValue_to_val(FPValue& fpv, FPEnum* e=NULL);
ScripterExport static void release_param(FPValue& fpv, ParamType2 type, Value* v, FPEnum* e=NULL);
ScripterExport static void init_param(FPValue& fpv, ParamType2 type);
ScripterExport static void validate_params(FPInterface* fpi, FunctionID fid, FPParamDef* pd, ParamType2 type, int paramNum, FPValue& val, Value* v);
ScripterExport static FPEnum* FindEnum(short id, FPInterfaceDesc* fpid);
};
// InterfaceMethod - wraps an InterfaceFunction and its target object for shorthand mixin calls
class InterfaceMethod : public InterfaceFunction
{
private:
InterfaceMethod(FPMixinInterfaceValue* fpiv, FPFunctionDef* fd);
static InterfaceMethod* interface_method_cache[FPS_CACHE_SIZE];
friend void Collectable::gc();
friend void Collectable::mark();
public:
FPMixinInterfaceValue* fpiv;
static ScripterExport InterfaceMethod* intern(FPMixinInterfaceValue* fpiv, FPFunctionDef* fd);
~InterfaceMethod();
def_generic ( isDeleted, "isDeleted"); // LAM: 11/23/01 - added - doesn't break SDK
use_generic( eq, "=" ); // LAM: 11/23/01 - added - doesn't break SDK
use_generic( ne, "!=" ); // LAM: 11/23/01 - added - doesn't break SDK
void collect() { delete this; }
void gc_trace();
Value* apply(Value** arglist, int count, CallContext* cc=NULL);
};
// Action predicate function wrappers...
visible_class (ActionPredicate)
class ActionPredicate : public InterfaceFunction
{
public:
short pred;
ActionPredicate(FPInterface* fpi, FPFunctionDef* fd, short pred);
classof_methods (ActionPredicate, Function);
BOOL _is_function() { return TRUE; }
void collect() { delete this; }
Value* apply(Value** arglist, int count, CallContext* cc=NULL);
};
// IObject, generic wrapper for objects that inherit from IObject
// this is a way to give simple interface-based wrappers to
// classes in MAX or 3rd-party plugins that MAXScript knows
// nothing about. The IObject instance must implement GetInterface()
visible_class (IObjectValue)
class IObjectValue : public Value
{
public:
IObject* iobj; // the IObject pointer
IObjectValue(IObject* io);
~IObjectValue();
# define is_iobject(c) ((c)->tag == class_tag(IObjectValue))
classof_methods (IObjectValue, Value);
void collect() { delete this; }
void sprin1(CharStream* s);
// The following methods have been added
// in 3ds max 4.2. If your plugin utilizes this new
// mechanism, be sure that your clients are aware that they
// must run your plugin with 3ds max version 4.2 or higher.
void to_fpvalue(FPValue& v) { v.iobj = iobj; v.type = TYPE_IOBJECT; }
// LAM; added following 2/15/01 - defect 275812. Per conversation with AdamF and Ravi,
// adding this doesn't break binary compatability
def_generic (show_interfaces, "showInterfaces");
// End of 3ds max 4.2 Extension
BaseInterface* GetInterface(Interface_ID id) { return iobj->GetInterface(id); }
//accesses interfaces on the IObject
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
};
// FPInterfaceValue, represents FPInterfaces in MAXScript
visible_class (FPInterfaceValue)
class FPInterfaceValue : public Value, public InterfaceNotifyCallback
{
public:
FPInterface* fpi; // interface
HashTable* fns; // interface fn lookup
HashTable* props; // interface prop lookup
FPInterface::LifetimeType lifetime; // interface lifetime control type
static bool enable_test_interfaces; // test interface enable flag
// Whether to call fpi->ReleaseInterface stored in Collectable::flags3 - bit 0
ScripterExport FPInterfaceValue(FPInterface* fpi);
~FPInterfaceValue();
# define is_fpstaticinterface(c) ((c)->tag == class_tag(FPInterfaceValue))
classof_methods (FPInterfaceValue, Value);
def_generic ( show_interface, "showInterface"); // LAM: 08/29/00
def_generic ( get_props, "getPropNames"); // LAM: added 2/1/02
def_generic ( isDeleted, "isDeleted"); // LAM: 11/23/01 - added - doesn't break SDK
use_generic( eq, "=" ); // LAM: 11/23/01 - added - doesn't break SDK
use_generic( ne, "!=" ); // LAM: 11/23/01 - added - doesn't break SDK
void collect() { delete this; }
void gc_trace();
void sprin1(CharStream* s);
// The following method has been added
// in 3ds max 4.2. If your plugin utilizes this new
// mechanism, be sure that your clients are aware that they
// must run your plugin with 3ds max version 4.2 or higher.
void to_fpvalue(FPValue& v) { v.fpi = fpi; v.type = TYPE_INTERFACE; }
// End of 3ds max 4.2 Extension
// from InterfaceNotifyCallback
void InterfaceDeleted(BaseInterface* bi) { fpi = NULL; }
// accesses methods & props in the interface
Value* _get_property(Value* prop);
Value* _set_property(Value* prop, Value* val);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
};
extern ScripterExport void print_FP_interface(CharStream* out, FPInterface* fpi, bool getPropNames = true,
bool getMethodNames = true, bool getInterfaceNames = true, bool getActionTables = true);
// FPMixinInterfaceValue provides wrappers for mixin interfaces on individual target objects
// stored in a cache for fast retrieval and to minimize over-consing
// Warning: FPMixinInterfaceValue can wrap a FPStaticInterface. If accessing FPMixinInterface
// specific items, test 'fpi->GetDesc()->flags & FP_MIXIN' first.
visible_class (FPMixinInterfaceValue)
class FPMixinInterfaceValue : public Value, public InterfaceNotifyCallback
{
private:
FPMixinInterfaceValue(FPInterface* fpi);
~FPMixinInterfaceValue();
static FPMixinInterfaceValue* FPMixinInterfaceValue::interface_cache[128];
friend void Collectable::gc();
friend void Collectable::mark();
public:
FPInterface* fpi; // interface
FPInterface::LifetimeType lifetime; // interface lifetime control type
// Whether to call fpi->ReleaseInterface stored in Collectable::flags3 - bit 0
static ScripterExport FPMixinInterfaceValue* intern(Value* prop_name, Value* target);
static ScripterExport FPMixinInterfaceValue* intern(FPInterface* fpi);
# define is_fpmixininterface(c) ((c)->tag == class_tag(FPMixinInterfaceValue))
classof_methods (FPMixinInterfaceValue, Value);
def_generic ( show_interface, "showInterface"); // LAM: 08/29/00
def_generic ( isDeleted, "isDeleted"); // LAM: 11/23/01 - added - doesn't break SDK
use_generic( eq, "=" ); // LAM: 11/23/01 - added - doesn't break SDK
use_generic( ne, "!=" ); // LAM: 11/23/01 - added - doesn't break SDK
def_generic ( get_props, "getPropNames"); // LAM: added 2/1/02
void collect() { delete this; }
void sprin1(CharStream* s);
// The following method has been added
// in 3ds max 4.2. If your plugin utilizes this new
// mechanism, be sure that your clients are aware that they
// must run your plugin with 3ds max version 4.2 or higher.
void to_fpvalue(FPValue& v) { v.fpi = fpi; v.type = TYPE_INTERFACE; }
// End of 3ds max 4.2 Extension
// from InterfaceNotifyCallback
void InterfaceDeleted(BaseInterface* bi);
// accesses methods & props in the interface
Value* _get_property(Value* prop);
Value* _set_property(Value* prop, Value* val);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
};
// FPStaticMethodInterfaceValue provides wrappers for static interfaces that
// have been registered with individual Value metaclasses as property
// interfaces on instances of the metaclasses' class, such that calls
// on methods in these interfaces pass the intance along as the first
// argument wrapped in an FPValue.
// these are used to allow factored static interfaces (such as meshOps)
// to appear as though they are mixin interfaces on several MAXScript value
// classes (such as node, baseobject, meshvalue), in which the target object
// is sent as a polymorphic first argument (via FPValue) to static interface
// method call, rather than as a 'this' pointer to a virtual mixin interface method
visible_class (FPStaticMethodInterfaceValue)
class FPStaticMethodInterfaceValue : public Value, public InterfaceNotifyCallback
{
private:
FPStaticMethodInterfaceValue(FPInterface* fpi, ParamType2 type, void* object);
~FPStaticMethodInterfaceValue();
static FPStaticMethodInterfaceValue* interface_cache[FPS_CACHE_SIZE];
friend void Collectable::gc();
friend void Collectable::mark();
public:
FPInterface* fpi; // interface
FPValue value; // the target object as FPValue first argument
FPInterface::LifetimeType lifetime; // interface lifetime control type
// Whether to call fpi->ReleaseInterface stored in Collectable::flags3 - bit 0
static ScripterExport FPStaticMethodInterfaceValue* intern(FPInterface* fpi, ParamType2 type, void* object);
# define is_fpstaticmethodinterface(c) ((c)->tag == class_tag(FPStaticMethodInterfaceValue))
classof_methods (FPStaticMethodInterfaceValue, Value);
def_generic ( show_interface, "showInterface"); // LAM: 08/29/00
def_generic ( isDeleted, "isDeleted"); // LAM: 11/23/01 - added - doesn't break SDK
use_generic( eq, "=" ); // LAM: 11/23/01 - added - doesn't break SDK
use_generic( ne, "!=" ); // LAM: 11/23/01 - added - doesn't break SDK
def_generic ( get_props, "getPropNames"); // LAM: added 2/1/02
void collect() { delete this; }
void sprin1(CharStream* s);
// from InterfaceNotifyCallback
void InterfaceDeleted(BaseInterface* bi) { fpi = NULL; }
// accesses methods & props in the interface
Value* _get_property(Value* prop);
Value* _set_property(Value* prop, Value* val);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
};
// StaticInterfaceMethod - wraps an FPStaticMethodInterfaceValue and its target object for property-based calls
class StaticInterfaceMethod : public InterfaceFunction
{
private:
StaticInterfaceMethod(FPStaticMethodInterfaceValue* fpiv, FPFunctionDef* fd);
static StaticInterfaceMethod* interface_method_cache[FPS_CACHE_SIZE];
friend void Collectable::gc();
friend void Collectable::mark();
public:
FPStaticMethodInterfaceValue* fpiv;
static ScripterExport StaticInterfaceMethod* intern(FPStaticMethodInterfaceValue* fpiv, FPFunctionDef* fd);
~StaticInterfaceMethod();
def_generic ( isDeleted, "isDeleted"); // LAM: 11/23/01 - added - doesn't break SDK
use_generic( eq, "=" ); // LAM: 11/23/01 - added - doesn't break SDK
use_generic( ne, "!=" ); // LAM: 11/23/01 - added - doesn't break SDK
void collect() { delete this; }
void gc_trace();
Value* apply(Value** arglist, int count, CallContext* cc=NULL);
};
#endif

View File

@ -0,0 +1,90 @@
/*
* HashTable.h - HashTable class for MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_HASHTABLE
#define _H_HASHTABLE
typedef struct
{
void* key;
void* value;
} binding;
typedef struct /* secondary extent struct */
{
size_t size; /* size of secondary extent */
binding* bindings; /* table of bindings */
} secondary;
#define KEY_IS_OBJECT 0x0001 /* init flags that indicate whether keys & values are full MXS collectable objects */
#define VALUE_IS_OBJECT 0x0002
int default_eq_fn(void* key1, void* key2); /* default comparator & hash fns */
INT_PTR default_hash_fn(void* key);
class HashTabMapper;
visible_class (HashTable)
class HashTable : public Value
{
secondary **table; /* primary extent: tbl of second's */
size_t size; /* table size */
int n_entries; /* no. entries in primary extent */
int (*eq_fn)(void*, void*); /* key equivalence function */
INT_PTR (*hash_fn)(void*); /* key hgashing function */
// Win64 Cleanup: Shuler
int cursor; /* cursors used for sequencing... */
int secondCursor;
short flags;
HashTable* inner; /* links to next & prev tables when */
HashTable* outer; /* used as a lexical scope table */
int level; // scope nesting level
static CRITICAL_SECTION hash_update; // for syncing allocation hashtable updates
public:
ScripterExport HashTable(size_t primary_size, int (*key_eq_fn)(void*, void*), INT_PTR (*key_hash_fn)(void*), int flags);
// Win64 Cleanup: Shuler
HashTable() { init(17, default_eq_fn, default_hash_fn, KEY_IS_OBJECT + VALUE_IS_OBJECT); }
HashTable(size_t primary_size) { init(primary_size, default_eq_fn, default_hash_fn, KEY_IS_OBJECT + VALUE_IS_OBJECT); }
~HashTable();
ScripterExport void init(size_t primary_size, int (*key_eq_fn)(void*, void*), INT_PTR (*key_hash_fn)(void*), int flags);
// Win64 Cleanup: Shuler
static void setup();
classof_methods (HashTable, Value);
void collect() { delete this;}
void gc_trace();
ScripterExport Value* get(void* key);
ScripterExport Value* put(void* key, void* val);
ScripterExport Value* put_new(void* key, void* val);
ScripterExport Value* find_key(void *val);
ScripterExport Value* set(void* key, void* val);
ScripterExport void remove(void* key);
ScripterExport void map_keys_and_vals(void (*fn)(void* key, void* val, void* arg), void* arg);
ScripterExport void map_keys_and_vals(HashTabMapper* mapper);
ScripterExport int num_entries() { return n_entries; }
HashTable* enter_scope();
HashTable* leave_scope();
HashTable* next_scope();
int scope_level() { return level; }
};
class HashTabMapper
{
public:
virtual void map(void* key, void* val)=0;
};
#define SECONDARY_BUCKET 5
#endif

View File

@ -0,0 +1,131 @@
/*
* IVisualMS.h - public interfaces to VisualMS
*
* IVisualMSMgr - core interface to the VisualMS manager
* IVisualMSForm - interface to an existing form
*
* Copyright <20> Autodesk, Inc, 2000. John Wainwright.
*
*/
#ifndef _H_IVISUALMS
#define _H_IVISUALMS
#include "max.h"
#include "iFnPub.h"
class IVisualMSMgr;
class IVisualMSForm;
class IVisualMSItem;
class IVisualMSCallback;
// -------- Core interface to the VisualMS manager -----------
class IVisualMSMgr : public FPStaticInterface
{
public:
virtual IVisualMSForm* CreateForm()=0; // create a new form
virtual IVisualMSForm* CreateFormFromFile(TCHAR* fname)=0; // create form from a .vms file
// function IDs
enum { createForm,
createFormFromFile,
};
};
#define VISUALMS_MGR_INTERFACE Interface_ID(0x423d2cf2, 0x526706b5)
inline IVisualMSMgr* GetVisualMSMgr() { return (IVisualMSMgr*)GetCOREInterface(VISUALMS_MGR_INTERFACE); }
// ------- interface to individual VisiualMS forms ------------
class IVisualMSForm : public FPMixinInterface
{
public:
virtual void Open(IVisualMSCallback* cb=NULL, TCHAR* source=NULL)=0; // open the form editor on this form
virtual void Close()=0; // close the form editor
virtual void InitForm(TCHAR* formType, TCHAR* formName, TCHAR* caption)=0;
virtual void SetWidth(int w)=0;
virtual void SetHeight(int h)=0;
virtual IVisualMSItem* AddItem(TCHAR* itemType, TCHAR* itemName, TCHAR* text, int src_from=-1, int src_to=-1)=0;
virtual IVisualMSItem* AddCode(TCHAR* code, int src_from=-1, int src_to=-1)=0;
virtual IVisualMSItem* FindItem(TCHAR* itemName)=0;
virtual BOOL GenScript(TSTR& script, TCHAR* indent=NULL)=0;
virtual BOOL HasSourceBounds(int& from, int& to)=0;
virtual void SetSourceBounds(int from, int to)=0;
FPInterfaceDesc* GetDesc();
// function IDs
enum { open,
close,
genScript,
};
// dispatch map
BEGIN_FUNCTION_MAP
VFN_0(open, Open);
VFN_0(close, Close);
FN_1( genScript, TYPE_BOOL, GenScript, TYPE_TSTR_BR);
END_FUNCTION_MAP
};
#define VISUALMS_FORM_INTERFACE Interface_ID(0x446b6824, 0x39502f75)
// ------- interface to individual VisiualMS form items ------------
class IVisualMSItem : public FPMixinInterface
{
public:
virtual void SetPropery(TCHAR* propName, float f)=0;
virtual void SetPropery(TCHAR* propName, int i)=0;
virtual void SetPropery(TCHAR* propName, bool b)=0;
virtual void SetPropery(TCHAR* propName, TCHAR* s)=0;
virtual void SetProperyLit(TCHAR* propName, TCHAR* s)=0;
virtual void SetPropery(TCHAR* propName, Point2 pt)=0;
virtual void SetPropery(TCHAR* propName, Point3 pt)=0;
virtual void SetPropery(TCHAR* propName, Tab<TCHAR*>* sa)=0;
virtual void SetHandler(TCHAR* eventName, TCHAR* source, int arg_start, int arg_end, int body_start, int body_end)=0;
virtual void GetShape(int& left, int& top, int& width, int& height)=0;
virtual void SetShape(int left, int top, int width, int height)=0;
virtual void AddComment(TCHAR* code, int src_from, int src_to)=0;
FPInterfaceDesc* GetDesc();
};
#define VISUALMS_ITEM_INTERFACE Interface_ID(0x13a403e4, 0x5f920eed)
// ------- base class for VMS edit callbacks ------------
// instances supplied to VMSMgr::CreateForm() and called-back
// when edit events happen
#define VISUALMS_CALLBACK_INTERFACE Interface_ID(0x612b70df, 0xef77884)
class IVisualMSCallback : public FPMixinInterface
{
public:
virtual void Save() { } // save changes
virtual void Close() { } // form editor close (already saved)
virtual void DeleteThis() { }
virtual HWND GetEditBox() { return NULL; }
FPInterfaceDesc* GetDesc() { return (FPInterfaceDesc*)GetCOREInterface(VISUALMS_CALLBACK_INTERFACE); }
// function IDs
enum { save,
close,
};
// dispatch map
BEGIN_FUNCTION_MAP
VFN_0(save, Save);
VFN_0(close, Close);
END_FUNCTION_MAP
};
#endif

View File

@ -0,0 +1,20 @@
/*
* kernel_protocol.h - def_generics for the MAXScript kernel protocol
*
* see def_abstract_generics.h for more info.
*
*
* Copyright <20> John Wainwright 1996
*
*/
def_mapped_generic( print, "print");
def_generic ( eq, "==");
def_generic ( ne, "!=");
def_generic ( coerce, "coerce");
def_visible_generic( classOf, "classOf");
def_visible_generic( superClassOf, "superClassOf");
def_visible_generic( isKindOf, "isKindOf");

View File

@ -0,0 +1,27 @@
/*
* lclabsfn.h - abstract generic function definitions for MAXScript SDK plug-ins
*/
#include "ClassCfg.h"
#ifdef def_local_generic
# undef def_local_generic
# undef use_local_generic
#endif
#ifdef use_generic
# undef use_generic
#endif
#define def_local_generic(fn, name) \
virtual Value* fn##_vf(Value** arglist, int arg_count) { ABSTRACT_FUNCTION(_T(#name), this, Value*); }
#define use_generic(fn, name)
#define use_local_generic(fn, name)
/* abstract function 'bodies'... if these are called, we have a 'type doesnt implement' error */
#ifndef ABSTRACT_FUNCTION
# define ABSTRACT_FUNCTION(m, v, t) throw NoMethodError (m, v); return (t)0
# define ABSTRACT_CONVERTER(t, l) throw ConversionError (this, _T(#l)); return (t)0
# define ABSTRACT_WIDENER(a) throw IncompatibleTypes (this, a); return (Value*)&undefined
#endif

View File

@ -0,0 +1,66 @@
/* LclClass.h - macros for defining local classes and generics in a MAXScript extension .dlx
*
*
* Copyright (c) Autodesk, Inc. 1988. John Wainwright.
*
*/
#ifndef _H_LOCALCLASS
#define _H_LOCALCLASS
#include "ClassCfg.h"
#define local_visible_class(_cls) \
class _cls##Class : public ValueMetaClass \
{ \
public: \
_cls##Class(TCHAR* name) : ValueMetaClass (name) { } \
void collect() { delete this; } \
}; \
extern _cls##Class _cls##_class;
#define local_applyable_class(_cls) \
class _cls##Class : public ValueMetaClass \
{ \
public: \
_cls##Class(TCHAR* name) : ValueMetaClass (name) { } \
void collect() { delete this; } \
Value* apply(Value** arglist, int count, CallContext* cc=NULL); \
}; \
extern _cls##Class _cls##_class;
#define local_visible_class_instance(_cls, _name) \
_cls##Class _cls##_class (_T(_name));
class MS_LOCAL_ROOT_CLASS;
typedef Value* (MS_LOCAL_ROOT_CLASS::*local_value_vf)(Value**, int);
#define cat0(_a) _a
#define cat1(_a) cat0(_a)
#define cat2(_a, _b) cat0(_a)##cat0(_b)
#define MS_LOCAL_ROOT_CLASS_TAG &cat2(MS_LOCAL_ROOT_CLASS, _class)
#define MS_LOCAL_GENERIC_CLASS_TAG &cat2(MS_LOCAL_GENERIC_CLASS, _class)
#define MS_LOCAL_GENERIC_CLASS_CLASS cat2(MS_LOCAL_GENERIC_CLASS, Class)
#define MS_LOCAL_GENERIC_CLASS_class cat2(MS_LOCAL_GENERIC_CLASS, _class)
#define str0(_c) #_c
#define str1(_c) str0(_c)
#define declare_local_generic_class \
class MS_LOCAL_GENERIC_CLASS_CLASS : public ValueMetaClass \
{ \
public: \
MS_LOCAL_GENERIC_CLASS_CLASS(TCHAR* name) : ValueMetaClass (name) { } \
void collect() { delete this; } \
}; \
extern MS_LOCAL_GENERIC_CLASS_CLASS MS_LOCAL_GENERIC_CLASS_class; \
class MS_LOCAL_GENERIC_CLASS : public Generic \
{ \
public: \
local_value_vf fn_ptr; \
MS_LOCAL_GENERIC_CLASS() { } \
MS_LOCAL_GENERIC_CLASS(TCHAR* name, local_value_vf fn); \
classof_methods (MS_LOCAL_GENERIC_CLASS, Generic); \
void collect() { delete this; } \
Value* apply(Value** arglist, int count, CallContext* cc=NULL); \
};
#endif

View File

@ -0,0 +1,24 @@
/*
* lclextfn.h - abstract generic function definitions for MAXScript SDK plug-ins
*/
#include "ClassCfg.h"
#ifdef def_local_generic
# undef def_local_generic
# undef use_local_generic
#endif
#ifdef use_generic
# undef use_generic
#endif
#define def_local_generic(fn, name) \
extern MS_LOCAL_GENERIC_CLASS fn##_gf
#define use_local_generic(fn, name) \
def_local_generic(fn, name)
#define use_generic(fn, name) \
extern Generic fn##_gf
#undef def_name
#define def_name(name) extern Value* n_##name;

View File

@ -0,0 +1,27 @@
/*
* lclimpfn.h - generic function implementation macros for MAXScript SDK plug-ins
*/
#include "ClassCfg.h"
#ifdef def_local_generic
# undef def_local_generic
# undef use_local_generic
#endif
#ifdef use_generic
# undef use_generic
#endif
#define def_local_generic(fn, name) \
Value* fn##_vf(Value** arglist, int arg_count)
#define use_local_generic(fn, name) \
def_local_generic(fn, name)
#define use_generic(fn, name) \
Value* fn##_vf(Value** arglist, int arg_count)
#undef def_name
#define def_name(name) n_##name = Name::intern(_T(#name));

View File

@ -0,0 +1,54 @@
/*
* lclinsfn.h - generic function instantiation macros for MAXScript SDK plug-ins
*/
#include "ClassCfg.h"
#ifdef def_local_generic
# undef def_local_generic
# undef use_local_generic
#endif
#ifdef use_generic
# undef use_generic
#endif
#pragma pointers_to_members(full_generality, virtual_inheritance)
#define def_local_generic(fn, name) \
MS_LOCAL_GENERIC_CLASS fn##_gf (_T(name), &MS_LOCAL_ROOT_CLASS::fn##_vf)
#define use_generic(fn, name)
#define use_local_generic(fn, name)
#undef def_name
#define def_name(name) Value* n_##name;
#define define_local_generic_class \
MS_LOCAL_GENERIC_CLASS::MS_LOCAL_GENERIC_CLASS(TCHAR*fn_name, local_value_vf fn)\
{ \
tag = MS_LOCAL_GENERIC_CLASS_TAG; \
fn_ptr = fn; \
name = save_string(fn_name); \
} \
Value* MS_LOCAL_GENERIC_CLASS::apply(Value** arg_list, int count, CallContext* cc) \
{ \
Value* result; \
Value** evald_args; \
Value **ap, **eap; \
int i; \
if (count < 1) \
throw ArgCountError("Generic apply", 1, count); \
value_local_array(evald_args, count); \
for (i = count, ap = arg_list, eap = evald_args; i--; eap++, ap++) \
*eap = (*ap)->eval(); \
if (evald_args[0]->local_base_class() == MS_LOCAL_ROOT_CLASS_TAG) \
result = (((MS_LOCAL_ROOT_CLASS*)evald_args[0])->*fn_ptr)(&evald_args[1], count - 1); \
else \
throw NoMethodError (name, evald_args[0]); \
pop_value_local_array(evald_args); \
return result; \
} \
MS_LOCAL_GENERIC_CLASS_CLASS MS_LOCAL_GENERIC_CLASS_class (str1(MS_LOCAL_GENERIC_CLASS));

View File

@ -0,0 +1,106 @@
/* Listener.h - the Listener class - MAXScript listener windows
*
* Copyright (c) John Wainwright, 1996
*
*/
#ifndef _H_LISTENER
#define _H_LISTENER
#include <windowsx.h>
#include "Pipe.h"
#include "Thunks.h"
extern GlobalThunk* listener_result_thunk;
extern ScripterExport BOOL end_keyboard_input;
extern ScripterExport BOOL start_keyboard_input;
extern ScripterExport TCHAR* keyboard_input;
extern ScripterExport Value* keyboard_terminator;
extern ScripterExport Array* keyboard_input_terminators;
// listener flag values
#define LSNR_INPUT_MODE_MASK 0x000F
#define LSNR_KEYINPUT_OFF 0x0000
#define LSNR_KEYINPUT_LINE 0x0001
#define LSNR_KEYINPUT_CHAR 0x0002
#define LSNR_SHOWING 0x0010 // MAXScript is forcing a show, ignore all other ShowWindows
#define LSNR_NO_MACRO_REDRAW 0x0020 // disable drawing in macro-rec box (to get round bug in WM_SETREDRAW)
#define EDIT_BOX_ITEM 1001 // listener edit box dlg item #
#define MACROREC_BOX_ITEM 1002 // listener macro-recorder edit box dlg item #
class ListenerViewWindow;
class Listener : public Value
{
HANDLE listener_thread;
DWORD thread_id;
public:
HWND listener_window; // main listener window
HWND edit_box; // edit control for main type-in
HWND macrorec_box; // edit control for macro-recorder output
HWND mini_listener; // mini-listener parent window in the MAX status panel
HWND mini_edit; // mini-listener edit control for type_in
HWND mini_macrorec; // mini-listener edit control for macro-recorder output
WindowStream* edit_stream; // stream for the main edit box
WindowStream* macrorec_stream; // stream for the macro-recorder edit box
WindowStream* mini_edit_stream; // stream for the mini edit box
WindowStream* mini_macrorec_stream; // stream for the mini macro-recorder edit box
Pipe* source_pipe; // the source pipe for the listener, source written to, compiler reads from
int flags;
ListenerViewWindow* lvw; // the ViewWindow instance for the listener
Listener(HINSTANCE mxs_instance, HWND MAX_window);
~Listener();
static DWORD run(Listener *l);
void create_listener_window(HINSTANCE hInstance, HWND hwnd);
void gc_trace();
void collect() { delete this; }
ScripterExport void set_keyinput_mode(int mode) { flags = (flags & ~LSNR_INPUT_MODE_MASK) | mode; }
};
// ViewWindow subclass for putting the listener in a MAX viewport
class ListenerViewWindow : public ViewWindow
{
public:
TCHAR *GetName();
HWND CreateViewWindow(HWND hParent, int x, int y, int w, int h);
void DestroyViewWindow(HWND hWnd);
BOOL CanCreate();
};
class ListenerMessageData
{
public:
WPARAM wParam;
LPARAM lParam;
HANDLE message_event;
ListenerMessageData(WPARAM wp, LPARAM lp, HANDLE me) { wParam = wp; lParam = lp; message_event = me; }
};
#define CLICK_STACK_SIZE 8 // number of clicked-at locations to remember for ctrl-R return
typedef struct edit_window edit_window;
struct edit_window
{
edit_window* next;
edit_window* prev;
Value* file_name;
bool dont_flag_save;
bool needs_save;
HWND window;
HWND edit_box;
int sr_offset;
int click_tos;
int click_at[CLICK_STACK_SIZE];
bool editing;
IUnknown* pDoc;
INT_PTR new_rollout();
INT_PTR edit_rollout();
};
#endif

View File

@ -0,0 +1,52 @@
/*
* math_protocol.h - def_generics for the generic function in the Math protocol
*
* see def_abstract_generics.h for more info.
*
*
* Copyright <20> John Wainwright 1996
*
*/
def_generic(plus, "+");
def_generic(minus, "-");
def_generic(times, "*");
def_generic(div, "/");
def_generic(pwr, "^");
def_generic(uminus, "u-");
use_generic(eq, "=");
use_generic(ne, "!=");
def_generic(gt, ">");
def_generic(lt, "<");
def_generic(ge, ">=");
def_generic(le, "<=");
def_visible_generic ( random, "random");
def_visible_generic ( abs, "abs");
/* scripter-visible math primitives - implemented as prims since they are type-specific */
def_visible_primitive( include, "include");
def_visible_primitive( acos, "acos");
def_visible_primitive( asin, "asin");
def_visible_primitive( atan, "atan");
def_visible_primitive( ceil, "ceil");
def_visible_primitive( cos, "cos");
def_visible_primitive( cosh, "cosh");
def_visible_generic ( exp, "exp"); // exp is polymorphic (floats & quats)
def_visible_primitive( floor, "floor");
def_visible_primitive( log, "log");
def_visible_primitive( log10, "log10");
def_visible_primitive( sin, "sin");
def_visible_primitive( sinh, "sinh");
def_visible_primitive( sqrt, "sqrt");
def_visible_primitive( tan, "tan");
def_visible_primitive( tanh, "tanh");
def_visible_primitive( atan2, "atan2");
def_visible_primitive( fmod, "mod");
def_visible_primitive( pow, "pow");
def_visible_primitive( seed, "seed");

View File

@ -0,0 +1,42 @@
/*
* matrix_protocol.h - def_generics for matrix protocol
*
*
* Copyright <20> John Wainwright 1996
*
*/
use_generic(coerce, "coerce");
use_generic( plus, "+" );
use_generic( minus, "-" );
use_generic( times, "*" );
use_generic( isIdentity, "isIdentity" );
use_generic( inverse, "Inverse" );
def_visible_primitive( rotateXMatrix, "RotateXMatrix");
def_visible_primitive( rotateYMatrix, "RotateYMatrix");
def_visible_primitive( rotateZMatrix, "RotateZMatrix");
def_visible_primitive( transMatrix, "TransMatrix");
def_visible_primitive( scaleMatrix, "ScaleMatrix");
def_visible_primitive( rotateYPRMatrix, "RotateYPRMatrix");
def_visible_generic( xFormMat, "XFormMat" );
def_mapped_generic ( identity, "Identity" );
def_mapped_generic ( zero, "Zero" );
def_mapped_generic ( orthogonalize, "Orthogonalize" );
def_mapped_generic ( translate, "Translate" );
def_mapped_generic ( rotateX, "RotateX" );
def_mapped_generic ( rotateY, "RotateY" );
def_mapped_generic ( rotateZ, "RotateZ" );
use_generic ( scale, "Scale" );
def_mapped_generic ( preTranslate, "PreTranslate" );
def_mapped_generic ( preRotateX, "PreRotateX" );
def_mapped_generic ( preRotateY, "PreRotateY" );
def_mapped_generic ( preRotateZ, "PreRotateZ" );
def_mapped_generic ( preScale, "PreScale" );
use_generic ( rotate, "Rotate" );
def_mapped_generic ( preRotate, "PreRotate" );

View File

@ -0,0 +1,295 @@
/*
* MAX_commands.h - defines all the invocable MAX UI commands - for the 'max' scripter construct
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_MAX_COMMANDS
#define _H_MAX_COMMANDS
#include "maxcom.h"
#include "buildver.h"
/* the commands... these are the command codes defined in "maxcom.h". they MUST be in
* alphabetical order */
"accel pan", MAXCOM_ACCEL_PAN, 0,
"acthomegrid", MAXCOM_ACTHOMEGRID, MR_R2,
"activate grid object", MAXCOM_ACTGRIDOBJ , 0,
"activate home grid", MAXCOM_ACTHOMEGRID, 0,
"adaptive persp grid", MAXCOM_ADAPTIVE_PERSP_GRID_TOGGLE, 0,
"adaptive perspective grid toggle", MAXCOM_ADAPTIVE_PERSP_GRID_TOGGLE, MR_R2,
"align", MAXCOM_ALIGN, 0,
"align camera", MAXCOM_TOOLS_ALIGNCAMERA, 0,
"align normals", MAXCOM_ALIGNNORMALS, 0,
"alignnormals", MAXCOM_ALIGNNORMALS, MR_R2,
"angle snap toggle", MAXCOM_ANGLE_SNAP_TOGGLE, 0,
"apply ik", MAXCOM_APPLY_IK, 0,
#ifndef NO_TOOL_ARRAY // russom - 10/22/01
"array", MAXCOM_ARRAY, 0,
#endif
"backface", MAXCOM_BACKFACE, MR_R2,
"backface cull toggle", MAXCOM_BACKFACE, 0,
"background", MAXCOM_BACKGROUND, MR_R2,
"background display toggle", MAXCOM_BACKGROUND, 0,
"bind space warp mode", MAXCOM_BINDWSM, 0,
"bindwsm", MAXCOM_BINDWSM, MR_R2,
"box mode", MAXCOM_BOX_MODE, MR_R2,
"box mode selected", MAXCOM_BOX_MODE, 0,
"box mode toggle", MAXCOM_BOX_TOGGLE, 0,
"box toggle", MAXCOM_BOX_TOGGLE, MR_R2,
"configure paths", MAXCOM_CONFIGURE_PATHS, 0,
#ifndef NO_CREATE_TASK // russom - 12/06/01
"create mode", MAXCOM_CREATE_MODE, 0,
#endif
#ifndef NO_CUI // russom - 02/12/02
"customize UI", MAXCOM_CUSTOMIZE_CUSTOMIZEUI, 0,
#endif
"cycle select", MAXCOM_CYCLE_SELECT_METHOD , 0,
"cycle sublevel", MAXCOM_CYCLE_SUBLEVEL, MR_R2,
"cycle subobject level", MAXCOM_CYCLE_SUBLEVEL, 0,
"def lgt toggle", MAXCOM_DEF_LGT_TOGGLE, MR_R2,
"default lighting toggle", MAXCOM_DEF_LGT_TOGGLE, 0,
"delete", MAXCOM_EDIT_DELETE , 0,
#ifndef NO_TOOL_DISPLAY_FLOATER // russom - 10/22/01
"display floater", MAXCOM_TOOLS_DISPLAYFLOATER, 0,
#endif
#ifndef NO_DISPLAY_TASK // russom - 12/06/01
"display mode", MAXCOM_DISPLAY_MODE, 0,
#endif
"dolly", MAXCOM_DOLLY, MR_R2,
"dolly mode", MAXCOM_DOLLY, 0,
"drawing aids", MAXCOM_DRAWINGAIDS, 0,
"drawingaids", MAXCOM_DRAWINGAIDS, MR_R2,
"fetch", MAXCOM_FETCH, 0,
"file archive", MAXCOM_FILE_ARCHIVE, 0,
"file export", MAXCOM_FILE_EXPORT, 0,
"file export selected", MAXCOM_FILE_EXPORTSELECTED, 0,
"file import", MAXCOM_FILE_IMPORT, 0,
"file insert tracks", MAXCOM_FILE_INSERTTRACKS, 0,
"file merge", MAXCOM_FILE_MERGE, 0,
"file new", MAXCOM_FILE_NEW, 0,
"file open", MAXCOM_FILE_OPEN, 0,
"file preferences", MAXCOM_FILE_PREFERENCES, 0,
"file replace", MAXCOM_FILE_REPLACE, 0,
"file save", MAXCOM_FILE_SAVE, 0,
"file save selected", MAXCOM_FILE_SAVESELECTED, 0,
"file saveas", MAXCOM_FILE_SAVEAS, 0,
"file savecopyas", MAXCOM_FILE_SAVECOPYAS, 0,
"file summary", MAXCOM_FILE_SUMMARYINFO, 0,
"file xref object", MAXCOM_FILE_XREFOBJECT, 0,
"file xref scene", MAXCOM_FILE_XREFSCENE, 0,
"fov", MAXCOM_FOV, 0,
"freeze inv", MAXCOM_FREEZE_INV, 0,
"freeze selection", MAXCOM_FREEZE_SELECTION, 0,
"fullinteract", MAXCOM_FULLINTERACT, 0,
"grid nudge down", MAXCOM_GRID_NUDGE_DOWN, 0,
"grid nudge up", MAXCOM_GRID_NUDGE_UP, 0,
"grid toggle", MAXCOM_GRID_TOGGLE, 0,
"grids align", MAXCOM_GRIDS_ALIGN, 0,
"group attach", MAXCOM_GROUP_ATTACH, 0,
"group close", MAXCOM_GROUP_CLOSE, 0,
"group detach", MAXCOM_GROUP_DETACH, 0,
"group explode", MAXCOM_GROUP_EXPLODE, 0,
"group group", MAXCOM_GROUP_GROUP, 0,
"group open", MAXCOM_GROUP_OPEN, 0,
"group ungroup", MAXCOM_GROUP_UNGROUP, 0,
"help about", MAXCOM_HELP_ABOUT, 0,
"hide camera toggle", MAXCOM_HIDE_CAMERA_TOGGLE, 0,
"hide command panel toggle", MAXCOM_HIDE_CMD_PAN, 0,
"hide floating toolbars toggle", MAXCOM_HIDE_FLOATERS, 0,
"hide helper toggle", MAXCOM_HIDE_HELPER_TOGGLE, 0,
"hide inv", MAXCOM_HIDE_INV, 0,
"hide light toggle", MAXCOM_HIDE_LIGHT_TOGGLE, 0,
#ifndef NO_STANDARD_TOOLBAR_OPTIONS // russom - 02/12/02
"hide main toolbar toggle", MAXCOM_HIDE_MAIN_TB, 0,
#endif
"hide object toggle", MAXCOM_HIDE_OBJECT_TOGGLE, 0,
"hide selection", MAXCOM_HIDE_SELECTION, 0,
"hide shape toggle", MAXCOM_HIDE_SHAPE_TOGGLE, 0,
"hide system toggle", MAXCOM_HIDE_SYSTEM_TOGGLE, 0,
#if !defined(NO_STANDARD_TOOLBAR_OPTIONS) && !defined(NO_CUI_TABBED_PANELS) // russom - 02/12/02
"hide tab panel toggle", MAXCOM_HIDE_SHELF, 0,
#endif
"hide wsm toggle", MAXCOM_HIDE_WSM_TOGGLE, 0,
#ifndef NO_HIERARCHY_TASK // JP Morel - July 17th 2002
"hierarchy mode", MAXCOM_HIERARCHY_MODE, 0,
#endif
"hold", MAXCOM_HOLD, 0,
"ik terminator", MAXCOM_IK_TERMINATOR, 0,
"ipan", MAXCOM_IPAN, 0,
"izoom in", MAXCOM_IZOOM_IN, 0,
"izoom out", MAXCOM_IZOOM_OUT, 0,
"key mode", MAXCOM_KEY_MODE, 0,
"link", MAXCOM_LINK, 0,
#ifndef NO_CUI // russom - 02/12/02
"load custom UI", MAXCOM_CUSTOMIZE_LOADCUI, 0,
#endif
"lock UI layout", MAXCOM_CUSTOMIZE_LOCKUILAYOUT, 0,
"material browser", MAXCOM_TOOLS_MTLMAPBROWSER, 0,
"mirror", MAXCOM_MIRROR, 0,
"modify mode", MAXCOM_MODIFY_MODE, 0,
#ifndef NO_MOTION_TASK // JP Morel - July 12th 2002
"motion mode", MAXCOM_MOTION_MODE, 0,
#endif
"move", MAXCOM_MOVE, 0,
"mtledit", MAXCOM_MTLEDIT, 0,
"next mod", MAXCOM_NEXT_MOD, 0,
"override", MAXCOM_OVERRIDE, 0,
"pancamera", MAXCOM_PANCAMERA, 0,
"panview", MAXCOM_PANVIEW, 0,
"percent snap toggle", MAXCOM_PERCENT_SNAP_TOGGLE, 0,
"persp", MAXCOM_PERSP, 0,
"place highlight", MAXCOM_EDIT_PLACEHIGHLIGHT, 0,
"prev mod", MAXCOM_PREV_MOD, 0,
"preview", MAXCOM_PREVIEW, 0,
"properties", MAXCOM_PROPERTIES, 0,
"quick render", MAXCOM_QUICK_RENDER, 0,
"redo", MAXCOM_EDIT_REDO , 0,
"renamepreview", MAXCOM_RENAMEPREVIEW, 0,
"render last", MAXCOM_RENDER_LAST, 0,
"render scene", MAXCOM_RENDER_SCENE, 0,
"reset file", MAXCOM_RESET_FILE, 0,
"revert custom UI", MAXCOM_CUSTOMIZE_REVERTCUI, 0,
"rns", MAXCOM_RNS, 0,
"roll", MAXCOM_ROLL, 0,
"rotate", MAXCOM_ROTATE, 0,
"rotateview", MAXCOM_ROTATEVIEW, 0,
#ifndef NO_SAFE_FRAMES // orb -7-20-2001
"safeframe toggle", MAXCOM_SAFEFRAME_TOGGLE, 0,
#endif // NO_SAFE_FRAMES
#ifndef NO_CUI // russom - 02/12/02
"save custom UI as", MAXCOM_CUSTOMIZE_SAVECUIAS, 0,
#endif
"saveplus", MAXCOM_SAVEPLUS, 0,
"scale", MAXCOM_SCALE, 0,
"scale cycle", MAXCOM_SCALE_CYCLE, 0,
"select", MAXCOM_SELECT, 0,
"select all", MAXCOM_EDIT_SELECTALL , 0,
"select by color", MAXCOM_SELECT_BY_COLOR, 0,
"select child", MAXCOM_SELECT_CHILD, 0,
"select invert", MAXCOM_EDIT_SELECTINVERT , 0,
"select none", MAXCOM_EDIT_SELECTNONE , 0,
"select parent", MAXCOM_SELECT_PARENT, 0,
"selection floater", MAXCOM_TOOLS_SELECTIONFLOATER, 0,
"set key all", MAXCOM_TOOL_SETKEY_HOTKEYALL, 0,
"set key all filter", MAXCOM_TOOL_SETKEY_ALL, 0,
"set key all position", MAXCOM_TOOL_SETKEY_HOTKEYPOS, 0,
"set key all position rotation and scale", MAXCOM_TOOL_SETKEY_HOTKEYPRS, 0,
"set key all postion", MAXCOM_TOOL_SETKEY_HOTKEYPOS, 0,
"set key all postion rotation and scale", MAXCOM_TOOL_SETKEY_HOTKEYPRS, 0,
"set key all rotation", MAXCOM_TOOL_SETKEY_HOTKEYROT, 0,
"set key all scale", MAXCOM_TOOL_SETKEY_HOTKEYSCALE, 0,
"set key all x position", MAXCOM_TOOL_SETKEY_HOTKEYPOSX, 0,
"set key all x postion", MAXCOM_TOOL_SETKEY_HOTKEYPOSX, 0,
"set key all x rotation", MAXCOM_TOOL_SETKEY_HOTKEYROTX, 0,
"set key all x scale", MAXCOM_TOOL_SETKEY_HOTKEYSCALEX, 0,
"set key all y position", MAXCOM_TOOL_SETKEY_HOTKEYPOSY, 0,
"set key all y postion", MAXCOM_TOOL_SETKEY_HOTKEYPOSY, 0,
"set key all y rotation", MAXCOM_TOOL_SETKEY_HOTKEYROTY, 0,
"set key all y scale", MAXCOM_TOOL_SETKEY_HOTKEYSCALEY, 0,
"set key all z position", MAXCOM_TOOL_SETKEY_HOTKEYPOSZ, 0,
"set key all z postion", MAXCOM_TOOL_SETKEY_HOTKEYPOSZ, 0,
"set key all z rotation", MAXCOM_TOOL_SETKEY_HOTKEYROTZ, 0,
"set key all z scale", MAXCOM_TOOL_SETKEY_HOTKEYSCALEZ, 0,
"set key clear", MAXCOM_TOOL_SETKEY_REVERT, 0,
"set key customattributes filter", MAXCOM_TOOL_SETKEY_CUSTOMATTRIBUTES, 0,
"set key ikparams filter", MAXCOM_TOOL_SETKEY_IK_PARAMS, 0,
"set key keys", MAXCOM_TOOL_SETKEY, 0,
"set key materials filter", MAXCOM_TOOL_SETKEY_MATERIALS, 0,
"set key mode", MAXCOM_TOOL_SETKEYMODE, 0,
"set key modifiers filter", MAXCOM_TOOL_SETKEY_MODIFIERS, 0,
"set key objectparams filter", MAXCOM_TOOL_SETKEY_OBJECTPARAMS, 0,
"set key on selected", MAXCOM_TOOL_SETKEY_SELECTED, 0,
"set key other filter", MAXCOM_TOOL_SETKEY_OTHER, 0,
"set key position filter", MAXCOM_TOOL_SETKEY_POSITION, 0,
"set key rotation filter", MAXCOM_TOOL_SETKEY_ROTATION, 0,
"set key scale filter", MAXCOM_TOOL_SETKEY_SCALE, 0,
"shade selected", MAXCOM_SHADE_SELECTED, 0,
"show last img", MAXCOM_SHOW_LAST_IMG, 0,
"showaxisicon", MAXCOM_SHOWAXISICON, 0,
"showhomegrid", MAXCOM_SHOWHOMEGRID, 0,
"snap toggle", MAXCOM_SNAP_TOGGLE, 0,
"snapshot", MAXCOM_EDIT_SNAPSHOT, 0,
"spacebar", MAXCOM_SPACEBAR, 0,
"spacing tool", MAXCOM_TOOLS_SPACINGTOOL, 0,
"spinsnap toggle", MAXCOM_SPINSNAP_TOGGLE, 0,
"subobject sel", MAXCOM_SUBOBJECT_SEL, 0,
"swap layouts", MAXCOM_SWAP_LAYOUTS, 0,
"texture correct", MAXCOM_TEXTURE_CORRECT, 0,
"time back", MAXCOM_TIME_BACK, MR_DISABLED,
"time config", MAXCOM_TIME_CONFIG, 0,
"time end", MAXCOM_TIME_END, 0,
"time forward", MAXCOM_TIME_FORWARD, MR_DISABLED,
"time play", MAXCOM_TIME_PLAY, 0,
"time start", MAXCOM_TIME_START, 0,
"toggle ik", MAXCOM_TOGGLE_IK, 0,
"toggle key mode", MAXCOM_KEYMODE_TOGGLE, 0,
"toggle keyboard shortcuts",MAXCOM_KBDSHORTCUT_TOGGLE, 0,
"toggle sound", MAXCOM_TOGGLE_SOUND, 0,
"tool animmode", MAXCOM_TOOL_ANIMMODE, 0,
"tool center", MAXCOM_TOOL_CENTER, 0,
"tool dualplanes", MAXCOM_TOOL_DUALPLANES, 0,
"tool hlist", MAXCOM_TOOL_HLIST, 0,
"tool maximize", MAXCOM_TOOL_MAXIMIZE, 0,
"tool region toggle", MAXCOM_TOOL_REGION_TOGGLE, 0,
"tool x", MAXCOM_TOOL_X, 0,
"tool xy", MAXCOM_TOOL_XY, 0,
"tool y", MAXCOM_TOOL_Y, 0,
"tool z", MAXCOM_TOOL_Z, 0,
"tool zoom", MAXCOM_TOOL_ZOOM, 0,
"tool zoomall", MAXCOM_TOOL_ZOOMALL, 0,
"tool zoomextents", MAXCOM_TOOL_ZOOMEXTENTS, 0,
"tool zoomextents all", MAXCOM_TOOL_ZOOMEXTENTS_ALL, 0,
"tool zoomregion", MAXCOM_TOOL_ZOOMREGION, 0,
"trajectories", MAXCOM_TRAJECTORIES, 0,
"treeview", MAXCOM_TREEVIEW, 0,
"truck", MAXCOM_TRUCK, 0,
"tti", MAXCOM_TTI, 0,
"undo", MAXCOM_EDIT_UNDO , 0,
"unfreeze all", MAXCOM_UNFREEZE_ALL, 0,
"unfreeze by hit", MAXCOM_UNFREEZE_BY_HIT, 0,
"unfreeze by name", MAXCOM_UNFREEZE_BY_NAME, 0,
"unhide all", MAXCOM_UNHIDE_ALL, 0,
"unhide by name", MAXCOM_UNHIDE_BY_NAME, 0,
"unitsetup", MAXCOM_UNITSETUP, 0,
"unlink", MAXCOM_UNLINK, 0,
#ifndef NO_UTILITY_TASK // russom - 12/06/01
"utility mode", MAXCOM_UTILITY_MODE, 0,
#endif
"videopost", MAXCOM_VIDEOPOST, 0,
"view file", MAXCOM_VIEW_FILE, 0,
"view redo", MAXCOM_VIEW_REDO, 0,
"viewpreview", MAXCOM_VIEWPREVIEW, 0,
"views redraw", MAXCOM_VIEWS_REDRAW, 0,
"views undo", MAXCOM_VIEWS_UNDO, 0,
"vpt back", MAXCOM_VPT_BACK, 0,
"vpt bottom", MAXCOM_VPT_BOTTOM, 0,
"vpt camera", MAXCOM_VPT_CAMERA, 0,
"vpt disable", MAXCOM_VPT_DISABLE, 0,
"vpt front", MAXCOM_VPT_FRONT, 0,
"vpt grid", MAXCOM_VPT_GRID, 0,
"vpt iso user", MAXCOM_VPT_ISO_USER, 0,
"vpt left", MAXCOM_VPT_LEFT, 0,
"vpt persp user", MAXCOM_VPT_PERSP_USER, 0,
"vpt right", MAXCOM_VPT_RIGHT, 0,
"vpt shape", MAXCOM_VPT_SHAPE, 0,
"vpt spot", MAXCOM_VPT_SPOT, 0,
"vpt tab", MAXCOM_VPT_TAB, 0,
"vpt top", MAXCOM_VPT_TOP, 0,
"vpt track", MAXCOM_VPT_TRACK, 0,
"vptconfig", MAXCOM_VPTCONFIG, 0,
"tool walkthrough", MAXCOM_TOOL_WALKTHROUGH, 0,
"wire facet", MAXCOM_WIRE_FACET, 0,
"wire smooth", MAXCOM_WIRE_SMOOTH, 0,
"zoom in 2x", MAXCOM_ZOOM_IN_2X, 0,
"zoom in 2x all", MAXCOM_ZOOM_IN_2X_ALL, 0,
"zoom out 2x", MAXCOM_ZOOM_OUT_2X, 0,
"zoom out 2x all", MAXCOM_ZOOM_OUT_2X_ALL, 0,
"zoomext sel", MAXCOM_ZOOMEXT_SEL, 0,
"zoomext sel all", MAXCOM_ZOOMEXT_SEL_ALL, 0,
#endif

View File

@ -0,0 +1,702 @@
/*
* MAX_classes.h - class object for all the MAX built-in types
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_MAX_CLASSES
#define _H_MAX_CLASSES
#include "MAXObj.h"
extern ScripterExport MAXSuperClass maxwrapper_class;
extern ScripterExport MAXSuperClass non_reftarg_maxwrapper_class;
extern ScripterExport MAXSuperClass referencetarget_class;
extern ScripterExport MAXSuperClass referencemaker_class;
extern ScripterExport MAXSuperClass node_class;
extern ScripterExport MAXClass inode_object;
extern ScripterExport MAXSuperClass geom_class;
extern ScripterExport MAXSuperClass modifier;
extern ScripterExport MAXSuperClass shape;
extern ScripterExport MAXSuperClass helper_object;
extern ScripterExport MAXSuperClass spacewarp_object;
extern ScripterExport MAXSuperClass spacewarp_modifier;
extern ScripterExport MAXSuperClass float_controller;
extern ScripterExport MAXSuperClass point3_controller;
extern ScripterExport MAXSuperClass position_controller;
extern ScripterExport MAXSuperClass quat_controller;
extern ScripterExport MAXSuperClass rotation_controller;
extern ScripterExport MAXSuperClass scale_controller;
extern ScripterExport MAXSuperClass matrix3_controller;
extern ScripterExport MAXSuperClass morph_controller;
extern ScripterExport MAXSuperClass master_block_controller;
extern ScripterExport MAXSuperClass light_object;
extern ScripterExport MAXSuperClass camera_object;
extern ScripterExport MAXSuperClass material_class;
extern ScripterExport MAXSuperClass shader_class;
extern ScripterExport MAXSuperClass texture_map;
extern ScripterExport MAXSuperClass system_object;
extern ScripterExport MAXSuperClass utility_plugin;
extern ScripterExport MAXSuperClass gup_plugin;
extern ScripterExport MAXSuperClass atmos_object;
extern ScripterExport MAXSuperClass render_effect; // RK: Added this
extern ScripterExport MAXSuperClass shadowtype_class; //LE Added this
extern ScripterExport MAXSuperClass custAttrib_class;
extern ScripterExport MAXSuperClass renderer_class;
extern ScripterExport MAXSuperClass render_element_class;
extern ScripterExport MAXSuperClass bake_element_class;
extern ScripterExport MAXSuperClass radiosity_effect_class;
extern ScripterExport MAXSuperClass tone_operator_class;
extern ScripterExport MAXSuperClass bitmap_io_class;
extern ScripterExport MAXSuperClass iksolver_class; //LAM Added this
extern ScripterExport MAXSuperClass mpass_cam_effect_class; //LAM Added this
extern ScripterExport MAXSuperClass tvUtility_class; //AF (08/08/01)
extern MAXClass box;
extern MAXClass sphere;
extern Value* node_get_ishidden(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_ishidden(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_boxmode(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_boxmode(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_alledges(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_alledges(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_backfacecull(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_backfacecull(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_castshadows(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_castshadows(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_receiveshadows(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_receiveshadows(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_motionblur(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_motionblur(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_wirecolor(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_wirecolor(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_isselected(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_isselected(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_isdependent(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_isdependent(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_istarget(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_istarget(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_gbufferchannel(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_gbufferchannel(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_visibility(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_visibility(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_targetDistance(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_targetDistance(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_imageblurMultiplier(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_imageblurMultiplier(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_showLinks(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_showLinks(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_showLinksOnly(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_showLinksOnly(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_isfrozen(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_isfrozen(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_showTrajectory(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_showTrajectory(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_renderable(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_renderable(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_showVertexColors(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_showVertexColors(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_vertexColorsShaded(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_vertexColorsShaded(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_inheritVisibility(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_inheritVisibility(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_baseObject(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_baseObject(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_lookAtNode(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_lookAtNode(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_transform(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_transform(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_showFrozenInGray(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_showFrozenInGray(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
#ifdef DESIGN_VER //KENNY MERGE
extern Value* node_get_displayByLayer(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_displayByLayer(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_motionByLayer(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_motionByLayer(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_renderByLayer(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_renderByLayer(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
#endif
//RK: Added these
extern Value* node_get_ignoreExtents(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_ignoreExtents(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_xray(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_xray(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_renderOccluded(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_renderOccluded(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_motionbluron(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_motionbluron(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_motionbluroncontroller(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_motionbluroncontroller(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_rcvCaustics(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_rcvCaustics(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_generateCaustics(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_generateCaustics(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_rcvGlobalIllum(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_rcvGlobalIllum(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_generateGlobalIllum(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_generateGlobalIllum(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_primaryVisibility(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_primaryVisibility(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_secondaryVisibility(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_secondaryVisibility(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
// LAM added this
extern Value* node_get_vertexTicks(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_vertexTicks(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_ishiddenInVpt(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_ishiddenInVpt(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_isnodehidden(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_isnodehidden(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* node_get_isnodefrozen(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void node_set_isnodefrozen(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
#ifndef NO_HELPER_CAMMATCH // russom - 10/16/01
extern Value* campoint_get_showAxis(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void campoint_set_showAxis(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* campoint_get_axisLength(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void campoint_set_axisLength(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
#endif // NO_HELPER_CAMMATCH
extern Value* point_get_showAxis(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void point_set_showAxis(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* point_get_axisLength(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void point_set_axisLength(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_pa_emitter(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_pa_emitter(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_pa_instancingObject(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_pa_instancingObject(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_pa_lifespanValueQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_pa_lifespanValueQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_pa_objectMutationQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_pa_objectMutationQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_ss_instancingObject(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_ss_instancingObject(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_ss_lifespanValueQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_ss_lifespanValueQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_ss_objectMutationQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_ss_objectMutationQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_bliz_instancingObject(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_bliz_instancingObject(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_bliz_lifespanValueQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_bliz_lifespanValueQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_bliz_objectMutationQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_bliz_objectMutationQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_pc_emitter(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_pc_emitter(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_pc_motionReferenceObject(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_pc_motionReferenceObject(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_pc_instancingObject(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_pc_instancingObject(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_pc_lifespanValueQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_pc_lifespanValueQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_pc_objectMutationQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_pc_objectMutationQueue(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_on(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_on(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_hsv(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_hsv(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_hue(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_hue(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_sat(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_sat(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_val(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_val(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_excludeList(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_excludeList(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_includeList(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_includeList(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_inclExclType(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_inclExclType(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_softenDiffuseEdge(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_softenDiffuseEdge(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_affectDiffuse(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_affectDiffuse(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_affectSpecular(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_affectSpecular(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_useNearAtten(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_useNearAtten(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_showNearAtten(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_showNearAtten(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_useFarAtten(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_useFarAtten(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_showFarAtten(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_showFarAtten(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_attenDecay(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_attenDecay(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_useshadowProjMap(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_useshadowProjMap(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_projector(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_projector(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_projectorMap(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_projectorMap(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_castShadows(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_castShadows(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_useGlobalShadowSettings(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_useGlobalShadowSettings(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_absoluteMapBias(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_absoluteMapBias(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_raytracedShadows(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_raytracedShadows(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_showCone(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_showCone(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_overShoot(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_overShoot(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_coneShape(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_coneShape(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
// RK: Added these
extern Value* get_light_atmosShadows(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_atmosShadows(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_lightAffectsShadow(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_lightAffectsShadow(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_shadowProjMap(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_shadowProjMap(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_ambientOnly(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_ambientOnly(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_type(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_light_type(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern void set_light_shadowGenerator(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_light_shadowGenerator(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
//extern Value* get_cam_lens(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
//extern void set_cam_lens(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
//extern Value* get_cam_fovType(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
//extern void set_cam_fovType(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_cam_orthoProjection(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_cam_orthoProjection(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_cam_showCone(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_cam_showCone(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_cam_showHorizon(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_cam_showHorizon(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_cam_showRanges(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_cam_showRanges(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_cam_clipManualy(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_cam_clipManualy(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
// RK: Added these
extern Value* get_cam_type(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_cam_type(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
// LAM: Added these
extern Value* get_cam_mpassEffect(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_cam_mpassEffect(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_mtl_gbufID(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid) ;
extern void set_mtl_gbufID(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_raymat_map(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_raymat_map(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_raymat_mapamount(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_raymat_mapamount(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_raymat_mapenable(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_raymat_mapenable(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_raymat_shaderType(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_raymat_shaderType(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_raymat_shaderByName(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_raymat_shaderByName(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_raymat_wire(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_raymat_wire(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_raymat_2sided(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_raymat_2sided(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_raymat_faceMap(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_raymat_faceMap(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_raymat_supersample(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_raymat_supersample(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_raymat_wireUnits(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_raymat_wireUnits(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* uvg_get_mappingType(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void uvg_set_mappingType(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* uvg_get_mapping(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void uvg_set_mapping(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* uvg_get_mapChannel(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void uvg_set_mapChannel(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* uvg_get_UVW_Type(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void uvg_set_UVW_Type(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* uvg_get_U_Mirror(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void uvg_set_U_Mirror(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* uvg_get_V_Mirror(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void uvg_set_V_Mirror(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* uvg_get_U_Tile(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void uvg_set_U_Tile(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* uvg_get_V_Tile(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void uvg_set_V_Tile(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* uvg_get_showMapOnBack(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void uvg_set_showMapOnBack(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* uvg_get_Noise_On(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void uvg_set_Noise_On(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* uvg_get_Noise_Animate(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void uvg_set_Noise_Animate(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* xyzg_get_coordType(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void xyzg_set_coordType(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* xyzg_get_mapChannel(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void xyzg_set_mapChannel(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* stdtex_get_invert(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void stdtex_set_invert(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* stdtex_get_clamp(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void stdtex_set_clamp(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* stdtex_get_alphaFromRGB(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void stdtex_set_alphaFromRGB(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_text_string(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_text_string(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_text_font(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_text_font(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_text_italic(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_text_italic(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_text_underline(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_text_underline(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_text_alignment(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_text_alignment(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_cammap_cam(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_cammap_cam(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* noiz_get_seed(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void noiz_set_seed(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* noiz_get_frequency(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void noiz_set_frequency(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* noiz_get_fractal(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void noiz_set_fractal(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* noiz_get_roughness(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void noiz_set_roughness(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* noiz_get_rampin(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void noiz_set_rampin(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* noiz_get_rampout(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void noiz_set_rampout(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* noiz_get_positive(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void noiz_set_positive(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* noiz_get_x_positive(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void noiz_set_x_positive(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* noiz_get_y_positive(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void noiz_set_y_positive(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* noiz_get_z_positive(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void noiz_set_z_positive(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
#ifndef NO_MODIFIER_DISPLACE // JP Morel - July 24th 2002
extern Value* spcdsp_get_bitmap(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void spcdsp_set_bitmap(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* spcdsp_get_map(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void spcdsp_set_map(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* dsp_get_bitmap(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void dsp_set_bitmap(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* dsp_get_map(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void dsp_set_map(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
#endif
#ifndef NO_MODIFIER_PATH_DEFORM // JP Morel - July 24th 2002
extern Value* pathdef_get_path(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void pathdef_set_path(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
#endif
extern Value* surfdef_get_surface(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void surfdef_set_surface(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* scriptctrl_get_script(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void scriptctrl_set_script(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* shape_get_renderable(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void shape_set_renderable(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* shape_get_thickness(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void shape_set_thickness(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* shape_get_mapcoords(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void shape_set_mapcoords(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* shape_get_angle(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void shape_set_angle(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* shape_get_sides(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void shape_set_sides(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* shape_get_vpt_thickness(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void shape_set_vpt_thickness(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* shape_get_vpt_sides(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void shape_set_vpt_sides(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* shape_get_vpt_angle(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void shape_set_vpt_angle(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* shape_get_displayrendermesh(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void shape_set_displayrendermesh(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* shape_get_use_vpt_settings(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void shape_set_use_vpt_settings(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* shape_get_disp_rndr_settings(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void shape_set_disp_rndr_settings(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* spline_get_steps(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void spline_set_steps(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* spline_get_optimize(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void spline_set_optimize(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* spline_get_adaptive(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void spline_set_adaptive(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* smplspline_get_steps(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void smplspline_set_steps(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* smplspline_get_optimize(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void smplspline_set_optimize(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* smplspline_get_adaptive(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void smplspline_set_adaptive(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* mirror_get_copy(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void mirror_set_copy(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
//LE added this
extern Value* get_shadow_absMapBias(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_shadow_absMapBias(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
//end LE
// RK: Start -- object xrefs
extern Value* get_oxref_proxyFileName(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_oxref_proxyFileName(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_oxref_fileName(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_oxref_fileName(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_oxref_currentFileName(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_oxref_currentFileName(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_oxref_proxyObjectName(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_oxref_proxyObjectName(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_oxref_objectName(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_oxref_objectName(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_oxref_currentObjectName(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_oxref_currentObjectName(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_oxref_useProxy(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_oxref_useProxy(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_oxref_renderProxy(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_oxref_renderProxy(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_oxref_updateMaterial(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_oxref_updateMaterial(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_oxref_ignoreAnimation(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_oxref_ignoreAnimation(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
// RK: End
/* -------------- Added by AF 4/5/99 ------------------------------------*/
extern Value* surfctrl_get_surface(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void surfctrl_set_surface(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* surfctrl_get_align(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void surfctrl_set_align(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* surfctrl_get_flip(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void surfctrl_set_flip(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
//AF: End
extern Value* get_subTexMap0(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subTexMap0(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subTexMap1(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subTexMap1(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl00(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl00(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl01(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl01(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl02(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl02(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl03(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl03(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl04(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl04(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl05(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl05(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl06(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl06(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl07(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl07(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl08(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl08(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl09(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl09(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl10(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl10(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl11(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl11(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl12(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl12(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl13(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl13(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl14(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl14(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl15(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl15(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl16(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl16(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl17(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl17(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl18(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl18(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl19(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl19(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl20(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl20(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl21(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl21(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl22(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl22(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl23(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl23(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl24(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl24(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl25(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl25(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl26(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl26(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl27(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl27(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl28(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl28(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl29(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl29(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl30(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl30(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl31(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl31(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl32(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl32(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl33(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl33(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl34(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl34(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl35(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl35(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl36(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl36(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl37(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl37(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl38(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl38(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl39(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl39(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl40(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl40(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl41(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl41(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl42(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl42(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl43(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl43(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl44(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl44(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl45(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl45(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl46(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl46(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl47(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl47(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl48(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl48(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl49(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl49(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl50(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl50(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl51(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl51(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl52(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl52(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl53(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl53(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl54(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl54(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl55(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl55(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl56(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl56(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl57(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl57(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl58(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl58(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl59(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl59(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl60(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl60(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl61(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl61(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl62(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl62(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl63(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl63(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl64(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl64(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl65(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl65(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl66(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl66(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl67(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl67(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl68(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl68(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl69(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl69(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl70(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl70(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl71(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl71(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl72(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl72(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl73(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl73(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl74(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl74(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl75(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl75(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl76(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl76(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl77(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl77(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl78(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl78(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl79(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl79(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl80(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl80(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl81(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl81(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl82(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl82(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl83(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl83(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl84(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl84(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl85(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl85(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl86(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl86(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl87(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl87(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl88(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl88(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl89(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl89(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl90(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl90(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl91(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl91(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl92(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl92(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl93(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl93(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl94(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl94(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl95(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl95(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl96(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl96(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl97(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl97(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl98(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl98(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl99(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl99(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
extern Value* get_subMtl100(ReferenceTarget* obj, Value* prop, TimeValue t, Interval& valid);
extern void set_subMtl100(ReferenceTarget* obj, Value* prop, TimeValue t, Value* val);
#endif

View File

@ -0,0 +1,127 @@
/*
* MAXKeys.h - MAX controller keyframe access classes
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_MAXKEYS
#define _H_MAXKEYS
#include "Max.h"
#include "MaxObj.h"
visible_class (MAXKeyArray)
class MAXKeyArray : public Value
{
public:
MAXControl* controller; /* the controller */
ENABLE_STACK_ALLOCATE(MAXKeyArray);
ScripterExport MAXKeyArray(Control* icont, ParamDimension* idim);
classof_methods (MAXKeyArray, Value);
BOOL _is_collection() { return 1; }
void collect() { delete this; }
void gc_trace();
ScripterExport void sprin1(CharStream* s);
/* operations */
#include "defimpfn.h"
# include "arraypro.h"
def_generic ( sortKeys, "sortKeys");
def_generic ( addNewKey, "addNewKey");
def_generic ( deleteKeys, "deleteKeys");
def_generic ( deleteKey, "deleteKey");
// def_generic ( append_key, "appendKey"); // RK: 6/19/02, Commenting these, breaks the SDK
// def_generic ( assign_key, "assignKey"); // RK: 6/19/02, Commenting these, breaks the SDK
def_generic (show_props, "showProperties");
def_generic (get_props, "getPropNames");
ScripterExport Value* map(node_map& m);
/* built-in property accessors */
def_property ( count );
};
#define ToTCBUI(a) (((a)+1.0f)*25.0f) // HEY!! pinched from TCBINTRP.CPP, why not in a header or documented?
#define FromTCBUI(a) (((a)/25.0f)-1.0f)
#define ToEaseUI(a) ((a)*50.0f)
#define FromEaseUI(a) ((a)/50.0f)
visible_class (MAXKey)
class MAXKey : public Value
{
public:
MAXControl* controller; /* MAX-side controller */
int key_index;
ENABLE_STACK_ALLOCATE(MAXKey);
ScripterExport MAXKey (Control* icont, int ikey, ParamDimension* dim);
ScripterExport MAXKey (Control* icont, int ikey);
ScripterExport MAXKey (MAXControl* icont, int ikey);
static void setup();
classof_methods (MAXKey, Value);
void collect() { delete this; }
void gc_trace();
ScripterExport void sprin1(CharStream* s);
def_generic ( delete, "delete");
def_generic ( copy, "copy");
def_generic ( show_props, "showProperties");
def_generic ( get_props, "getPropNames");
ScripterExport IKey* setup_key_access(AnyKey& ak, IKeyControl** kip);
def_property (time);
def_property (selected);
def_property (value);
def_property (inTangent);
def_property (outTangent);
def_property (inTangentLength);
def_property (outTangentLength);
def_property (inTangentType);
def_property (outTangentType);
def_property (x_locked);
def_property (y_locked);
def_property (z_locked);
def_property (w_locked);
def_property (constantVelocity);
def_property (freeHandle);
def_property (tension);
def_property (continuity);
def_property (bias);
def_property (easeTo);
def_property (easeFrom);
#if 0 // HEY!! obsolete
def_nested_prop ( angle );
def_nested_prop ( x_rotation );
def_nested_prop ( y_rotation );
def_nested_prop ( z_rotation );
def_nested_prop ( axis );
def_nested_prop ( x );
def_nested_prop ( y );
def_nested_prop ( z );
#endif
// add implementations of the recursive time controller fns here to complain
// since they wuill default to operating on the key's controller which can be very confusing
// the user should use them on the controller or track, not the key
#ifdef def_time_fn
# undef def_time_fn
#endif
#define def_time_fn(_fn) \
Value* MAXKey::_fn##_vf(Value** arg_list, int count) { ABSTRACT_FUNCTION(#_fn, this, Value*); }
#include "time_fns.h"
};
#endif

View File

@ -0,0 +1,207 @@
/*
* MAXMaterials.h - MAX material & map wrapper classes
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_MAXMATERIALS
#define _H_MAXMATERIALS
#include "Max.h"
#include "MaxObj.h"
#if 0 // HEY!! add material library access
virtual int LoadMaterialLib(const TCHAR *name)=0;
virtual int SaveMaterialLib(const TCHAR *name)=0;
virtual MtlBaseLib& GetMaterialLibrary()=0;
static Class_ID mtlBaseLibClassID(MTLBASE_LIB_CLASS_ID,0);
#endif
/* -------------------------- MAXMaterial -------------------------- */
visible_class (MAXMaterial)
class MAXMaterial : public MAXWrapper
{
public:
Mtl* mat; /* the MAX-side material */
MAXMaterial() {};
MAXMaterial(Mtl* imat);
static ScripterExport Value* intern(Mtl* imat);
static Value* make(MAXClass* cls, Value** arg_list, int count);
BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXMaterial)) ? 1 : MAXWrapper::is_kind_of(c); }
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
TCHAR* class_name();
#include "defimpfn.h"
Value* copy_vf(Value** arg_list, int count) { return MAXWrapper::copy_no_undo(arg_list, count); }
def_property ( name );
def_property ( effectsChannel );
def_property ( showInViewport );
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
Mtl* to_mtl() { check_for_deletion(); return mat; }
MtlBase* to_mtlbase() { check_for_deletion(); return mat; }
void to_fpvalue(FPValue& v) { v.mtl = mat; v.type = TYPE_MTL; }
};
/* ---------------------- MAXMultiMaterial ----------------------- */
visible_class (MAXMultiMaterial)
class MAXMultiMaterial : public MAXMaterial
{
public:
MAXMultiMaterial() {};
MAXMultiMaterial(MultiMtl* imat);
static ScripterExport Value* intern(MultiMtl* imat);
static Value* make(MAXClass* cls, Value** arg_list, int count);
BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXMultiMaterial)) ? 1 : MAXMaterial::is_kind_of(c); }
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
TCHAR* class_name();
def_generic (get, "get");
def_generic (put, "put");
Value* copy_vf(Value** arg_list, int count) { return MAXWrapper::copy_no_undo(arg_list, count); }
ScripterExport Value* map(node_map& m);
def_property( numsubs );
def_property( count );
Mtl* to_mtl() { return mat; }
MtlBase* to_mtlbase() { check_for_deletion(); return mat; }
void to_fpvalue(FPValue& v) { v.mtl = mat; v.type = TYPE_MTL; }
};
/* ---------------------- Material Library ----------------------- */
applyable_class (MAXMaterialLibrary)
class MAXMaterialLibrary : public MAXWrapper
{
public:
MtlBaseLib new_lib;
MtlBaseLib& lib;
MAXMaterialLibrary(MtlBaseLib& ilib);
MAXMaterialLibrary(MtlBaseLib* ilib);
MAXMaterialLibrary();
static ScripterExport Value* intern(MtlBaseLib& ilib);
static ScripterExport Value* intern(MtlBaseLib* ilib);
classof_methods (MAXMaterialLibrary, MAXWrapper);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
MtlBase* get_mtlbase(int index);
MtlBase* find_mtlbase(TCHAR* name);
TCHAR* class_name();
/* operations */
ScripterExport Value* map(node_map& m);
#include "defimpfn.h"
# include "arraypro.h"
Value* copy_vf(Value** arg_list, int count) { return MAXWrapper::copy_no_undo(arg_list, count); }
/* built-in property accessors */
def_property ( count );
};
/* ------------------------- MAXTexture ------------------------ */
visible_class (MAXTexture)
class MAXTexture : public MAXWrapper
{
public:
Texmap* map; /* the MAX-side map */
MAXTexture(Texmap* imap);
static ScripterExport Value* intern(Texmap* imap);
static Value* make(MAXClass* cls, Value** arg_list, int count);
BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXTexture)) ? 1 : MAXWrapper::is_kind_of(c); }
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
TCHAR* class_name();
#include "defimpfn.h"
# include "texmapro.h"
Value* copy_vf(Value** arg_list, int count) { return MAXWrapper::copy_no_undo(arg_list, count); }
def_property( name );
Texmap* to_texmap() { check_for_deletion(); return map; }
MtlBase* to_mtlbase() { check_for_deletion(); return map; }
void to_fpvalue(FPValue& v) { v.tex = map; v.type = TYPE_TEXMAP; }
};
/* -------------------------- MAXMtlBase -------------------------- */
// a generic wrapper for MtlBase classes such as UVGen, XYZGen, TexOut, etc.
visible_class (MAXMtlBase)
class MAXMtlBase : public MAXWrapper
{
public:
MtlBase* mtl; /* the MAX-side mtlbase */
MAXMtlBase(MtlBase* imtl);
static ScripterExport Value* intern(MtlBase* imtl);
static Value* make(MAXClass* cls, Value** arg_list, int count);
BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXMtlBase)) ? 1 : MAXWrapper::is_kind_of(c); }
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
TCHAR* class_name() { return _T("MapSupportClass"); }
Value* copy_vf(Value** arg_list, int count) { return MAXWrapper::copy_no_undo(arg_list, count); }
MtlBase* to_mtlbase() { check_for_deletion(); return mtl; }
};
/* ------------------ MEdit materials virtual array -------------------- */
visible_class (MAXMeditMaterials)
class MAXMeditMaterials : public Value
{
public:
MAXMeditMaterials() { tag = &MAXMeditMaterials_class; }
classof_methods (MAXMeditMaterials, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
MtlBase* get_mtl(int index);
MtlBase* find_mtl(TCHAR* name);
static void setup();
// operations
ScripterExport Value* map(node_map& m);
#include "defimpfn.h"
# include "arraypro.h"
// built-in property accessors
def_property ( count );
};
extern ScripterExport MAXMeditMaterials medit_materials;
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,565 @@
/* MAXScript.h - main include for MAXScript sources
*
* Copyright (c) John Wainwright, 1996
*
*
*/
#ifndef _H_MAXSCRIPT
#define _H_MAXSCRIPT
#ifndef STRICT
#define STRICT // strict type-checking - conformance with MAX SDK libs
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN // trims win32 includes
#endif
#ifdef BLD_MAXSCRIPT
# define ScripterExport __declspec( dllexport )
#else
# define ScripterExport __declspec( dllimport )
# define IMPORTING
#endif
#include "export.h"
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
#include <float.h>
#include "Max.h"
#define NOT_SUPPORTED_BY_PRODUCT(fn) \
throw RuntimeError (_T("Feature not available: "), _T(#fn));
/* utility defines */
#define END NULL // null varargs arg list terminator
class Value;
class CharStream;
class Rollout;
class MAXScriptException;
class MSPlugin;
class Struct;
class MSZipPackage;
class String;
#define MAXSCRIPT_UTILITY_CLASS_ID Class_ID(0x4d64858, 0x16d1751d)
#define MAX_SCRIPT_DIR _T("scripts")
#define SCRIPT_AUTOLOAD_DIR _T("Startup\\")
// check whether we are UNICODE or Code page 0 (==> no mbcs code)
#ifdef _UNICODE
# define no_mb_chars TRUE
# define bytelen(s) (sizeof(wchar_t) * wcslen(s))
#else
# define no_mb_chars (MB_CUR_MAX == 1)
# define bytelen(s) strlen(s)
#endif
inline double EPS(double v) { return _isnan(v) ? (v) : fabs(v) < FLT_EPSILON ? 0.0 : (v); } // small number round down for %g float printing
/* MAXScript-specific window messages */
#define MXS_ADD_ROLLOUT_PAGE (WM_USER + 0x100)
#define MXS_DELETE_ROLLOUT_PAGE (WM_USER + 0x101)
#define MXS_REDRAW_VIEWS (WM_USER + 0x102)
#define MXS_EDIT_SCRIPT (WM_USER + 0x103)
#define MXS_NEW_SCRIPT (WM_USER + 0x104)
#define MXS_DISPLAY_BITMAP (WM_USER + 0x105)
#define MXS_ERROR_MESSAGE_BOX (WM_USER + 0x106)
#define MXS_PRINT_STRING (WM_USER + 0x107)
#define MXS_LISTENER_EVAL (WM_USER + 0x108)
#define MXS_MESSAGE_BOX (WM_USER + 0x109)
#define MXS_INITIALIZE_MAXSCRIPT (WM_USER + 0x10A)
#define MXS_KEYBOARD_INPUT (WM_USER + 0x10B)
#define MXS_SHOW_SOURCE (WM_USER + 0x10C)
#define MXS_TAKE_FOCUS (WM_USER + 0x10D)
#define MXS_STOP_CREATING (WM_USER + 0x10E)
#define MXS_CLOSE_DOWN (WM_USER + 0x10F)
#define MXS_STOP_EDITING (WM_USER + 0x110)
#define MXS_LOAD_STARTUP_SCRIPTS (WM_USER + 0x111)
#define MXS_EXECUTE_MACRO (WM_USER + 0x112)
#define MXS_RESTART_EDITING (WM_USER + 0x113)
typedef struct // LPARAM for MXS_MESSAGE_BOX contains a pointer to this structure
{
TCHAR* title;
TCHAR* message;
BOOL beep;
int flags;
BOOL result;
} message_box_data;
/* thread-local storage struct decl & access macros */
typedef struct MAXScript_TLS MAXScript_TLS;
struct MAXScript_TLS
{
MAXScript_TLS* next; /* links... */
MAXScript_TLS* prev;
HANDLE my_thread; /* thread that owns this TLS struct */
DWORD my_thread_id;
#undef def_thread_local
#define def_thread_local(type, lcl, init_val) type lcl
# include "thrdlcls.h"
};
#define thread_local(x) (((MAXScript_TLS*)TlsGetValue(thread_locals_index))->x)
/* index, tls struct list globals */
extern ScripterExport int thread_locals_index;
extern int thread_id_index;
extern MAXScript_TLS* MAXScript_TLS_list;
#define needs_redraw_set() thread_local(needs_redraw) = 1
#define needs_complete_redraw_set() thread_local(needs_redraw) = 2
#define needs_redraw_clear() thread_local(needs_redraw) = 0
#define MAXScript_time() \
(thread_local(use_time_context) ? thread_local(current_time) : MAXScript_interface->GetTime())
void alloc_thread_locals();
ScripterExport void init_thread_locals();
void free_thread_locals();
/* error handlers */
void out_of_memory();
void bad_delete();
/* arg count check & keyword arg accessors (assume conventional names for arg_list & count in using function) */
extern ScripterExport Value* _get_key_arg(Value** arg_list, int count, Value* key_name);
extern ScripterExport Value* _get_key_arg_or_default(Value** arg_list, int count, Value* key_name, Value* def);
#define key_arg(key) _get_key_arg(arg_list, count, n_##key)
#define key_arg_or_default(key, def) _get_key_arg_or_default(arg_list, count, n_##key##, def)
#define int_key_arg(key, var, def) ((var = _get_key_arg(arg_list, count, n_##key)) == &unsupplied ? def : var->to_int())
#define float_key_arg(key, var, def) ((var = _get_key_arg(arg_list, count, n_##key)) == &unsupplied ? def : var->to_float())
#define bool_key_arg(key, var, def) ((var = _get_key_arg(arg_list, count, n_##key)) == &unsupplied ? def : var->to_bool())
#define interval_key_arg(key, var, def) ((var = _get_key_arg(arg_list, count, n_##key)) == &unsupplied ? def : var->to_interval())
#define timevalue_key_arg(key, var, def) ((var = _get_key_arg(arg_list, count, n_##key)) == &unsupplied ? def : var->to_timevalue())
#define node_key_arg(key, var, def) ((var = _get_key_arg(arg_list, count, n_##key)) == &unsupplied ? def : var->to_node())
#define check_arg_count(fn, w, g) if ((w) != (g)) throw ArgCountError (_T(#fn), w, g)
#define check_gen_arg_count(fn, w, g) if ((w) != (g + 1)) throw ArgCountError (_T(#fn), w, g + 1)
#define check_arg_count_with_keys(fn, w, g) if (!(g == w || (g > w && arg_list[w] == &keyarg_marker))) throw ArgCountError (_T(#fn), w, count_with_keys())
#define check_gen_arg_count_with_keys(fn, w, g) if (!(g == w || (g > w && arg_list[w-1] == &keyarg_marker))) throw ArgCountError (_T(#fn), w, count_with_keys() + 1)
#define count_with_keys() _count_with_keys(arg_list, count)
/* for functions that return a boolean */
#define bool_result(val) ((val) ? &true_value : &false_value)
/* for testing a value to ensure that it is within range */
// following only valid for integer and float range checking
#define MXS_range_check(_val, _lowerLimit, _upperLimit, _desc) \
if (_val < _lowerLimit || _val > _upperLimit) { \
TCHAR buf[256]; \
TCHAR buf2[128]; \
_tcscpy(buf,_desc); \
_tcscat(buf,_T(" < ")); \
_sntprintf(buf2, 128, _T("%g"), EPS(_lowerLimit)); \
_tcscat(buf,buf2); \
_tcscat(buf,_T(" or > ")); \
_sntprintf(buf2, 128, _T("%g"), EPS(_upperLimit)); \
_tcscat(buf,buf2); \
_tcscat(buf,_T(": ")); \
_sntprintf(buf2, 128, _T("%g"), EPS(_val)); \
_tcscat(buf,buf2); \
throw RuntimeError (buf); \
}
/* value local macros - for managing C local variable references to Value*'s for the collector - see Collectable.cpp */
#define one_value_local(n1) \
struct { int count; Value** link; Value* n1; } vl = \
{ 1, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define one_typed_value_local(n1) \
struct { int count; Value** link; n1; } vl = \
{ 1, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define two_value_locals(n1, n2) \
struct { int count; Value** link; Value *n1, *n2; } vl = \
{ 2, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define two_typed_value_locals(n1, n2) \
struct { int count; Value** link; n1; n2; } vl = \
{ 2, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define three_value_locals(n1, n2, n3) \
struct { int count; Value** link; Value *n1, *n2, *n3; } vl = \
{ 3, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define three_typed_value_locals(n1, n2, n3) \
struct { int count; Value** link; n1; n2; n3; } vl = \
{ 3, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define four_value_locals(n1, n2, n3, n4) \
struct { int count; Value** link; Value *n1, *n2, *n3, *n4; } vl = \
{ 4, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define four_typed_value_locals(n1, n2, n3, n4) \
struct { int count; Value** link; n1; n2; n3; n4; } vl = \
{ 4, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define five_value_locals(n1, n2, n3, n4, n5) \
struct { int count; Value** link; Value *n1, *n2, *n3, *n4, *n5; } vl = \
{ 5, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define five_typed_value_locals(n1, n2, n3, n4, n5) \
struct { int count; Value** link; n1; n2; n3; n4; n5; } vl = \
{ 5, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define six_value_locals(n1, n2, n3, n4, n5, n6) \
struct { int count; Value** link; Value *n1, *n2, *n3, *n4, *n5, *n6; } vl = \
{ 6, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define six_typed_value_locals(n1, n2, n3, n4, n5, n6) \
struct { int count; Value** link; n1; n2; n3; n4; n5; n6; } vl = \
{ 6, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define seven_value_locals(n1, n2, n3, n4, n5, n6, n7) \
struct { int count; Value** link; Value *n1, *n2, *n3, *n4, *n5, *n6, *n7; } vl = \
{ 7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define seven_typed_value_locals(n1, n2, n3, n4, n5, n6, n7) \
struct { int count; Value** link; n1; n2; n3; n4; n5; n6; n7; } vl = \
{ 7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define eight_value_locals(n1, n2, n3, n4, n5, n6, n7, n8) \
struct { int count; Value** link; Value *n1, *n2, *n3, *n4, *n5, *n6, *n7, *n8; } vl = \
{ 8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define eight_typed_value_locals(n1, n2, n3, n4, n5, n6, n7, n8) \
struct { int count; Value** link; n1; n2; n3; n4; n5; n6; n7; n8; } vl = \
{ 8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
// LAM - 6/07/02 - added new defines - no SDK impact
#define nine_value_locals(n1, n2, n3, n4, n5, n6, n7, n8, n9) \
struct { int count; Value** link; Value *n1, *n2, *n3, *n4, *n5, *n6, *n7, *n8, *n9; } vl = \
{ 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define nine_typed_value_locals(n1, n2, n3, n4, n5, n6, n7, n8, n9) \
struct { int count; Value** link; n1; n2; n3; n4; n5; n6; n7; n8; n9; } vl = \
{ 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define ten_value_locals(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10) \
struct { int count; Value** link; Value *n1, *n2, *n3, *n4, *n5, *n6, *n7, *n8, *n9, *n10; } vl = \
{ 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define ten_typed_value_locals(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10) \
struct { int count; Value** link; n1; n2; n3; n4; n5; n6; n7; n8; n9; n10; } vl = \
{ 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl;
#define value_local_array(var, count) { \
var = &((Value**)_alloca(((count) + 2) * sizeof(Value*)))[2]; \
memset(var, 0, (count) * sizeof(Value*)); \
var[-2] = (Value*)(count); \
var[-1] = (Value*)thread_local(current_locals_frame); \
thread_local(current_locals_frame) = &var[-2]; }
#define pop_value_local_array(var) \
thread_local(current_locals_frame) = (Value**)var[-1];
#define value_temp_array(var, count) { \
var = &((Value**)malloc(((count) + 2) * sizeof(Value*)))[2]; \
memset(var, 0, (count) * sizeof(Value*)); \
var[-2] = (Value*)(count); \
var[-1] = (Value*)thread_local(current_locals_frame); \
thread_local(current_locals_frame) = &var[-2];}
// LAM - 6/07/02 - fix for when multiple value_temp_arrays in same frame
#define realloc_value_temp_array(var, count, old_count) { \
Value **oldPointer = &var[-2]; \
Value **sframe = thread_local(current_locals_frame); \
var = &((Value**)realloc(&var[-2], ((count) + 2) * sizeof(Value*)))[2]; \
if ((count) > (old_count)) \
memset(&var[(old_count)], 0, ((count) - (old_count)) * sizeof(Value*)); \
var[-2] = (Value*)(count); \
Value **newPointer = &var[-2]; \
if (sframe == oldPointer) \
{ thread_local(current_locals_frame) = newPointer; \
DbgAssert( newPointer != (Value**)newPointer[1] ); \
} \
else \
{ Value **frame; \
for (frame = sframe; frame && (Value**)frame[1] != oldPointer && frame != (Value**)frame[1]; frame = (Value**)frame[1]); \
if (frame) { \
DbgAssert( frame != (Value**)frame[1] ); \
frame[1] = (Value*)newPointer; \
} \
} \
}
// LAM - 6/07/02 - fix for when multiple value_temp_arrays in same frame
#define pop_value_temp_array(var) { \
Value **oldPointer = &var[-2]; \
/* Value **sframe = thread_local(current_locals_frame); */ \
Value **head = (Value**)var[-1]; \
thread_local(current_locals_frame) = head; \
free(oldPointer); \
}
#define return_value(r) { \
thread_local(current_result) = r; \
thread_local(current_locals_frame) = vl.link; \
return r; }
#define return_value_no_pop(r) { \
thread_local(current_result) = r; \
return r; }
#define return_protected(r) { \
thread_local(current_result) = r; \
return r; }
#define pop_value_locals() \
thread_local(current_locals_frame) = vl.link;
#define reset_locals_frame() \
thread_local(current_locals_frame) = (Value**)&vl;
#define reset_locals_array_frame(var) \
thread_local(current_locals_frame) = &var[-2];
#define clear_current_frames() \
thread_local(current_locals_frame) = NULL; \
thread_local(current_frame) = NULL;
#define save_current_frames() \
Value** _sclf = thread_local(current_locals_frame); \
Value** _scsf = thread_local(current_scan_frame); \
Value** _scf = thread_local(current_frame);
#define restore_current_frames() \
thread_local(current_locals_frame) = _sclf; \
thread_local(current_scan_frame) = _scsf; \
thread_local(current_frame) = _scf;
/* general utilities */
ScripterExport TCHAR* save_string(TCHAR* str);
TCHAR wputch(HWND w, TCHAR* buf, TCHAR* bufp, const TCHAR c); /* edit window output... */
TCHAR* wputs(HWND w, TCHAR* buf, TCHAR* bufp, const TCHAR *str);
int wprintf(HWND w, TCHAR* buf, TCHAR* bufp, const TCHAR *format, ...);
void wflush(HWND w, TCHAR* buf, TCHAR* bufp);
#define mputs thread_local(current_stdout)->puts /* current MAXScript stdout output... */
#define mprintf thread_local(current_stdout)->printf
#define mflush thread_local(current_stdout)->flush
extern TCHAR *GetString(int id);
class Rollout;
class HashTable;
ScripterExport void install_utility_page(Rollout* rollout);
class Value;
typedef Value* (Value::*value_vf)(Value**, int);
typedef Value* (*value_cf)(Value**, int);
typedef Value* (Value::*getter_vf)(Value**, int);
typedef Value* (Value::*setter_vf)(Value**, int);
typedef Value* (*max_getter_cf)(ReferenceTarget*, Value*, TimeValue, Interval&);
typedef void (*max_setter_cf)(ReferenceTarget*, Value*, TimeValue, Value*);
/* MAXScript signal flags */
#define INTERRUPT_EVAL 0x0001
#define EXIT_LISTENER 0x0002
extern ScripterExport Interface* MAXScript_interface;
extern ScripterExport Interface7* MAXScript_interface7;
extern ScripterExport int MAXScript_signals;
extern ScripterExport BOOL escape_enabled; // RK: 05/20/02, 5.0 or later only
extern ScripterExport BOOL check_maxscript_interrupt;
extern ScripterExport void escape_checker();
extern ScripterExport BOOL MAXScript_detaching;
extern ScripterExport int mxs_rand();
extern ScripterExport void mxs_seed(int);
extern ScripterExport void dlx_detaching(HINSTANCE hinstance);
extern ScripterExport void define_system_global(TCHAR* name, Value* (*getter)(), Value* (*setter)(Value*));
// LAM 4/1/00 - added following to be able to overwrite existing global value in hash table.
extern ScripterExport void define_system_global_replace(TCHAR* name, Value* (*getter)(), Value* (*setter)(Value*));
extern ScripterExport void define_struct_global(TCHAR* name, TCHAR* struct_name, Value* (*getter)(), Value* (*setter)(Value*));
extern ScripterExport HashTable* english_to_local;
extern ScripterExport HashTable* local_to_english;
extern ScripterExport BOOL non_english_numerics;
extern ScripterExport void printable_name(TSTR& name);
extern ScripterExport void show_source_pos();
extern ScripterExport void show_listener();
extern ScripterExport void init_MAXScript();
extern ScripterExport BOOL MAXScript_running;
extern ScripterExport HWND main_thread_window;
extern ScripterExport BOOL progress_bar_up;
extern ScripterExport BOOL trace_back_active;
extern ScripterExport BOOL disable_trace_back;
extern ScripterExport int trace_back_levels;
typedef void (*utility_installer)(Rollout* ro);
extern ScripterExport void set_utility_installer(utility_installer ui);
extern ScripterExport void reset_utility_installer();
extern ScripterExport void error_message_box(MAXScriptException& e, TCHAR* caption);
typedef Value* (*autocad_point_reader)(TCHAR* str);
extern ScripterExport void set_autocad_point_reader(autocad_point_reader apr);
// LAM - 4/28/03
// Returns TRUE if script was executed successfully. If quietErrors == false and net rendering, errors are logged to LogSys.
// If not net rendering, errors are logged to Listener. Return value from script stored in fpv, if specified.
extern ScripterExport BOOL ExecuteMAXScriptScript(TCHAR *s, BOOL quietErrors = FALSE, FPValue *fpv = NULL);
// LAM - 6/24/03
// Method for processing input value or array for default action value. Current recognized values are:
// #logMsg, #logToFile, #abort, and integer values. Actions are converted to DWORD where bit 0 is log to Default Action
// system log, bit 1 is log to log file, and bit 2 is abort/cancel (if applicable).
extern ScripterExport DWORD ProcessDefaultActionVal (Value* inpActionVal, DWORD defaultAction = DEFAULTACTIONS_LOGMSG);
#define check_interrupts() if (check_maxscript_interrupt) escape_checker(); if (MAXScript_signals) throw SignalException()
#define type_check(val, cl, where) if (val->tag != class_tag(cl)) throw TypeError (where, val, &cl##_class);
// macros for setting numeric printing to English locale and back again - all numeric output in MAXScript is English
#define set_english_numerics() \
TCHAR* locale; \
TCHAR slocale[256]; \
if (non_english_numerics != NULL) \
{ \
locale = setlocale(LC_NUMERIC, NULL); \
_tcsncpy(slocale, locale, sizeof(slocale)); \
setlocale(LC_NUMERIC, "C"); \
}
#define reset_numerics() \
if (non_english_numerics != NULL) \
setlocale(LC_NUMERIC, slocale);
#include "Excepts.h"
#include "iFnPub.h"
#include "Value.h"
#include "Streams.h"
#include "SceneIO.h"
#include "IParamm2.h"
class HashTable;
class Listener;
extern ScripterExport HashTable* globals;
extern ScripterExport HashTable* persistents;
extern ScripterExport Listener* the_listener;
extern ScripterExport HWND the_listener_window;
extern HINSTANCE hInstance;
extern ScripterExport void listener_message(UINT iMsg, WPARAM wParam, LPARAM lParam, BOOL block_flag);
class RandGenerator;
extern ScripterExport RandGenerator *ClassIDRandGenerator;
inline int _count_with_keys(Value** arg_list, int count)
{
// compute # args before any key-args
for (int i = 0; i < count; i++)
if (arg_list[i] == (Value*)&keyarg_marker)
return i;
return count;
}
extern ScripterExport BOOL GetPrintAllElements(); // get whether to print all elements of arrays, meshselection, BigMatrix, etc.
extern ScripterExport BOOL SetPrintAllElements(BOOL); // set whether to print all elements of arrays, meshselection, BigMatrix, etc. Returns old value
extern ScripterExport bool CanChangeGroupFlags(INode* node); // Since grouping break the node hierarchy used to represent ALOs, we don't allow it
// MAXScript preferences. An instance of this class lives in CORE and is accessible to both CORE and MAXScript
class MAXScriptPrefs
{
public:
int loadStartupScripts;
int loadSaveSceneScripts;
int loadSavePersistentGlobals;
TSTR font;
int fontSize;
int autoOpenListener;
float initialHeapSize;
int enableMacroRecorder;
int showCommandPanelSwitch;
int showToolSelections;
int showMenuSelections;
int absoluteSceneNames;
int absoluteSubObjects;
int absoluteTransforms;
int explicitCoordinates;
int useFastNodeNameLookup;
MAXScriptPrefs() { Reset(); }
void Reset()
{
// MAXScript preference defaults
loadStartupScripts = TRUE;
loadSaveSceneScripts = TRUE;
loadSavePersistentGlobals = TRUE;
font = _T("Courier New");
fontSize = 12;
initialHeapSize = 7.5;
autoOpenListener = FALSE;
enableMacroRecorder = FALSE;
showCommandPanelSwitch = FALSE;
showToolSelections = FALSE;
showMenuSelections = FALSE;
absoluteSceneNames = FALSE;
absoluteSubObjects = FALSE;
absoluteTransforms = FALSE;
explicitCoordinates = FALSE;
useFastNodeNameLookup = TRUE;
}
virtual void LoadMAXScriptPreferences();
virtual void SaveMAXScriptPreferences();
};
#endif

View File

@ -0,0 +1,193 @@
/*
* MeshSub.h - edit mesh sub-object classes & functions
* also includes MeshDelta and MNMesh scripter classes
*
* exposes the new-with-R3 MeshDelta, MapDelta & MeshSel tools for
* working with meshes. Also provides access to MNMesh tools and
* mesh sub-objects as direct properties on nodes.
*
* Copyright <20> Autodesk, Inc., 1998
* John Wainwright
*/
#ifndef _H_MESHSUB
#define _H_MESHSUB
// mesh selection types
#define MSEL_ALL 1 // whole mesh selected
#define MSEL_CUR 2 // current selection
#define MSEL_EXP 3 // explicit selection (in vsel)
#define MSEL_SINGLE 4 // explicit single index
#define MSEL_NAMED 5 // named selection set - name in nss_name
/* -------------- base class for mesh sub-object selections ------------------- */
class MeshSelection : public Value
{
public:
MAXWrapper* owner; // owner node or modifier if any
BYTE sel_type; // selection type
BitArray vsel; // stand-alone selection if any
int index; // single vert index
TSTR nss_name; // name of named selection set
void gc_trace();
virtual MeshSelection* new_sel(MAXWrapper* own, BYTE stype, int indx = 0) = 0;
// utility functions to be specialized
virtual BitArray get_sel() = 0; // my element selection
virtual BitArray get_owner_sel() = 0; // get owner's element selection
virtual void set_owner_sel(BitArray &sel) = 0; // set owner's element selection
virtual BitArray get_sel_vertices(Mesh* m) = 0; // vertexes involved in my element selection
virtual BitArray get_sel_vertices(MNMesh* m) = 0; // vertexes involved in my element selection
virtual BitArray get_sel_vertices(PatchMesh* m) = 0; // vertexes involved in my element selection
virtual GenericNamedSelSetList& get_named_sel_set_list() = 0;
virtual int num_elements(Mesh* m) = 0;
virtual int num_elements(MNMesh* m) = 0;
virtual int num_elements(PatchMesh* m) = 0;
virtual BOOL is_same_selection(Value* s) = 0;
virtual void delete_sel(Mesh& m, MeshDelta& md, BitArray &sel) = 0;
virtual void delete_sel(MNMesh* m, ReferenceTarget* owner, BitArray &sel) = 0;
// utility functions
int get_sel_index(BitArray &vs, int n); // index for n'th item vertex in BitArray
void update_sel();
void set_sel(BitArray &vs);
void sprin1(TCHAR* type, CharStream* s);
// operations
#include "defimpfn.h"
# include "arraypro.h"
def_generic ( move, "move");
def_generic ( scale, "scale");
def_generic ( rotate, "rotate");
def_generic ( delete, "delete");
def_generic ( select, "select");
def_generic ( deselect, "deselect");
def_generic ( selectmore, "selectMore");
use_generic ( coerce, "coerce");
ScripterExport Value* map(node_map& m);
void to_fpvalue(FPValue& v);
ScripterExport Value* to_bitarrayValue();
// built-in property accessors
def_property ( count );
def_property ( index );
def_property ( selSetNames );
};
/* ---------------- mesh vertex selection --------------------- */
visible_class (VertSelectionValue)
class VertSelectionValue : public MeshSelection
{
public:
ScripterExport VertSelectionValue(MAXWrapper* own, BYTE stype, int indx = 0);
MeshSelection* new_sel(MAXWrapper* own, BYTE stype, int indx = 0);
classof_methods (VertSelectionValue, Value);
# define is_vertselection(v) ((v)->tag == class_tag(VertSelectionValue))
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
// specialized utility functions
BitArray get_sel();
BitArray get_owner_sel() { return (owner == NULL) ? BitArray() : owner->get_vertsel(); }
void set_owner_sel(BitArray &sel) {if (owner != NULL) owner->set_vertsel(sel); }
BitArray get_sel_vertices(Mesh* m);
BitArray get_sel_vertices(MNMesh* m);
BitArray get_sel_vertices(PatchMesh* m);
GenericNamedSelSetList& get_named_sel_set_list() { return owner->get_named_vertsel_set(); }
int num_elements(Mesh* m) { return m->getNumVerts(); }
int num_elements(MNMesh* m) { return m->VNum(); }
int num_elements(PatchMesh* m) { return m->getNumVerts(); }
BOOL is_same_selection(Value* s) { return is_vertselection(s); }
void delete_sel(Mesh& m, MeshDelta& md, BitArray &sel) { md.DeleteVertSet(m, sel); }
void delete_sel(MNMesh* m, ReferenceTarget* owner, BitArray &sel);
// operations
def_generic ( put, "put");
// built-in property accessors
def_property ( pos );
};
/* ---------------- mesh face selection --------------------- */
visible_class (FaceSelectionValue)
class FaceSelectionValue : public MeshSelection
{
public:
ScripterExport FaceSelectionValue(MAXWrapper* own, BYTE stype, int indx = 0);
MeshSelection* new_sel(MAXWrapper* own, BYTE stype, int indx = 0);
classof_methods (FaceSelectionValue, Value);
# define is_faceselection(v) ((v)->tag == class_tag(FaceSelectionValue))
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
// specialized utility functions
BitArray get_sel();
BitArray get_owner_sel() { return (owner == NULL) ? BitArray() : owner->get_facesel(); }
void set_owner_sel(BitArray &sel) {if (owner != NULL) owner->set_facesel(sel); }
BitArray get_sel_vertices(Mesh* m);
BitArray get_sel_vertices(MNMesh* m);
BitArray get_sel_vertices(PatchMesh* m);
GenericNamedSelSetList& get_named_sel_set_list() { return owner->get_named_facesel_set(); }
int num_elements(Mesh* m) { return m->getNumFaces(); }
int num_elements(MNMesh* m) { return m->FNum(); }
int num_elements(PatchMesh* m) { return m->getNumPatches(); }
BOOL is_same_selection(Value* s) { return is_faceselection(s); }
void delete_sel(Mesh& m, MeshDelta& md, BitArray &sel) { md.DeleteFaceSet(m, sel); }
void delete_sel(MNMesh* m, ReferenceTarget* owner, BitArray &sel);
// operations
def_generic ( put, "put");
// built-in property accessors
};
/* ---------------- edge face selection --------------------- */
visible_class (EdgeSelectionValue)
class EdgeSelectionValue : public MeshSelection
{
public:
ScripterExport EdgeSelectionValue(MAXWrapper* own, BYTE stype, int indx = 0);
MeshSelection* new_sel(MAXWrapper* own, BYTE stype, int indx = 0);
classof_methods (EdgeSelectionValue, Value);
# define is_edgeselection(v) ((v)->tag == class_tag(EdgeSelectionValue))
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
// specialized utility functions
BitArray get_sel();
BitArray get_owner_sel() { return (owner == NULL) ? BitArray() : owner->get_edgesel(); }
void set_owner_sel(BitArray &sel) {if (owner != NULL) owner->set_edgesel(sel); }
BitArray get_sel_vertices(Mesh* m);
BitArray get_sel_vertices(MNMesh* m);
BitArray get_sel_vertices(PatchMesh* m);
GenericNamedSelSetList& get_named_sel_set_list() { return owner->get_named_edgesel_set(); }
int num_elements(Mesh* m) { return m->getNumFaces() * 3; }
int num_elements(MNMesh* m) { return m->ENum(); }
int num_elements(PatchMesh* m) { return m->getNumEdges(); }
BOOL is_same_selection(Value* s) { return is_edgeselection(s); }
void delete_sel(Mesh& m, MeshDelta& md, BitArray &sel) { md.DeleteEdgeSet(m, sel); }
void delete_sel(MNMesh* m, ReferenceTarget* owner, BitArray &sel);
// operations
// built-in property accessors
};
#endif

View File

@ -0,0 +1,97 @@
/*
* MouseTool.h - scriptable mouse CommandModes for MAX
*
* Copyright <20> Autodesk, Inc, 1998. John Wainwright.
*
*/
#ifndef _H_MOUSETOOL
#define _H_MOUSETOOL
class MouseTool;
class MSPlugin;
// tool context local indexes - MUST match order in Parser::tool_def()
enum { cl_viewPoint, cl_worldPoint, cl_worldDist, cl_worldAngle, cl_gridPoint, cl_gridDist, cl_gridAngle, cl_nodeTM, cl_shift, cl_ctrl, cl_alt, cl_lbutton, cl_mbutton, cl_rbutton, };
/* --------- MouseTool command mode & callback classes ------------- */
class MouseToolCallBack : public MouseCallBack
{
public:
MouseTool* tool;
IPoint2 last_mp;
Point3 last_wp;
Point3 last_cpp;
MouseToolCallBack() {}
int proc(HWND hwnd, int msg, int point, int flags, IPoint2 m);
int mouse_proc(ViewExp *vpt, int msg, int point, int flags, IPoint2 m, Matrix3& mat, BOOL createMouseCallback = FALSE);
void set_context_locals(ViewExp* vpx, int snap, int point, int flag, IPoint2 mp, Point3 cpp, Matrix3& mat);
void reset_context_locals();
};
#define MOUSE_TOOL_COMMAND 7364
#define CID_MOUSE_TOOL CID_USER + 45237
class MouseToolCommandMode : public CommandMode, public CommandModeChangedCallback
{
public:
MouseToolCallBack proc;
BOOL active;
TCHAR* prompt;
int num_points;
int cmd_class;
int Class() { return cmd_class; }
int ID() { return CID_MOUSE_TOOL; }
MouseCallBack *MouseProc(int *points) { *points = num_points; return &proc; }
ChangeForegroundCallback *ChangeFGProc() { return NULL; }
BOOL ChangeFG(CommandMode *oldMode) { return FALSE; }
void EnterMode();
void ExitMode();
void ModeChanged(CommandMode *oldM, CommandMode *newM);
};
/* ------------- MouseTool MAXScript value class -------------- */
visible_class (MouseTool)
class MouseTool : public Value
{
public:
Value* name; // tool name
HashTable* local_scope; // local name space
Value** locals; // local var array
Value** local_inits; // " " " init vals
int local_count; // " " count
HashTable* handlers; // handler tables
short flags; // tool flags
int cmd_class; // command mode class
int num_points; // number of points
Value* prompt; // staus line prompt if non-null
BOOL init_values; // whether to init ctrl/local values on (re)open
BOOL end_tool_mode; // signals end of tool cmd mode
MouseToolCommandMode cmdmode; // my command mode
// command mode locals...
Value* result; // tool result
Value* snap_mode; // #2D or #3D or #none
MSPlugin* plugin; // current plugin under manip if non-NULL
MouseTool(short iflags);
void init(Value* name, int local_count, Value** inits, HashTable* local_scope, HashTable* handlers);
~MouseTool();
classof_methods (MouseTool, Value);
void collect() { delete this; }
void gc_trace();
ScripterExport void sprin1(CharStream* s);
BOOL call_event_handler(Value* handler, Value** arg_list, int count, BOOL enable_redraw = TRUE);
void init_locals();
virtual Value* get_property(Value** arg_list, int count);
virtual Value* set_property(Value** arg_list, int count);
};
#endif

View File

@ -0,0 +1,150 @@
/*
* MSCustAttrib.h - MAXScript scriptable custom attributes MAX objects
*
* Copyright <20> Autodesk, Inc, 2000. John Wainwright.
*
*/
#ifndef _H_MSCUST_ATTRIB
#define _H_MSCUST_ATTRIB
// ---------- scripter Custom Attribute classes -------------------
#include "CustAttrib.h"
#define I_SCRIPTEDCUSTATTRIB 0x000010C1
#define MSCUSTATTRIB_CHUNK 0x0110
#define MSCUSTATTRIB_NAME_CHUNK 0x0010
// special subclass for holding custom attribute definitions
// these can be applied to any existing object, adding a CustAttrib to it
// instances of MSCustAttrib (an MSPlugin subclass) refer to CustAttribDefs for metadata
visible_class (MSCustAttribDef)
class MSCustAttribDef : public MSPluginClass
{
public:
static Tab<MSCustAttribDef*> ms_attrib_defs; // table of existing scripted attribute defs to enable redefinition
Value* defData; // persistent definition data, used by the scripter attribute editor
TSTR source; // extracted definition source, stored persistently with the def & automatically recompiled on
// reload
MSCustAttribDef(Class_ID& attrib_id);
~MSCustAttribDef();
// definition and redefinition
static MSCustAttribDef* intern(Class_ID& attrib_id);
void init(int local_count, Value** inits, HashTable* local_scope, HashTable* handlers, Array* pblock_defs, Array* rollouts, CharStream* source);
// MAXScript required
// BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MSCustAttribDef)) ? 1 : Value::is_kind_of(c); } // LAM: 2/23/01
BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MSCustAttribDef)) ? 1 : MSPluginClass::is_kind_of(c); }
# define is_attribute_def(v) ((v)->tag == class_tag(MSCustAttribDef))
void collect() { delete this; }
void gc_trace();
void sprin1(CharStream* s);
bool is_custAttribDef() { return true; }
MSCustAttribDef* unique_clone();
// from Value
Value* apply(Value** arg_list, int count, CallContext* cc=NULL) { return Value::apply(arg_list, count, cc); } // CustAttribDef's are not applyable
// scene I/O
static IOResult save_custattrib_defs(ISave* isave);
static IOResult load_custattrib_defs(ILoad* iload);
// ClassDesc delegates
RefTargetHandle Create(BOOL loading);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
def_property ( name );
};
// MSCustAttrib - instances contain individual custom attribute blocks
// that are added to customized objects.
class MSCustAttrib : public MSPlugin, public CustAttrib, public ISubMap
{
public:
IObjParam* cip; // ip for any currently open command panel dialogs
static MSAutoMParamDlg* masterMDlg; // master dialog containing all scripted rollout
IMtlParams* mip; // ip for any open mtlEditor panel dlgs
TSTR name; // name of the custom attribute
MSCustAttrib() : cip(NULL), mip(NULL) { }
MSCustAttrib(MSCustAttribDef* pc, BOOL loading);
~MSCustAttrib() { DeleteAllRefsFromMe(); }
void sprin1(CharStream* s);
// From MSPlugin
HWND AddRollupPage(HINSTANCE hInst, TCHAR *dlgTemplate, DLGPROC dlgProc, TCHAR *title, LPARAM param=0,DWORD flags=0, int category=ROLLUP_CAT_CUSTATTRIB - 1);
void DeleteRollupPage(HWND hRollup);
IRollupWindow* GetRollupWindow();
ReferenceTarget* get_delegate() { return NULL; } // no delegates in MSCustAttribs
// from CustAttrib
TCHAR* GetName() { return name; }
ParamDlg* CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp);
void SetName(TCHAR* newName) { name = newName ; }
// From Animatable
using CustAttrib::GetInterface;
void GetClassName(TSTR& s) { s = TSTR(pc->class_name->to_string()); }
Class_ID ClassID() { return pc->class_id; }
SClass_ID SuperClassID() { return pc->sclass_id; }
void FreeCaches() { }
int NumSubs() { return pblocks.Count(); }
Animatable* SubAnim(int i) { return pblocks[i]; }
TSTR SubAnimName(int i) { return pblocks[i]->GetLocalName(); }
int NumParamBlocks() { return pblocks.Count(); }
IParamBlock2* GetParamBlock(int i) { return pblocks[i]; }
IParamBlock2* GetParamBlockByID(BlockID id) { return MSPlugin::GetParamBlockByID(id); }
BOOL CanCopyAnim() { return FALSE; }
void* GetInterface(ULONG id);
void DeleteThis();
void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev);
void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next);
// From ReferenceMaker
RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message)
{
if (!(pc->mpc_flags & MPC_REDEFINITION))
return ((MSPlugin*)this)->NotifyRefChanged(changeInt, hTarget, partID, message);
else
return REF_SUCCEED;
}
// From ReferenceTarget
int NumRefs() { return pblocks.Count(); }
RefTargetHandle GetReference(int i) { return pblocks[i]; }
void SetReference(int i, RefTargetHandle rtarg)
{
if (i >= pblocks.Count()) pblocks.SetCount(i+1); pblocks[i] = (IParamBlock2*)rtarg;
}
void RefDeleted() { MSPlugin::RefDeleted(); }
RefTargetHandle Clone(RemapDir& remap = NoRemap());
IOResult Save(ISave *isave);
IOResult Load(ILoad *iload);
// from ISubMap
int NumSubTexmaps();
Texmap* GetSubTexmap(int i);
void SetSubTexmap(int i, Texmap *m);
TSTR GetSubTexmapSlotName(int i);
int MapSlotType(int i) { return MAPSLOT_TEXTURE; }
TSTR GetSubTexmapTVName(int i) { return GetSubTexmapSlotName(i); }
ReferenceTarget *GetRefTarget() { return this; }
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,86 @@
/* MSTime.h - the time family of classes for MAXScript
*
* Copyright (c) John Wainwright, 1996
*
*
*/
#ifndef _H_MSTIME
#define _H_MSTIME
#include "Max.h"
/* ------------------------ Time ------------------------------ */
visible_class (MSTime)
class MSTime : public Value
{
public:
TimeValue time;
ENABLE_STACK_ALLOCATE(MSTime);
MSTime (TimeValue t);
static ScripterExport Value* intern(TimeValue t);
# define is_time(o) ((o)->tag == class_tag(MSTime))
classof_methods (MSTime, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
#include "defimpfn.h"
# include "timepro.h"
def_generic ( coerce, "coerce");
def_property ( ticks );
def_property ( frame );
def_property ( normalized );
TimeValue to_timevalue() { return time; }
float to_float() { return (float)time / GetTicksPerFrame(); }
int to_int() { return (int)time / GetTicksPerFrame(); }
void to_fpvalue(FPValue& v) { v.i = time; v.type = TYPE_TIMEVALUE; }
Value* widen_to(Value* arg, Value** arg_list);
BOOL comparable(Value* arg);
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
/* ------------------------ Interval ------------------------------ */
applyable_class (MSInterval)
class MSInterval : public Value
{
public:
Interval interval;
ENABLE_STACK_ALLOCATE(MSInterval);
MSInterval () {};
ScripterExport MSInterval (Interval i);
ScripterExport MSInterval (TimeValue s, TimeValue e);
# define is_interval(o) ((o)->tag == class_tag(MSInterval))
classof_methods (MSInterval, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
#include "defimpfn.h"
def_property ( start );
def_property ( end );
Interval to_interval() { return interval; }
void to_fpvalue(FPValue& v) { v.intvl = new Interval (interval.Start(), interval.End()); v.type = TYPE_INTERVAL; }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
#endif

View File

@ -0,0 +1,126 @@
/*
* MSZipPackage.h - MAXScript Zip Package file classes & utilities
*
* Copyright <20> Autodesk, Inc, 2000. John Wainwright.
*
*/
#ifndef _H_MSZIPPACKAGE
#define _H_MSZIPPACKAGE
#include "Parser.h"
class MSZipPackage;
class DotRunParser;
class MZPExtraction;
class TabMZPExtraction;
// MZPExtraction & TabMZPExtraction, for maintaing a table of
// file extractions so far giving name in .zip and local extracted name
class MZPExtraction
{
public:
TSTR zip_name;
TSTR extracted_name;
MZPExtraction(TCHAR* zip_name, TCHAR* extracted_name) :
zip_name(zip_name), extracted_name(extracted_name) { }
};
class TabMZPExtraction : public Tab<MZPExtraction*>
{
public:
~TabMZPExtraction();
TCHAR* find(TCHAR* zip_name);
void add(TCHAR* zip_name, TCHAR* extracted_name);
};
// MSZipPackage: instances represent open .mzp package files
class MSZipPackage : public Value
{
public:
enum clear_modes { CLEAR_NOW, CLEAR_ON_MAX_EXIT, CLEAR_ON_RESET, KEEP, }; // clear temp modes
TSTR file_name; // zip package file name
TSTR package_name; // parsed from mzp.run file...
TSTR description;
int version;
TSTR extract_dir; // current extract dir
TSTR drop_file; // primary drop file (if any in found)
TabMZPExtraction extractions; // currently extracted files
clear_modes clear_mode;
WORD flags; // flag bits
MSZipPackage(TCHAR* file_name) : file_name(file_name), flags(0), clear_mode(CLEAR_ON_MAX_EXIT) { tag = INTERNAL_CLASS_TAG; }
void collect() { delete this; }
// main zip package file in function
ScripterExport static bool file_in_package(TCHAR* file_name, TSTR* extract_dir=NULL);
static int WINAPI output_callback(char far *buf, unsigned long size);
// package SearchFile
ScripterExport static BOOL search_current_package(TCHAR* file_name, TCHAR* found_path);
// extraction
bool extract_to(TCHAR* dir);
TCHAR* find_extraction(TCHAR* zip_name) { return extractions.find(zip_name); }
void add_extraction(TCHAR* zip_name, TCHAR* extracted_name);
// directory & file manipulation
ScripterExport static TSTR expand_dir(TCHAR* dir);
ScripterExport static TSTR expand_file(TCHAR* file_name);
TSTR expand_dir_for_extraction(TCHAR* dir);
TSTR expand_file_for_extraction(TCHAR* file_name);
// running
void run_all_scripts();
bool run_script(TCHAR* zip_name);
};
// MZP flags
#define MZP_DONT_RUN 0x0001 // just loading, don't run any scripts
#define MZP_HAVE_DROPFILE 0x0002 // 'drop' command encountered
#define MZP_HAVE_OPEN 0x0004 // 'open' command encountered
// interpret copy() function type bits...
#define MZP_COPY 0x00
#define MZP_MOVE 0x01
#define MZP_FILES 0x00
#define MZP_TREE 0x02
#define MZP_NOREPLACE 0x04
// parser specialization to parse & run mzp.run control file
class DotRunParser : public Parser
{
MSZipPackage* mzp;
public:
DotRunParser (MSZipPackage* mzp) : mzp(mzp) { }
// parse & run mzp.run file
bool interpret(TCHAR* src);
// parser production functions
void name();
void version();
void description();
void extract();
void run();
void drop();
void open();
void merge();
void xref();
void import();
void copy(BYTE type);
void clear();
void keep();
// utils
void copy_files(TCHAR* from, TCHAR* to, BYTE type);
ScripterExport static bool create_dir(TCHAR* dir);
};
#endif

View File

@ -0,0 +1,156 @@
/*
* MSController.h - MAXScript scriptable controllers for MAX
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_MSCONTROLLER
#define _H_MSCONTROLLER
#define SCRIPT_POS_CONTROL_CLASS_ID Class_ID(0x236c6aa5, 0x27590853)
#define SCRIPT_P3_CONTROL_CLASS_ID Class_ID(0x3d7b231d, 0x2b986df3)
#define SCRIPT_FLOAT_CONTROL_CLASS_ID Class_ID(0x151d5ead, 0x55626f88)
#define SCRIPT_SCALE_CONTROL_CLASS_ID Class_ID(0x5f346d25, 0x2c67ff7)
#define SCRIPT_ROT_CONTROL_CLASS_ID Class_ID(0xc6625, 0xb003c2a)
#define SCRIPT_P4_CONTROL_CLASS_ID Class_ID(0x3d7b234d, 0x2b986df4)
class ScriptControl : public StdControl
{
public:
int type;
Interval ivalid;
Interval range;
HWND hParams;
IObjParam * ip;
TSTR desc;
HWND hDlg;
ScriptControl(int type, ScriptControl &ctrl);
ScriptControl(int type, BOOL loading);
~ScriptControl();
// Animatable methods
int TrackParamsType() { return TRACKPARAMS_WHOLE; }
void DeleteThis() { delete this; }
int IsKeyable() { return 0; }
BOOL IsAnimated() {return TRUE;}
Interval GetTimeRange(DWORD flags) { return range; }
void EditTimeRange(Interval range,DWORD flags);
void Hold();
void MapKeys( TimeMap *map, DWORD flags );
void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev );
void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next );
void EditTrackParams(
TimeValue t, // The horizontal position of where the user right clicked.
ParamDimensionBase *dim,
TCHAR *pname,
HWND hParent,
IObjParam *ip,
DWORD flags);
// Reference methods
int NumRefs() { return StdControl::NumRefs() + refTab.Count(); }
ReferenceTarget* GetReference(int i);
void SetReference(int i, RefTargetHandle rtarg);
RefResult NotifyRefChanged(Interval, RefTargetHandle, PartID&, RefMessage);
void RefDeleted();
IOResult Save(ISave *isave);
IOResult Load(ILoad *iload);
// Control methods
void Copy(Control *from);
RefTargetHandle Clone(RemapDir& remap=NoRemap()) { ScriptControl *newob = new ScriptControl(this->type, *this); BaseClone(this, newob, remap); return(newob); }
BOOL IsLeaf() { return TRUE; }
void GetValueLocalTime(TimeValue t, void *val, Interval &valid, GetSetMethod method=CTRL_ABSOLUTE);
void SetValueLocalTime(TimeValue t, void *val, int commit, GetSetMethod method) {}
void Extrapolate(Interval range,TimeValue t,void *val,Interval &valid,int type);
void *CreateTempValue();
void DeleteTempValue(void *val);
void ApplyValue(void *val, void *delta);
void MultiplyValue(void *val, float m);
};
class ScriptPosControl : public ScriptControl
{
public:
ScriptPosControl(ScriptPosControl &ctrl) : ScriptControl(CTRL_POSITION_CLASS_ID, ctrl) {}
ScriptPosControl(BOOL loading=FALSE) : ScriptControl(CTRL_POSITION_CLASS_ID, loading) {}
~ScriptPosControl() {}
RefTargetHandle Clone(RemapDir& remap=NoRemap()) { ScriptPosControl *newob = new ScriptPosControl(*this); BaseClone(this, newob, remap); return(newob); }
void GetClassName(TSTR& s) { s = _T("Position_script"); }
Class_ID ClassID() { return Class_ID(SCRIPT_POS_CONTROL_CLASS_ID,0); }
SClass_ID SuperClassID() { return CTRL_POSITION_CLASS_ID; }
};
class ScriptP3Control : public ScriptControl
{
public:
ScriptP3Control(ScriptP3Control &ctrl) : ScriptControl(CTRL_POINT3_CLASS_ID, ctrl) {}
ScriptP3Control(BOOL loading=FALSE) : ScriptControl(CTRL_POINT3_CLASS_ID, loading) {}
~ScriptP3Control() {}
RefTargetHandle Clone(RemapDir& remap=NoRemap()) { ScriptP3Control *newob = new ScriptP3Control(*this); BaseClone(this, newob, remap); return(newob); }
void GetClassName(TSTR& s) { s = _T("Point3_script"); }
Class_ID ClassID() { return Class_ID(SCRIPT_P3_CONTROL_CLASS_ID,0); }
SClass_ID SuperClassID() { return CTRL_POINT3_CLASS_ID; }
};
class ScriptP4Control : public ScriptControl
{
public:
ScriptP4Control(ScriptP4Control &ctrl) : ScriptControl(CTRL_POINT4_CLASS_ID, ctrl) {}
ScriptP4Control(BOOL loading=FALSE) : ScriptControl(CTRL_POINT4_CLASS_ID, loading) {}
~ScriptP4Control() {}
RefTargetHandle Clone(RemapDir& remap=NoRemap()) { ScriptP4Control *newob = new ScriptP4Control(*this); BaseClone(this, newob, remap); return(newob); }
void GetClassName(TSTR& s) { s = _T("Point4_script"); }
Class_ID ClassID() { return Class_ID(SCRIPT_P4_CONTROL_CLASS_ID,0); }
SClass_ID SuperClassID() { return CTRL_POINT4_CLASS_ID; }
};
class ScriptFloatControl : public ScriptControl
{
public:
ScriptFloatControl(ScriptFloatControl &ctrl) : ScriptControl(CTRL_FLOAT_CLASS_ID, ctrl) {}
ScriptFloatControl(BOOL loading=FALSE) : ScriptControl(CTRL_FLOAT_CLASS_ID, loading) {}
~ScriptFloatControl() {}
RefTargetHandle Clone(RemapDir& remap=NoRemap()) { ScriptFloatControl *newob = new ScriptFloatControl(*this); BaseClone(this, newob, remap); return(newob); }
void GetClassName(TSTR& s) { s = _T("Float_script"); }
Class_ID ClassID() { return Class_ID(SCRIPT_FLOAT_CONTROL_CLASS_ID,0); }
SClass_ID SuperClassID() { return CTRL_FLOAT_CLASS_ID; }
};
class ScriptScaleControl : public ScriptControl
{
public:
ScriptScaleControl(ScriptScaleControl &ctrl) : ScriptControl(CTRL_SCALE_CLASS_ID, ctrl) {}
ScriptScaleControl(BOOL loading=FALSE) : ScriptControl(CTRL_SCALE_CLASS_ID, loading) {}
~ScriptScaleControl() {}
RefTargetHandle Clone(RemapDir& remap=NoRemap()) { ScriptScaleControl *newob = new ScriptScaleControl(*this); BaseClone(this, newob, remap); return(newob); }
void GetClassName(TSTR& s) { s = _T("Scale_script"); }
Class_ID ClassID() { return Class_ID(SCRIPT_SCALE_CONTROL_CLASS_ID,0); }
SClass_ID SuperClassID() { return CTRL_SCALE_CLASS_ID; }
};
class ScriptRotControl : public ScriptControl
{
public:
ScriptRotControl(ScriptRotControl &ctrl) : ScriptControl(CTRL_ROTATION_CLASS_ID, ctrl) {}
ScriptRotControl(BOOL loading=FALSE) : ScriptControl(CTRL_ROTATION_CLASS_ID, loading) {}
~ScriptRotControl() {}
RefTargetHandle Clone(RemapDir& remap=NoRemap()) { ScriptRotControl *newob = new ScriptRotControl(*this); BaseClone(this, newob, remap); return(newob); }
void GetClassName(TSTR& s) { s = _T("Rotation_script"); }
Class_ID ClassID() { return Class_ID(SCRIPT_ROT_CONTROL_CLASS_ID,0); }
SClass_ID SuperClassID() { return CTRL_ROTATION_CLASS_ID; }
};
#endif

View File

@ -0,0 +1,55 @@
/*
* Name.h - Name class for MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_NAME
#define _H_NAME
#include "HashTab.h"
visible_class (Name)
class Name : public Value
{
public:
TCHAR* string;
static HashTable* intern_table;
Name(TCHAR *init_string);
~Name() { if (string) free(string); }
# define is_name(o) ((o)->tag == class_tag(Name))
static void setup();
static ScripterExport Value* intern(TCHAR* str);
static ScripterExport Value* find_intern(TCHAR* str);
classof_methods (Name, Value);
ScripterExport void sprin1(CharStream* s);
void collect() { delete this; }
TCHAR* to_string();
TSTR to_filename();
void to_fpvalue(FPValue& v) { v.s = to_string(); v.type = TYPE_NAME; }
#include "defimpfn.h"
use_generic( coerce, "coerce");
use_generic( gt, ">");
use_generic( lt, "<");
use_generic( ge, ">=");
use_generic( le, "<=");
use_generic( copy, "copy");
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
/* core interned names */
#include "defextfn.h"
# include "corename.h"
#endif

View File

@ -0,0 +1,70 @@
/*
* NamedSet.h - scripter access to named node selection sets
*
* John Wainwright
* Copyright <20> Autodesk, Inc. 1997
*
*/
#ifndef _H_NAMEDSET
#define _H_NAMEDSET
/* ---------------------- MAXNamedSetArray ----------------------- */
// provides array-like access to the table of named selection sets
visible_class (MAXNamedSetArray)
class MAXNamedSetArray : public Value, public Collection
{
public:
MAXNamedSetArray();
classof_methods (MAXNamedSetArray, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
// operations
ScripterExport Value* map(node_map& m);
#include "defimpfn.h"
# include "arraypro.h"
// built-in property accessors
def_property ( count );
};
/* ---------------------- MAXNamedSet ----------------------- */
visible_class (MAXNamedSet)
class MAXNamedSet : public Value, public Collection
{
public:
TSTR name;
MAXNamedSet(TCHAR* iname);
classof_methods (MAXNamedSet, Value);
BOOL _is_collection() { return 1; }
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
// operations
ScripterExport Value* map(node_map& m);
#include "defimpfn.h"
# include "arraypro.h"
// built-in property accessors
def_property ( count );
def_property ( center );
def_property ( min );
def_property ( max );
};
extern MAXNamedSetArray theNamedSetArray;
#endif

View File

@ -0,0 +1,449 @@
/*
* MAX_node_protocol.h - def_generics for the operations on MAX node objects
*
* see def_abstract_generics.h for more info.
*
*
* Copyright <20> John Wainwright 1996
*
*/
/* node transforms */
def_node_generic(move, "move");
def_node_generic(scale, "scale");
def_node_generic(rotate, "rotate");
/* node ops */
def_node_generic(copy, "copy");
def_node_generic(reference, "reference");
def_node_generic(instance, "instance");
def_visible_primitive(delete, "delete"); // a prim so I can control collection traversal
def_node_generic(isDeleted, "isDeleted");
def_node_generic(addModifier, "addModifier");
def_node_generic(deleteModifier, "deleteModifier");
def_node_generic(collapseStack, "collapseStack");
def_node_generic(bindSpaceWarp, "bindSpaceWarp");
def_node_generic(intersects, "intersects");
// def_node_generic(dependsOn, "dependsOn");
def_node_generic (instanceReplace, "instanceReplace");
def_node_generic (referenceReplace, "referenceReplace");
def_node_generic (snapShot, "snapShot");
def_visible_generic (getModContextTM, "getModContextTM");
def_visible_generic (getModContextBBoxMin, "getModContextBBoxMin");
def_visible_generic (getModContextBBoxMax, "getModContextBBoxMax");
def_visible_primitive (validModifier, "validModifier");
def_visible_generic (canConvertTo, "canConvertTo");
def_node_generic (convertTo, "convertTo");
def_node_generic (flagForeground, "flagForeground");
def_visible_primitive( AttachObjects, "AttachObjects");
/* node state */
def_node_generic(hide, "hide");
def_node_generic(unhide, "unhide");
def_node_generic(unfreeze, "unfreeze");
def_node_generic(freeze, "freeze");
def_node_generic(select, "select");
def_node_generic(deselect, "deselect");
def_visible_primitive(clearSelection, "clearSelection");
def_node_generic(selectmore, "selectmore");
def_visible_primitive(group, "group");
def_visible_primitive(ungroup, "ungroup");
def_visible_primitive(explodeGroup, "explodeGroup");
/* object xrefs */
def_visible_generic ( updateXRef, "updateXRef");
/* NURBS */
#ifndef NO_NURBS
def_node_generic ( getNURBSSet, "getNURBSSet");
def_node_generic ( addNURBSSet, "addNURBSSet");
use_generic ( transform, "transform" );
def_node_generic ( breakCurve, "breakCurve" );
def_node_generic ( breakSurface, "breakSurface" );
def_node_generic ( joinCurves, "joinCurves" );
def_node_generic ( joinSurfaces, "joinSurfaces" );
def_node_generic ( makeIndependent, "makeIndependent" );
def_node_generic ( convertToNURBSCurve, "convertToNURBSCurve" );
def_node_generic ( convertToNURBSSurface, "convertToNURBSSurface" );
def_node_generic ( setViewApproximation, "setViewApproximation" );
def_node_generic ( setRenderApproximation, "setRenderApproximation" );
def_node_generic ( setSurfaceDisplay, "setSurfaceDisplay" );
#endif // NO_NURBS
/* utilities */
def_node_generic(intersectRay, "intersectRay");
def_node_generic(printstack, "printstack");
def_visible_primitive(uniqueName, "uniqueName");
/* user prop access */
def_node_generic( getUserProp, "getUserProp");
def_node_generic( setUserProp, "setUserProp");
def_node_generic( getUserPropBuffer, "getUserPropBuffer");
def_node_generic( setUserPropBuffer, "setUserPropBuffer");
/* mesh ops -- if baseobject is a mesh */
use_generic ( plus, "+" ); // mesh boolean ops
use_generic ( minus, "-" );
use_generic ( times, "*" );
def_node_generic( convertToMesh, "convertToMesh"); // this works on those things convertable to meshes
def_visible_generic( setvert, "setvert");
def_visible_generic( getvert, "getvert");
def_visible_generic( settvert, "settvert");
def_visible_generic( gettvert, "gettvert");
def_visible_generic( setvertcolor, "setvertcolor");
def_visible_generic( getvertcolor, "getvertcolor");
def_visible_generic( setnumverts, "setnumverts");
def_visible_generic( getnumverts, "getnumverts");
def_visible_generic( setnumtverts, "setnumtverts");
def_visible_generic( getnumtverts, "getnumtverts");
def_visible_generic( setnumcpvverts, "setnumcpvverts");
def_visible_generic( getnumcpvverts, "getnumcpvverts");
def_visible_generic( setnumfaces, "setnumfaces");
def_visible_generic( getnumfaces, "getnumfaces");
def_visible_generic( buildtvfaces, "buildTVFaces");
def_visible_generic( buildvcfaces, "buildVCFaces");
def_visible_generic( defaultvcfaces, "defaultVCFaces");
def_visible_generic( getnormal, "getnormal");
def_visible_generic( setnormal, "setnormal");
def_visible_generic( setface, "setface");
def_visible_generic( getface, "getface");
def_visible_generic( settvface, "setTVFace");
def_visible_generic( gettvface, "getTVFace");
def_visible_generic( setvcface, "setVCFace");
def_visible_generic( getvcface, "getVCFace");
def_visible_generic( getfacenormal, "getfacenormal");
def_visible_generic( setfacenormal, "setfacenormal");
def_visible_generic( setfacematid, "setfaceMatID");
def_visible_generic( getfacematid, "getfaceMatID");
def_visible_generic( setfacesmoothgroup, "setfaceSmoothGroup");
def_visible_generic( getfacesmoothgroup, "getfaceSmoothGroup");
def_visible_generic( setedgevis, "setedgevis");
def_visible_generic( getedgevis, "getedgevis");
def_visible_generic( attach, "attach");
def_visible_generic( detachVerts, "detachVerts");
def_visible_generic( detachFaces, "detachFaces");
def_visible_generic( extrudeface, "extrudeface");
def_visible_generic( deletevert, "deletevert");
def_visible_generic( deleteface, "deleteface");
def_visible_generic( collapseface, "collapseface");
def_visible_generic( setMesh, "setMesh");
def_visible_generic( update, "update");
def_visible_generic( getDisplacementMapping, "getDisplacementMapping");
def_visible_generic( setDisplacementMapping, "setDisplacementMapping");
def_visible_generic( getSubdivisionDisplacement, "getSubdivisionDisplacement");
def_visible_generic( setSubdivisionDisplacement, "setSubdivisionDisplacement");
def_visible_generic( getSplitMesh, "getSplitMesh");
def_visible_generic( setSplitMesh, "setSplitMesh");
def_visible_generic( displacementToPreset, "displacementToPreset" );
def_node_generic( getVertSelection, "getVertSelection"); // getVertSelection <node> <nodemodifier>
def_node_generic( setVertSelection, "setVertSelection");
def_node_generic( getFaceSelection, "getFaceSelection");
def_node_generic( setFaceSelection, "setFaceSelection");
def_node_generic( getEdgeSelection, "getEdgeSelection");
def_node_generic( setEdgeSelection, "setEdgeSelection");
def_struct_primitive( mo_startCreate, meshOps, "startCreate");
def_struct_primitive( mo_startAttach, meshOps, "startAttach");
def_struct_primitive( mo_startExtrude, meshOps, "startExtrude");
def_struct_primitive( mo_startBevel, meshOps, "startBevel");
def_struct_primitive( mo_startChamfer, meshOps, "startChamfer");
def_struct_primitive( mo_startCut, meshOps, "startCut");
def_struct_primitive( mo_startSlicePlane, meshOps, "startSlicePlane");
def_struct_primitive( mo_startWeldTarget, meshOps, "startWeldTarget");
def_struct_primitive( mo_startFlipNormalMode, meshOps, "startFlipNormalMode");
def_struct_primitive( mo_startDivide, meshOps, "startDivide");
def_struct_primitive( mo_startTurn, meshOps, "startTurn");
def_struct_primitive( mo_hideOp, meshOps, "hide");
def_struct_primitive( mo_unhideAllOp, meshOps, "unhideAll");
def_struct_primitive( mo_deleteOp, meshOps, "delete");
def_struct_primitive( mo_detachOp, meshOps, "detach");
def_struct_primitive( mo_weldOp, meshOps, "weld");
def_struct_primitive( mo_breakOp, meshOps, "break");
def_struct_primitive( mo_viewAlignOp, meshOps, "viewAlign");
def_struct_primitive( mo_gridAlignOp, meshOps, "gridAlign");
def_struct_primitive( mo_makePlanarOp, meshOps, "makePlanar");
def_struct_primitive( mo_collapseOp, meshOps, "collapse");
def_struct_primitive( mo_tesselateOp, meshOps, "tessellate");
def_struct_primitive( mo_explodeOp, meshOps, "explode");
def_struct_primitive( mo_sliceOp, meshOps, "slice");
def_struct_primitive( mo_removeIsolatedVertsOp, meshOps, "removeIsolatedVerts");
def_struct_primitive( mo_selectOpenEdgesOp, meshOps, "selectOpenEdges");
def_struct_primitive( mo_createShapeFromEdgesOp,meshOps, "createShapeFromEdges");
def_struct_primitive( mo_flipNormalOp, meshOps, "flipNormal");
def_struct_primitive( mo_unifyNormalOp, meshOps, "unifyNormal");
def_struct_primitive( mo_visibleEdgeOp, meshOps, "visibleEdge");
def_struct_primitive( mo_invisibleEdgeOp, meshOps, "invisibleEdge");
def_struct_primitive( mo_autoEdgeOp, meshOps, "autoEdge");
def_struct_primitive( mo_showNormalOp, meshOps, "showNormal");
def_struct_primitive( mo_opAutoSmooth, meshOps, "autoSmooth");
def_struct_primitive( mo_attachList, meshOps, "attachList");
def_struct_primitive( mo_opSelectByID, meshOps, "selectByID");
def_struct_primitive( mo_opSelectBySG, meshOps, "selectBySG");
def_struct_primitive( mo_opClearAllSG, meshOps, "clearAllSG");
def_struct_primitive( mo_opSelectByColor, meshOps, "selectByColor");
/* poly ops -- if baseobject is a poly */
def_node_generic( convertToPoly, "convertToPoly"); // this works on those things convertable to polys
/* shape ops -- if baseobject is a shape */
def_node_generic( pathinterp, "pathInterp"); // MAX path interpolation (subcurve piecewise)
def_node_generic( lengthinterp, "lengthInterp"); // total arclength interpolation
def_visible_primitive( resetlengthinterp, "resetLengthInterp"); // clear length interp caches
def_node_generic( curvelength, "curveLength"); // total arclength interpolation
def_node_generic( nearestpathparam, "nearestPathParam"); // path 'u' param at nearest point along curve to obj
def_node_generic( pathtolengthparam, "pathToLengthParam"); // give length 'u' param from path 'u' param
def_node_generic( lengthtopathparam, "lengthToPathParam"); // give path 'u' param from length 'u' param
def_node_generic( pathtangent, "pathTangent"); // MAX path interpolation tangent (subcurve piecewise)
def_node_generic( lengthtangent, "lengthTangent"); // total arclength interpolation tangent
/* bezier shape ops -- if baseobject is a bezier shape */
def_node_generic( convertToSplineShape, "convertToSplineShape"); // this works on those things convertable to splineshapes
def_node_generic( addNewSpline, "addNewSpline");
def_node_generic( deleteSpline, "deleteSpline");
def_node_generic( numSplines, "numSplines");
def_node_generic( setFirstSpline, "setFirstSpline");
def_node_generic( resetShape, "resetShape");
def_node_generic( updateShape, "updateShape");
def_node_generic( numKnots, "numKnots");
def_node_generic( numSegments, "numSegments");
def_node_generic( isClosed, "isClosed");
use_generic ( close, "close");
def_node_generic( open, "open");
def_node_generic( addKnot, "addKnot");
def_node_generic( deleteKnot, "deleteKnot");
def_node_generic( setKnotType, "setKnotType");
def_node_generic( getKnotType, "getKnotType");
def_node_generic( setSegmentType, "setSegmentType");
def_node_generic( getSegmentType, "getSegmentType");
def_node_generic( refineSegment, "refineSegment");
def_node_generic( reverse, "reverse");
def_node_generic( setFirstKnot, "setFirstKnot");
def_node_generic( setKnotPoint, "setKnotPoint");
def_node_generic( getKnotPoint, "getKnotPoint");
def_node_generic( getInVec, "getInVec");
def_node_generic( setInVec, "setInVec");
def_node_generic( getOutVec, "getOutVec");
def_node_generic( setOutVec, "setOutVec");
def_node_generic( hideSelectedVerts,"hideSelectedVerts");
def_node_generic( hideSelectedSplines, "hideSelectedSplines");
def_node_generic( hideSelectedSegments, "hideSelectedSegments");
def_node_generic( unhideSegments, "unhideSegments");
def_node_generic( updateBindList, "updateBindList");
def_node_generic( unbindKnot, "unbindKnot");
def_node_generic( bindKnot, "bindKnot");
def_node_generic( materialID, "materialID");
def_node_generic( addAndWeld, "addAndWeld");
def_visible_primitive( getKnotSelection, "getKnotSelection"); // getKnotSelection <node> works only for editable splines
def_visible_primitive( setKnotSelection, "setKnotSelection");
def_visible_primitive( getSegSelection, "getSegSelection");
def_visible_primitive( setSegSelection, "setSegSelection");
def_visible_primitive( getSplineSelection, "getSplineSelection");
def_visible_primitive( setSplineSelection, "setSplineSelection");
def_struct_primitive( so_startCreateLine, splineOps, "startCreateLine");
def_struct_primitive( so_startAttach, splineOps, "startAttach");
def_struct_primitive( so_startInsert, splineOps, "startInsert");
def_struct_primitive( so_startConnect, splineOps, "startConnect");
def_struct_primitive( so_startRefine, splineOps, "startRefine");
def_struct_primitive( so_startFillet, splineOps, "startFillet");
def_struct_primitive( so_startChamfer, splineOps, "startChamfer");
def_struct_primitive( so_startBind, splineOps, "startBind");
def_struct_primitive( so_startRefineConnect,splineOps, "startRefineConnect");
def_struct_primitive( so_startOutline, splineOps, "startOutline");
def_struct_primitive( so_startTrim, splineOps, "startTrim");
def_struct_primitive( so_startExtend, splineOps, "startExtend");
def_struct_primitive( so_startCrossInsert, splineOps, "startCrossInsert");
def_struct_primitive( so_startBreak, splineOps, "startBreak");
def_struct_primitive( so_startUnion, splineOps, "startUnion");
def_struct_primitive( so_startSubtract, splineOps, "startSubtract");
def_struct_primitive( so_startIntersect, splineOps, "startIntersect");
def_struct_primitive( so_startCrossSection, splineOps, "startCrossSection");
def_struct_primitive( so_startCopyTangent, splineOps, "startCopyTangent");
def_struct_primitive( so_startPasteTangent, splineOps, "startPasteTangent");
def_struct_primitive( so_opHide, splineOps, "hide");
def_struct_primitive( so_opUnhideAll, splineOps, "unhideAll");
def_struct_primitive( so_opDelete, splineOps, "delete");
def_struct_primitive( so_opDetach, splineOps, "detach");
def_struct_primitive( so_opDivide, splineOps, "divide");
def_struct_primitive( so_opCycle, splineOps, "cycle");
def_struct_primitive( so_opUnbind, splineOps, "unbind");
def_struct_primitive( so_opWeld, splineOps, "weld");
def_struct_primitive( so_opMakeFirst, splineOps, "makeFirst");
def_struct_primitive( so_opAttachMultiple, splineOps, "attachMultiple");
def_struct_primitive( so_opExplode, splineOps, "explode");
def_struct_primitive( so_opReverse, splineOps, "reverse");
def_struct_primitive( so_opClose, splineOps, "close");
def_struct_primitive( so_opIntersect, splineOps, "intersect");
def_struct_primitive( so_opMirrorHoriz, splineOps, "mirrorHoriz");
def_struct_primitive( so_opMirrorVert, splineOps, "mirrorVert");
def_struct_primitive( so_opMirrorBoth, splineOps, "mirrorBoth");
def_struct_primitive( so_opSelectByID, splineOps, "selectByID");
def_struct_primitive( so_opFuse, splineOps, "fuse");
/* particle ops -- if baseobject is a particle system */
def_node_generic( particlecount, "particleCount");
def_node_generic( particlepos, "particlePos");
def_node_generic( particlevelocity, "particleVelocity");
def_node_generic( particleage, "particleAge");
def_node_generic( particlesize, "particleSize");
/* patch ops */
#ifndef NO_PATCHES
def_struct_primitive( po_startAttach, patchOps, "startAttach");
def_struct_primitive( po_startExtrude, patchOps, "startExtrude");
def_struct_primitive( po_startBevel, patchOps, "startBevel");
def_struct_primitive( po_startBind, patchOps, "startBind");
def_struct_primitive( po_startCreate, patchOps, "startCreate");
def_struct_primitive( po_startWeldTarget, patchOps, "startWeldTarget");
def_struct_primitive( po_startFlipNormalMode, patchOps, "startFlipNormalMode");
def_struct_primitive( po_startCopyTangent, patchOps, "startCopyTangent");
def_struct_primitive( po_startPasteTangent, patchOps, "startPasteTangent");
def_struct_primitive( po_opUnbind, patchOps, "unbind");
def_struct_primitive( po_opHide, patchOps, "hide");
def_struct_primitive( po_opUnhideAll, patchOps, "unhideAll");
def_struct_primitive( po_opWeld, patchOps, "weld");
def_struct_primitive( po_opDelete, patchOps, "delete");
def_struct_primitive( po_opSubdivide, patchOps, "subdivide");
def_struct_primitive( po_opAddTri, patchOps, "addTri");
def_struct_primitive( po_opAddQuad, patchOps, "addQuad");
def_struct_primitive( po_opDetach, patchOps, "detach");
def_struct_primitive( po_opPatchSmooth, patchOps, "patchSmooth");
def_struct_primitive( po_opSelectionShrink, patchOps, "shrinkSelection");
def_struct_primitive( po_opSelectionGrow, patchOps, "growSelection");
def_struct_primitive( po_opEdgeRingSel, patchOps, "selectEdgeRing");
def_struct_primitive( po_opEdgeLoopSel, patchOps, "selectEdgeLoop");
def_struct_primitive( po_opSelectOpenEdges, patchOps, "selectOpenEdges");
def_struct_primitive( po_opBreak, patchOps, "break");
def_struct_primitive( po_opCreateShapeFromEdges, patchOps, "createShapeFromEdges");
def_struct_primitive( po_opFlipNormal, patchOps, "flipNormal");
def_struct_primitive( po_opUnifyNormal, patchOps, "unifyNormal");
def_struct_primitive( po_opSelectByID, patchOps, "selectByID");
def_struct_primitive( po_opSelectBySG, patchOps, "selectBySG");
def_struct_primitive( po_opClearAllSG, patchOps, "clearAllSG");
def_struct_primitive( po_opShadedFaceToggle, patchOps, "toggleShadedFaces");
/* patch access */
def_struct_primitive( p_getNumVerts, patch, "getNumVerts");
def_struct_primitive( p_setNumVerts, patch, "setNumVerts");
def_struct_primitive( p_getNumVecs, patch, "getNumVecs");
def_struct_primitive( p_setNumVecs, patch, "setNumVecs");
def_struct_primitive( p_getNumPatches, patch, "getNumPatches");
def_struct_primitive( p_setNumPatches, patch, "setNumPatches");
def_struct_primitive( p_getNumEdges, patch, "getNumEdges");
def_struct_primitive( p_setNumEdges, patch, "setNumEdges");
def_struct_primitive( p_getVert, patch, "getVert");
def_struct_primitive( p_getVec, patch, "getVec");
def_struct_primitive( p_setVert, patch, "setVert");
def_struct_primitive( p_setVec, patch, "setVec");
def_struct_primitive( p_getVertVecs, patch, "getVertVecs");
def_struct_primitive( p_getVertPatches, patch, "getVertPatches");
def_struct_primitive( p_getVertEdges, patch, "getVertEdges");
def_struct_primitive( p_getVecVert, patch, "getVecVert");
def_struct_primitive( p_getVecPatches, patch, "getVecPatches");
def_struct_primitive( p_getEdgeVert1, patch, "getEdgeVert1");
def_struct_primitive( p_getEdgeVert2, patch, "getEdgeVert2");
def_struct_primitive( p_getEdgeVec12, patch, "getEdgeVec12");
def_struct_primitive( p_getEdgeVec21, patch, "getEdgeVec21");
def_struct_primitive( p_setNumMaps, patch, "setNumMaps");
def_struct_primitive( p_getNumMaps, patch, "getNumMaps");
def_struct_primitive( p_setMapSupport, patch, "setMapSupport");
def_struct_primitive( p_getMapSupport, patch, "getMapSupport");
def_struct_primitive( p_maxMapChannels, patch, "maxMapChannels");
def_struct_primitive( p_setNumMapVerts, patch, "setNumMapVerts");
def_struct_primitive( p_getNumMapVerts, patch, "getNumMapVerts");
def_struct_primitive( p_setNumMapPatches, patch, "setNumMapPatches");
def_struct_primitive( p_getMapVert, patch, "getMapVert");
def_struct_primitive( p_getMapPatch, patch, "getMapPatch");
def_struct_primitive( p_setMapVert, patch, "setMapVert");
def_struct_primitive( p_setMapPatch, patch, "setMapPatch");
// LAM 3/1/01 - removed following - these are messing with the graphics window material,
// not the "material" material
// def_struct_primitive( p_getMtlID, patch, "getMtlID");
// def_struct_primitive( p_setMtlID, patch, "setMtlID");
def_struct_primitive( p_getPatchMtlID, patch, "getPatchMtlID");
def_struct_primitive( p_setPatchMtlID, patch, "setPatchMtlID");
def_struct_primitive( p_update, patch, "update");
def_struct_primitive( p_setMeshSteps, patch, "setMeshSteps");
def_struct_primitive( p_getMeshSteps, patch, "getMeshSteps");
#ifndef NO_OUTPUTRENDERER
def_struct_primitive( p_setMeshStepsRender, patch, "setMeshStepsRender");
def_struct_primitive( p_getMeshStepsRender, patch, "getMeshStepsRender");
#endif // NO_OUTPUTRENDERER
def_struct_primitive( p_setShowInterior, patch, "setShowInterior");
def_struct_primitive( p_getShowInterior, patch, "getShowInterior");
def_struct_primitive( p_setAdaptive, patch, "setAdaptive");
def_struct_primitive( p_getAdaptive, patch, "getAdaptive");
def_struct_primitive( p_getEdges, patch, "getEdges");
def_struct_primitive( p_getPatches, patch, "getPatches");
def_struct_primitive( p_getVectors, patch, "getVectors");
def_struct_primitive( p_transform, patch, "transform");
def_struct_primitive( p_weldVerts, patch, "weldVerts");
def_struct_primitive( p_weldEdges, patch, "weldEdges");
def_struct_primitive( p_weld2Verts, patch, "weld2Verts");
def_struct_primitive( p_deletePatchParts, patch, "deletePatchParts");
def_struct_primitive( p_clonePatchParts, patch, "clonePatchParts");
def_struct_primitive( p_subdivideEdges, patch, "subdivideEdges");
def_struct_primitive( p_subdividePatches, patch, "subdividePatches");
def_struct_primitive( p_addQuadPatch, patch, "addQuadPatch");
def_struct_primitive( p_addTriPatch, patch, "addTriPatch");
def_struct_primitive( p_patchNormal, patch, "patchNormal");
def_struct_primitive( p_updatePatchNormals, patch, "updatePatchNormals");
def_struct_primitive( p_edgeNormal, patch, "edgeNormal");
def_struct_primitive( p_flipPatchNormal, patch, "flipPatchNormal");
def_struct_primitive( p_unifyNormals, patch, "unifyNormals");
def_struct_primitive( p_changeVertType, patch, "changeVertType");
def_struct_primitive( p_getVertType, patch, "getVertType");
def_struct_primitive( p_changePatchInteriorType,patch, "changePatchInteriorType");
def_struct_primitive( p_getPatchInteriorType, patch, "getPatchInteriorType");
def_struct_primitive( p_getMesh, patch, "getMesh");
def_struct_primitive( p_autoSmooth, patch, "autoSmooth");
def_struct_primitive( p_makeQuadPatch, patch, "makeQuadPatch");
def_struct_primitive( p_makeTriPatch, patch, "makeTriPatch");
def_struct_primitive( p_interpTriPatch, patch, "interpTriPatch");
def_struct_primitive( p_interpQuadPatch, patch, "interpQuadPatch");
def_struct_primitive( p_addHook, patch, "addHook");
def_struct_primitive( p_removeHook, patch, "removeHook");
def_struct_primitive( p_updateHooks, patch, "updateHooks");
def_struct_primitive( p_hookFixTopology, patch, "hookFixTopology");
def_struct_primitive( p_getPatchType, patch, "getPatchType");
#endif // NO_PATCHES
// xrefs
def_struct_primitive( update_changed_xrefs, xrefs, "updateChangedXRefs");
def_struct_primitive( get_xref_file, xrefs, "getXRefFile");
def_struct_primitive( get_xref_file_count, xrefs, "getXRefFileCount");
def_struct_primitive( add_xref_file, xrefs, "addNewXRefFile");
def_struct_primitive( delete_all_xrefs, xrefs, "deleteAllXRefs");
def_struct_primitive( find_unresolved_xrefs, xrefs, "findUnresolvedXRefs");
def_struct_primitive( attempt_unresolved_xrefs, xrefs, "attemptUnresolvedXRefs");
def_struct_primitive( add_xref_object, xrefs, "addNewXRefObject");

View File

@ -0,0 +1,13 @@
/*
* noteTrack_protocol.h - protocol for MAX note tracks
*
*
*/
def_visible_generic ( sortNoteKeys, "sortNoteKeys" );
def_visible_generic ( addNewNoteKey, "addNewNoteKey" );
def_visible_generic ( deleteNoteKeys, "deleteNoteKeys" );
def_visible_generic ( deleteNoteKey, "deleteNoteKey" );
def_visible_generic ( getNoteKeyTime, "getNoteKeyTime" );
def_visible_generic ( getNoteKeyIndex, "getNoteKeyIndex" );

View File

@ -0,0 +1,115 @@
/* Numbers.h - the number family of classes - numbers for MAXScript
*
* Copyright (c) John Wainwright, 1996
*
*
*/
#ifndef _H_NUMBER
#define _H_NUMBER
#include "MSTime.h"
#define FLOAT_CACHE_SIZE 1024 // must be power of 2
#define INT_CACHE_SIZE 512 // " " "
#define LOW_INT_RANGE 100
class Float;
class Integer;
extern Float* float_cache[];
extern Integer* int_cache[];
visible_class (Number)
class Number : public Value
{
public:
# define is_number(o) ((o)->tag == class_tag(Float) || (o)->tag == class_tag(Integer))
classof_methods (Number, Value);
static Value* read(TCHAR* str, bool heapAlloc = false);
static void setup();
#include "defimpfn.h"
def_generic( coerce, "coerce");
def_generic( copy, "copy");
};
applyable_class (Float)
applyable_class (Integer) // forward decls for float class
#define is_integer(o) ((o)->tag == class_tag(Integer))
class Float : public Number
{
public:
float value;
ENABLE_STACK_ALLOCATE(Float);
Float() { }
ScripterExport Float(float init_val);
static ScripterExport Value* intern(float init_val) { return new Float (init_val); } // hey!! no longer interns, stack alloc'd instead
static ScripterExport Value* heap_intern(float init_val);
classof_methods (Float, Number);
# define is_float(o) ((o)->tag == class_tag(Float))
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
/* include all the protocol declarations */
#include "defimpfn.h"
# include "mathpro.h"
float to_float() { return value; }
int to_int() { return (int)value; }
TimeValue to_timevalue() { return (TimeValue)(value * GetTicksPerFrame()); } // numbers used as times are in frames
void to_fpvalue(FPValue& v) { v.f = to_float(); v.type = (ParamType2)TYPE_FLOAT; }
Value* widen_to(Value* arg, Value** arg_list);
BOOL comparable(Value* arg) { return (is_integer(arg) || is_float(arg) || is_time(arg)); }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
class Integer : public Number
{
public:
int value;
ENABLE_STACK_ALLOCATE(Integer);
Integer() { };
ScripterExport Integer(int init_val);
static ScripterExport Value* intern(int init_val) { return new Integer (init_val); } // hey!! no longer interns, stack alloc'd instead
static ScripterExport Value* heap_intern(int init_val);
classof_methods (Integer, Number);
# define is_int(o) ((o)->tag == class_tag(Integer))
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
/* include all the protocol declarations */
#include "defimpfn.h"
# include "mathpro.h"
float to_float() { return (float)value; }
int to_int() { return value; }
TimeValue to_timevalue() { return (TimeValue)(value * GetTicksPerFrame()); } // numbers used as times are in frames
void to_fpvalue(FPValue& v) { v.i = to_int(); v.type = (ParamType2)TYPE_INT; }
Value* widen_to(Value* arg, Value** arg_list);
BOOL comparable(Value* arg) { return (is_integer(arg) || is_float(arg) || is_time(arg)); }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
#endif

View File

@ -0,0 +1,103 @@
/*
* nurbspro.h - MAX NURBS protocols
*
* Copyright <20> Autodesk, Inc. 1997
* Author: John Wainwright
*
*/
def_visible_generic ( evalPos, "evalPos" );
def_visible_generic ( evalTangent, "evalTangent" );
// def_visible_generic ( getTrimPoint, "getTrimPoint" );
def_visible_generic ( getKnot, "getKnot" );
def_visible_generic ( setKnot, "setKnot" );
def_visible_generic ( getCV, "getCV" );
def_visible_generic ( setCV, "setCV" );
def_visible_generic ( refine, "refine" );
def_visible_generic ( getPoint, "getPoint" );
def_visible_generic ( setPoint, "setPoint" );
def_visible_generic ( evalUTangent, "evalUTangent" );
def_visible_generic ( evalVTangent, "evalVTangent" );
def_visible_generic ( setTiling, "setTiling" );
def_visible_generic ( getTiling, "getTiling" );
def_visible_generic ( setTilingOffset, "setTilingOffset" );
def_visible_generic ( getTilingOffset, "getTilingOffset" );
def_visible_generic ( setTextureUVs, "setTextureUVs" );
def_visible_generic ( getTextureUVs, "getTextureUVs" );
def_visible_generic ( setGenerateUVs, "setGenerateUVs" );
def_visible_generic ( getGenerateUVs, "getGenerateUVs" );
def_visible_generic ( closeU, "closeU" );
def_visible_generic ( closeV, "closeV" );
def_visible_generic ( getUKnot, "getUKnot" );
def_visible_generic ( getVKnot, "getVKnot" );
def_visible_generic ( setUKnot, "setUKnot" );
def_visible_generic ( setVKnot, "setVKnot" );
def_visible_generic ( refineU, "refineU" );
def_visible_generic ( refineV, "refineV" );
def_visible_generic ( appendCurve, "appendCurve" );
def_visible_generic ( appendCurveByID, "appendCurveByID" );
def_visible_generic ( getCurve, "getCurve" );
def_visible_generic ( setCurve, "setCurve" );
def_visible_generic ( getCurveID, "getCurveID" );
def_visible_generic ( setCurveByID, "setCurveByID" );
def_visible_generic ( getFlip, "getFlip" );
def_visible_generic ( setFlip, "setFlip" );
def_visible_generic ( getObject, "getObject" );
def_visible_generic ( setObject, "setObject" );
def_visible_generic ( appendObject, "appendObject" );
def_visible_generic ( removeObject, "removeObject" );
def_visible_generic ( deleteObjects, "deleteObjects" );
def_visible_generic ( reparameterize, "reparameterize" );
def_visible_generic ( getParent, "getParent" );
def_visible_generic ( getParentID, "getParentID" );
def_visible_generic ( setParent, "setParent" );
def_visible_generic ( setParentID, "setParentID" );
def_visible_generic ( getEdge, "getEdge" );
def_visible_generic ( setEdge, "setEdge" );
def_visible_generic ( appendUCurve, "appendUCurve" );
def_visible_generic ( appendUCurveByID, "appendUCurveByID" );
def_visible_generic ( getUCurve, "getUCurve" );
def_visible_generic ( getUCurveID, "getUCurveID" );
def_visible_generic ( setUCurve, "setUCurve" );
def_visible_generic ( setUCurveByID, "setUCurveByID" );
def_visible_generic ( appendVCurve, "appendVCurve" );
def_visible_generic ( appendVCurveByID, "appendVCurveByID" );
def_visible_generic ( getVCurve, "getVCurve" );
def_visible_generic ( getVCurveID, "getVCurveID" );
def_visible_generic ( setVCurve, "setVCurve" );
def_visible_generic ( setVCurveByID, "setVCurveByID" );
def_visible_generic ( disconnect, "disconnect" );
def_visible_generic ( setSeed, "setSeed" );
def_visible_generic ( getSeed, "getSeed" );
def_visible_generic ( getRadius, "getRadius" );
def_visible_generic ( setRadius, "setRadius" );
def_visible_generic ( getTrimSurface, "getTrimSurface" );
def_visible_generic ( setTrimSurface, "setTrimSurface" );
def_visible_generic ( getFlipTrim, "getFlipTrim" );
def_visible_generic ( setFlipTrim, "setFlipTrim" );
def_visible_generic ( setTextureSurface, "setTextureSurface" );
def_visible_generic ( getTextureSurface, "getTextureSurface" );
def_visible_generic ( getProdTess, "getProdTess" );
def_visible_generic ( setProdTess, "setProdTess" );
def_visible_generic ( getViewTess, "getViewTess" );
def_visible_generic ( setViewTess, "setViewTess" );
def_visible_generic ( clearViewTess, "clearViewTess" );
def_visible_generic ( clearProdTess, "clearProdTess" );
def_visible_generic ( setCurveStartPoint, "setCurveStartPoint" );
def_visible_generic ( getCurveStartPoint, "getCurveStartPoint" );
def_visible_primitive ( NURBSLatheSurface, "MakeNURBSLatheSurface" );
def_visible_primitive ( NURBSSphereSurface, "MakeNURBSSphereSurface" );
def_visible_primitive ( NURBSCylinderSurface, "MakeNURBSCylinderSurface" );
def_visible_primitive ( NURBSConeSurface, "MakeNURBSConeSurface" );
def_visible_primitive ( NURBSTorusSurface, "MakeNURBSTorusSurface" );
def_visible_primitive ( NURBSNode, "NURBSNode" );
def_visible_primitive ( NURBSLatheNode, "NURBSLatheNode" );
def_visible_primitive ( NURBSExtrudeNode, "NURBSExtrudeNode" );
def_visible_primitive ( updateSurfaceMapper, "updateSurfaceMapper" );

View File

@ -0,0 +1,73 @@
/*
* NurbsSub.h - Nurbs sub-object classes & functions
*
* mirrors the mesh sub-object selection classes for NURBS sub-objects.
*
* Copyright <20> Autodesk, Inc., 1998
* John Wainwright
*/
#ifndef _H_NURBSSUB
#define _H_NURBSSUB
// Nurbs selection types
#define NSEL_ALL 1 // whole Nurbs selected
#define NSEL_CUR 2 // current selection
#define NSEL_EXP 3 // explicit selection (in vsel)
#define NSEL_SINGLE 4 // explicit single index
/* -------------- base class for Nurbs sub-object selections ------------------- */
visible_class (NURBSSelection)
class NURBSSelection : public Value
{
public:
MAXNode* owner; // owner node if any
Object* obj; // NURBS base obj if any
NURBSSubObjectLevel level; // subobject level of this selection
BYTE sel_type; // selection type
BitArray vsel; // stand-alone selection if any or copy of current owner level selection
DWORD index; // single vert index
ScripterExport NURBSSelection(MAXNode* own, NURBSSubObjectLevel lvl, BYTE stype, DWORD indx = 0);
classof_methods (NURBSSelection, Value);
# define is_NURBSSelection(v) ((v)->tag == class_tag(NURBSSelection))
void collect() { delete this; }
void gc_trace();
ScripterExport void sprin1(CharStream* s);
// utility functions
BitArray* get_sel(); // my element selection
void get_owner_sel(BitArray& osel); // owner's element selection
int num_elements();
BOOL is_same_selection(Value* s) { return is_NURBSSelection(s) && ((NURBSSelection*)s)->level == level; }
void setup_xform(BitArray& os, BOOL& local_org, Matrix3& axis);
DWORD get_sel_index(BitArray* vs, int n); // index for n'th item vertex in BitArray
void update_sel();
void sprin1(TCHAR* type, CharStream* s);
// operations
#include "defimpfn.h"
# include "arraypro.h"
def_generic ( move, "move");
def_generic ( scale, "scale");
def_generic ( rotate, "rotate");
def_generic ( delete, "delete");
def_generic ( select, "select");
def_generic ( deselect, "deselect");
def_generic ( selectmore, "selectMore");
ScripterExport Value* map(node_map& m);
// built-in property accessors
def_property ( count );
def_property ( index );
def_property ( selSetNames );
def_property ( pos );
};
#endif

View File

@ -0,0 +1,16 @@
/*
* MAX_node_protocol.h - def_generics for the operations on MAX node objects
*
* see def_abstract_generics.h for more info.
*
*
* Copyright <20> John Wainwright 1996
*
*/
def_visible_generic(create, "create");
def_visible_generic(move, "move");
def_visible_generic(scale, "scale");
def_visible_generic(rotate, "rotate");

View File

@ -0,0 +1,87 @@
/*
* ObjectSets.h - ObjectSet classes for MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_OBJECTSET
#define _H_OBJECTSET
#include "Collect.h"
visible_class (Set)
class Set : public Value, public Collection
{
public:
classof_methods (Set, Value);
BOOL _is_collection() { return 1; }
#include "defimpfn.h"
def_generic (coerce, "coerce");
};
#include "PathName.h"
visible_class_s (ObjectSet, Set)
class ObjectSet : public Set
{
protected:
ObjectSet() { }
public:
TCHAR* set_name;
BOOL (*selector)(INode* node, int level, void* arg); // set selector function
void* selector_arg; // selector fn argument
ObjectSet(TCHAR* name, SClass_ID class_id);
ObjectSet(TCHAR* init_name, BOOL (*sel_fn)(INode*, int, void*), void* init_arg = NULL);
void init(TCHAR* name);
classof_methods (ObjectSet, Set);
static void setup();
TCHAR* name() { return set_name; }
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("$%s"), set_name); }
void export_to_scripter();
ScripterExport Value* map(node_map& m);
ScripterExport Value* map_path(PathName* path, node_map& m);
ScripterExport Value* find_first(BOOL (*test_fn)(INode* node, int level, void* arg), void* test_arg);
ScripterExport Value* get_path(PathName* path);
#include "defimpfn.h"
def_generic (get, "get"); // indexed get (no put or append)
def_property ( count );
def_property ( center );
def_property ( min );
def_property ( max );
};
class CurSelObjectSet : public ObjectSet
{
public:
CurSelObjectSet(TCHAR* name);
void collect() { delete this; }
ScripterExport Value* map(node_map& m);
#include "defimpfn.h"
def_generic (get, "get"); // indexed get (no put or append)
def_generic (coerce, "coerce");
def_property ( count );
};
extern ObjectSet all_objects;
extern ObjectSet all_geometry;
extern ObjectSet all_lights;
extern ObjectSet all_cameras;
extern ObjectSet all_helpers;
extern ObjectSet all_shapes;
extern ObjectSet all_systems;
extern ObjectSet all_spacewarps;
extern CurSelObjectSet current_selection;
#endif

View File

@ -0,0 +1,119 @@
/*
* OLEAutomation.h - OLE Automation services for MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_MAX_OLE_AUTOMATION
#define _H_MAX_OLE_AUTOMATION
#include "Arrays.h"
#include "classIDs.h"
#include "Funcs.h"
/* error scodes */
#define MS_E_EXCEPTION MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x0200)
#define MS_E_ILLEGAL_RETURN_VALUE MS_E_EXCEPTION + 0x001
/* ------- the MAXScript OLE object class factory ---------- */
class MSClassFactory : public IClassFactory
{
public:
static IClassFactory* Create();
/* IUnknown methods */
STDMETHOD(QueryInterface)(REFIID iid, void** ppv);
STDMETHOD_(unsigned long, AddRef)(void);
STDMETHOD_(unsigned long, Release)(void);
/* IClassFactory methods */
STDMETHOD(CreateInstance)(IUnknown* pUnkOuter, REFIID iid, void** ppv);
STDMETHOD(LockServer)(BOOL fLock);
private:
MSClassFactory();
unsigned long m_refs;
};
/* ---------- the MAXScript OLE object class -------------- */
class MSOLEObject : public IDispatch
{
public:
static MSOLEObject* Create();
/* IUnknown methods */
STDMETHOD(QueryInterface)(REFIID riid, void** ppvObj);
STDMETHOD_(unsigned long, AddRef)(void);
STDMETHOD_(unsigned long, Release)(void);
/* IDispatch methods */
STDMETHOD(GetTypeInfoCount)(unsigned int* pcTypeInfo);
STDMETHOD(GetTypeInfo)(unsigned int iTypeInfo, LCID lcid, ITypeInfo** ppTypeInfo);
STDMETHOD(GetIDsOfNames)(REFIID riid, OLECHAR** rgszNames, unsigned int cNames, LCID lcid, DISPID* rgdispid);
STDMETHOD(Invoke)(DISPID dispidMember, REFIID riid, LCID lcid, unsigned short wFlags,
DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, unsigned int* puArgErr);
/* MSOLEObject stuff */
unsigned long m_refs;
static Array* exposed_fns; // array of exposed MAXScript functions, DISPID is 1-based index in array
MSOLEObject();
static void install_fns(Array* fns);
};
/* ---------------- client-side classes -------------------- */
visible_class (OLEObject)
class OLEObject : public Value
{
public:
Value* progID; // user-supplied progID string
CLSID clsid; // CLSID of ActiveX object.
LPDISPATCH pdisp; // IDispatch of ActiveX object.
OLEObject(Value* progID, CLSID cslid, LPDISPATCH pdisp);
OLEObject(Value* progID, LPDISPATCH pdisp);
~OLEObject();
classof_methods (OLEObject, Value);
void collect() { delete this; }
void gc_trace();
ScripterExport void sprin1(CharStream* s);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
Value* get_fn_property(Value* prop);
};
visible_class (OLEMethod)
class OLEMethod : public Function
{
public:
OLEObject* ole_obj; // my OLE object
DISPID dispid; // method dispatch ID
OLEMethod() { }
OLEMethod(TCHAR* name, OLEObject* ole_obj, DISPID mth_id);
classof_methods (OLEMethod, Function);
void collect() { delete this; }
void gc_trace();
Value* apply(Value** arglist, int count, CallContext* cc=NULL);
};
BOOL init_MAXScript_OLE();
void uninit_OLE();
#define UNUSED(X) (X)
#endif

View File

@ -0,0 +1,228 @@
/*
* Parser.h - a compiler for the 3DS MAX MAXScript scripting language
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_PARSER
#define _H_PARSER
#include "Strings.h"
#include "HashTab.h"
#include "Name.h"
#include "Rollouts.h"
#include "imacroscript.h"
#define MAX_TOKEN_SIZE 256
#define UNDEFINED_MACRO -1
extern ScripterExport HashTable* globals;
class MSPluginClass;
class CodeBlock;
class MouseTool;
class RCMenu;
class IVisualMSForm;
class MSCustAttribDef;
/* tokens ... */
enum lex_token
{
t_local, t_global, t_fn, t_mapped,
t_if, t_then, t_else, t_do, t_collect, t_while, t_case,
t_open_paren, t_close_paren, t_plus, t_times, t_minus, t_div, t_power, t_end,
t_pluseq, t_minuseq, t_timeseq, t_diveq,
t_and, t_or, t_not,
t_number, t_string, t_assign, t_semicolon, t_bad,
t_badNum, t_eol, t_comma, t_open_bracket, t_close_bracket, t_colon,
t_quote, t_doubleQuote, t_ampersand, t_name, t_dot, t_name_literal,
t_openCurly, t_closeCurly, t_hash, t_eq, t_ne, t_lt, t_gt,
t_ge, t_le, t_for, t_in, t_from, t_to, t_by, t_of, t_where,
t_as, t_parameter_keyword, t_path_name,
t_query, t_slash, t_ellipsis, t_level_name, t_wild_card_name,
t_dot_dot, t_end_of_path,
t_with, t_animate, t_coordsys, t_set, t_undo,
t_about, t_at, t_on, t_off,
t_max, t_nullary_call, t_utility, t_rollout,
t_return, t_exit, t_when, t_continue,
t_struct, t_try, t_catch, t_throw, t_eos,
t_plugin, t_tool, t_persistent, t_parameters, t_rcmenu,
t_macroScript, t_dropScript, t_attributes,
t_missing // always last
};
typedef RolloutControl* (*create_fn)(Value* name, Value* caption, Value** keyparms, int keyparm_count);
typedef struct
{
Value* name;
create_fn creator;
} rollout_control;
extern ScripterExport void install_rollout_control(Value* name, create_fn creator);
class Parser : public Value
{
public:
ScripterExport Parser();
ScripterExport Parser(CharStream* errout);
ScripterExport Parser(HashTable* scope);
ScripterExport Parser(CharStream* errout, HashTable* scope);
void init();
ScripterExport Value* compile(CharStream* stream);
ScripterExport Value* compile_factor(CharStream* stream);
ScripterExport Value* compile_all(CharStream* stream);
static void setup();
static Tab<rollout_control> rollout_controls;
static TCHAR *token_names[];
void collect() { delete this; }
void gc_trace();
CharStream* source; // input stream
lex_token token; // parser's current lexical token
Value* token_value; // and value
BOOL at_EOL; // positioned at \r
BOOL back_tracked; // we back-tracked
BOOL EOL_at_back_track; // remember EOL state at back_track
BOOL quoted_level_name; // if path level name was quote
BOOL spaced; // if space after token
BOOL space_before; // if '-' had a space before
BOOL space_after; // if '-' had a space after
BOOL throws_ok; // indicates if empty throws are OK (only in catches)
BOOL in_rollout; // compiling rollout, no new locals by default
BOOL in_macroscript; // compiling macroscript, disallow macroscript nesting
HashTable* current_scope; // current lexical scope hashtable
int parm_count; // current function def params
int keyparm_count; // " " " keyword parms
int local_count; // " " " locals
int frame_index; // running fn frame index for locals,args
int frame_level; // running frame level
int expr_level; // running nested expression level
CharStream* stdout_stream; // message & debug output stream (usually listener's window)
Value* lookahead_factor; // store for factor lookahead
TCHAR line_buf[256]; // current line capture for error printing
TCHAR* line_buf_p; // " " " pointer
CharStream* source_capture; // non-null, capture source to this stream
int ungetch_count;
Tab<CharStream*> src_stack; // include source stack
BOOL no_free_refs; // if on, disallow free refs
int tok_start; // store stream seek pos of token start
int last_tok_end; // store stream seek pos of end of last token
CodeBlock* code_block; // top-level code block if any
int code_block_level; // expr level for code block, used to provide context for 'on handler' parsing
bool dotted_names_ok; // allows '.' as part of a name (for event handler name parsing)
bool ignore_string_escapes; // ignores '\' escapes in string literals
bool mzp_names; // used by .mzp parser, allows . \ $ * in names
int current_y, bottom_y, group_num; // used by VMS form editor construction code
Value* single_expr(Value* stream);
Value* single_factor(Value* stream);
Value* compound_expr(Value* stream);
Value* compile_macro_script(Value* stream, MacroID id);
bool parse_rollout_for_edit(CharStream* source_stream, IVisualMSForm* form, Value* filename=NULL);
Value* compile_attributes(MSCustAttribDef* cad, CharStream* stream, Class_ID* attribID = NULL);
/* lexical analysis methods */
int token_must_be(lex_token wanted_token);
int next_token_must_be(lex_token wanted_token);
int next_token_must_be_name(Value* wanted_name);
void back_track(void);
void back_track_factor(Value* fac);
int white_space(TCHAR& c);
void check_for_EOL(TCHAR c);
void flush_EO_expr(void);
void reset();
TCHAR get_char();
void unget_char(TCHAR c);
void flush_to_eobuf();
Value* get_string(TCHAR delim);
Value* get_path_name();
Value* get_name_thunk(Value* name, BOOL make_new);
lex_token get_punct(TCHAR c);
lex_token get_token(void);
lex_token get_path_token(void);
int get_max_command(Value*& code);
void add_event_handler(HashTable* handlers, BOOL item_based = TRUE, IVisualMSForm* form = NULL);
void add_tool_local(TCHAR* var, MouseTool* tool, int& local_count, Value**& local_inits);
void add_plugin_local(TCHAR* var, MSPluginClass* plugin, int& local_count, Value**& local_inits, BOOL constant = FALSE);
Value** add_rollout_control(Value** controls, int control_index, Rollout* rollout, IVisualMSForm* form = NULL);
Value** add_rcmenu_item(Value** items, int& item_count, RCMenu* menu, BOOL subMenu = FALSE);
void open_include_file(TCHAR c);
void check_for_const_lvalue(Value*& lval);
Value* optimize_return(Value* expr);
/* recursive descent parse methods */
Value* expr_seq(lex_token delimiter);
Value* vector_literal();
Value* index_or_vector();
Value* hash_literals();
Value* array_literal();
Value* bit_array_literal();
Value* factor();
// Value* property_access();
// Value* array_index();
Value* property_index_array();
Value* coercion();
Value* deref_expr();
Value* function_call();
Value* power_expr();
Value* uminus_expr();
Value* term();
Value* plus_expr();
Value* compare_expr();
Value* not_expr();
Value* and_expr();
Value* simple_expr();
Value* variable_declaration();
Value* context_expr();
Value* change_handler();
Value* function(TCHAR* name, short flags = 0);
Value* function_def();
Value* mapped_fn_def();
Value* max_command();
Value* handler_def();
Value* struct_body(Value* name);
Value* struct_def();
Value* try_catch();
Value* tool_body(Value* name);
Value* tool_def();
Value* rcmenu_body(Value* name);
Value* rcmenu_def();
void plugin_paramblock(MSPluginClass* plugin, Array* pblock_defs, HashTable* handlers, int base_refno);
Value* plugin_def();
Value* attributes_body(MSCustAttribDef* cad);
Value* attributes_def(MSCustAttribDef* cad = NULL, Class_ID* attribID = NULL);
Value* macro_script(MacroID mid = UNDEFINED_MACRO);
Value* rollout_body(Value* name, lex_token type = t_rollout, IVisualMSForm* form = NULL);
Value* utility_def();
Value* rollout_def();
Value* exit_expr();
Value* continue_expr();
Value* return_expr();
Value* for_expr();
Value* do_expr();
Value* while_expr();
Value* case_expr();
Value* if_expr();
Value* assign_expr();
Value* expr();
Value* top_level_expr();
};
typedef struct
{
TCHAR* name;
getter_vf getter;
setter_vf setter;
} property_accessors;
extern property_accessors* get_property_accessors(Value* prop);
extern TCHAR* command_name_from_code(int com);
#define token_name(tok) token_names[(int)tok]
#endif

View File

@ -0,0 +1,67 @@
/*
* PathName.h - PathName class for MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_PATHNAME
#define _H_PATHNAME
#include "Collect.h"
#include "Thunks.h"
#include "ObjSets.h"
enum path_flags { rooted_path = 1, wild_card_path = 2 };
visible_class (PathName)
class PathName : public Set
{
public:
int flags;
short n_levels;
TCHAR** path_levels;
Thunk* root_set_thunk;
Value* root_set;
PathName();
~PathName();
classof_methods (PathName, Set);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
ScripterExport Value* eval();
void append(TCHAR* level_name);
Value* find_object(TCHAR* name);
Value* get_object();
ScripterExport Value* map(node_map& m);
#include "defimpfn.h"
def_generic (get, "get"); // indexed get (no put or append)
def_property ( count );
def_property ( center );
def_property ( min );
def_property ( max );
};
extern TCHAR* ellipsis_level_name;
extern TCHAR* parent_level_name;
// Added: 12/17/03
// This class provides an interface to a derived implementation class that caches scene node names
// based on the node name resolution scheme used by MAXScript. There is a single, static instance
// of the derived class.
// usage: SceneNodeByNameCache::GetInst().GetSceneNodeByName(theName,true,false);
class SceneNodeByNameCache
{
public:
// get the singleton instance of SceneNodeByNameCache
ScripterExport static SceneNodeByNameCache& GetInst();
// get the INode* given the name. If exactMatch is false, use inexact (MXS) name matching. Can return NULL
ScripterExport virtual INode *GetSceneNodeByName(const TCHAR* name, bool exactMatch = false, bool caseSensitive = false) = 0;
};
#endif

View File

@ -0,0 +1,5 @@
// Protocols for Physique Blended Vertex Interface classes
def_visible_generic(GetNode, "GetNode");
def_visible_generic(GetOffsetVector, "GetOffsetVector");
def_visible_generic(GetWeight, "GetWeight");

View File

@ -0,0 +1,5 @@
// Protocols for Physique Mod Context Vertex Interface classes
def_visible_generic(ConvertToRigid, "ConvertToRigid");
def_visible_generic(AllowBlending, "AllowBlending");
def_visible_generic(GetVertexInterface, "GetVertexInterface");

View File

@ -0,0 +1,5 @@
// Protocols for Physique Rigid Vertex Interface classes
def_visible_generic(GetNode, "GetNode");
def_visible_generic(GetOffsetVector, "GetOffsetVector");

View File

@ -0,0 +1,92 @@
/*
* Pipe.h - NT TCHAR Pipe wrapper for MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_PIPE
#define _H_PIPE
#include "Strings.h"
class FileStream;
#define PIPE_BUF_SIZE 512
// The undelivered data in the pipe is held in a linked list of
// buffers, pointed into by read and write cursors.
// A side list is kept if writers supply info about sourcing files.
// This is provided to readers like the compiler to add source
// tags to generated code.
typedef struct src_info src_info;
struct src_info
{
src_info* next; // next marker
TCHAR* start; // source start character in buffer chain
Value* file; // sourcing file name if any
int offset; // starting offset into source
};
class Pipe : public CharStream
{
public:
TCHAR* write_buffer; // pipe buffers & cursors
TCHAR* write_cursor;
TCHAR* read_buffer;
TCHAR* read_cursor;
int ungetch_count;
CRITICAL_SECTION pipe_update; // for syncing pipe updates
HANDLE pipe_event; // for signalling data ready
HANDLE restart_event; // used to restart a stopped pipe
BOOL waiting; // reader is waiting for data
BOOL stopped; // pipe reading is blocked
FileStream* log; // log stream if non-NULL
Value* read_source_file; // sourcing file for reading if supplied by writer
int read_source_offset; // running reader offset in source
src_info* markers; // marker list...
src_info* marker_tail;
TCHAR* next_source_start; // upcoming marker starting character
Value* write_source_file; // current write source file, used to determine source change
int write_source_offset;// running writer offset
Pipe();
~Pipe();
# define is_pipe(o) ((o)->tag == INTERNAL_PIPE_TAG)
void collect() { delete this; }
void gc_trace();
TCHAR get_char();
void unget_char(TCHAR c);
TCHAR peek_char();
int at_eos();
int pos() { return read_source_offset; }
void rewind();
void flush_to_eol();
void flush_to_eobuf();
void put_char(TCHAR c, Value* source_file = NULL, int offset = 0);
void put_str(TCHAR* str, Value* source_file = NULL, int offset = 0);
void put_buf(TCHAR* str, size_t count, Value* source_file = NULL, int offset = 0);
void new_write_buffer();
void check_write_source_change(Value* file, int offset, int new_len);
void read_source_change();
void clear_source();
void stop();
void go();
TCHAR* puts(TCHAR* str);
int printf(const TCHAR *format, ...);
void log_to(FileStream* log);
void close_log();
CharStream* get_log() { return log; }
Value* get_file_name();
};
#endif

View File

@ -0,0 +1,465 @@
/*
* primitives.h - primitive function defs for MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
#include "buildver.h"
/* scripter-visible primitives */
/* user input */
def_visible_primitive( pick_object, "pickObject");
def_visible_primitive( pick_point, "pickPoint");
def_visible_primitive( get_kb_value, "getKBValue");
def_visible_primitive( get_kb_point, "getKBPoint");
def_visible_primitive( get_kb_line, "getKBLine");
def_visible_primitive( get_kb_char, "getKBChar");
def_visible_primitive( redraw_views, "redrawViews");
def_visible_primitive( pick_offset_distance, "pickOffsetDistance");
def_visible_primitive( clear_listener, "clearListener");
def_visible_primitive( get_listener_sel, "getListenerSel");
def_visible_primitive( set_listener_sel, "setListenerSel");
def_visible_primitive( get_listener_sel_text, "getListenerSelText");
def_visible_primitive( set_listener_sel_text, "setListenerSelText");
/* command-line debugger */
def_visible_primitive( dbg_break, "break");
def_visible_primitive( show_stack, "stack");
def_visible_primitive( show_locals, "locals");
def_visible_primitive( dbg_go, "go");
/* max file I/O */
def_visible_primitive( load_max_file, "loadMaxFile");
def_visible_primitive( merge_max_file, "mergeMaxFile");
def_visible_primitive( get_max_file_object_names, "getMAXFileObjectNames");
def_visible_primitive( save_max_file, "saveMaxFile");
def_visible_primitive( save_nodes, "saveNodes");
def_visible_primitive( reset_max_file, "resetMaxFile");
def_visible_primitive( hold_max_file, "holdMaxFile");
def_visible_primitive( fetch_max_file, "fetchMaxFile");
def_visible_primitive( import_file, "importFile");
def_visible_primitive( export_file, "exportFile");
#ifdef DESIGN_VER
def_visible_primitive( link_file, "linkFile");
#endif
def_visible_primitive( load_material_library, "loadMaterialLibrary");
#ifndef NO_MATLIB_SAVING // orb 01-09-2002
#ifndef USE_CUSTOM_MATNAV // orb 08-23-2001 removing mtl lib saving from maxscript
def_visible_primitive( save_material_library, "saveMaterialLibrary");
#endif
#endif
def_visible_primitive( get_medit_material, "getMeditMaterial");
def_visible_primitive( set_medit_material, "setMeditMaterial");
def_visible_primitive( quit_max, "quitMax");
/* max animation */
def_visible_primitive( play_animation, "playAnimation");
def_visible_primitive( stop_animation, "stopAnimation");
/* text file I/O */
def_visible_primitive( open_file, "openfile");
def_visible_primitive( create_file, "createfile");
def_visible_primitive( open_encrypted, "openEncryptedFile");
def_visible_primitive( file_in, "filein");
def_visible_primitive( format, "format");
def_visible_primitive( open_log, "openlog");
def_visible_primitive( close_log, "closelog");
def_visible_primitive( flush_log, "flushlog");
def_visible_primitive( get_open_filename, "getOpenFileName");
def_visible_primitive( get_save_filename, "getSaveFileName");
def_visible_primitive( get_save_path, "getSavePath");
def_visible_primitive( filename_from_path, "filenameFromPath");
def_visible_primitive( get_files, "getFiles");
def_visible_primitive( get_directories, "getDirectories");
def_visible_primitive( delete_file, "deleteFile");
def_visible_primitive( rename_file, "renameFile");
def_visible_primitive( copy_file, "copyFile");
def_visible_primitive( make_dir, "makeDir");
def_visible_primitive( get_filename_path, "getFilenamePath");
def_visible_primitive( get_filename_file, "getFilenameFile");
def_visible_primitive( get_filename_type, "getFilenameType");
def_visible_primitive( get_file_mod_date, "getFileModDate");
def_visible_primitive( get_file_create_date,"getFileCreateDate");
def_visible_primitive( get_file_attribute, "getFileAttribute");
def_visible_primitive( set_file_attribute, "setFileAttribute");
def_visible_primitive( edit_script, "edit");
def_visible_primitive( new_script, "newScript");
/* rendering */
def_visible_primitive( render, "render");
/* noise functions */
def_visible_primitive( noise3, "noise3");
def_visible_primitive( noise4, "noise4");
def_visible_primitive( turbulence, "turbulence");
def_visible_primitive( fractalNoise, "fractalNoise");
#ifndef NO_ATMOSPHERICS // russom - 04/11/02
/* atmospherics */
def_visible_primitive( addAtmospheric, "addAtmospheric");
def_visible_primitive( setAtmospheric, "setAtmospheric");
def_visible_primitive( getAtmospheric, "getAtmospheric");
def_visible_primitive( deleteAtmospheric, "deleteAtmospheric");
def_visible_primitive( editAtmospheric, "editAtmospheric"); // RK: Added this
#endif // NO_ATMOSPHERICS
#ifndef NO_RENDEREFFECTS // russom - 03/26/02
/* effects */ // RK: Added this
def_visible_primitive( addEffect, "addEffect");
def_visible_primitive( setEffect, "setEffect");
def_visible_primitive( getEffect, "getEffect");
def_visible_primitive( deleteEffect, "deleteEffect");
def_visible_primitive( editEffect, "editEffect");
#endif // NO_RENDEREFFECTS
/* trackview nodes */
def_visible_primitive( newTrackViewNode, "newTrackViewNode");
def_visible_primitive( deleteTrackViewNode, "deleteTrackViewNode");
def_visible_primitive( addTrackViewController, "addTrackViewController");
def_visible_primitive( deleteTrackViewController, "deleteTrackViewController");
/* CUI */
#ifndef NO_CUI // russom - 02/12/01
def_struct_primitive( cui_setConfigFile,cui, "setConfigFile");
def_struct_primitive( cui_saveConfig, cui, "saveConfig");
def_struct_primitive( cui_saveConfigAs, cui, "saveConfigAs");
def_struct_primitive( cui_loadConfig, cui, "loadConfig");
def_struct_primitive( cui_getConfigFile,cui, "getConfigFile");
#endif // NO_CUI
def_struct_primitive( cui_getDir, cui, "getDir");
def_struct_primitive( cui_expertModeOn, cui, "expertModeOn");
def_struct_primitive( cui_expertModeOff,cui, "expertModeOff");
def_struct_primitive( cui_getExpertMode,cui, "getExpertMode");
/* macro scripts */
def_struct_primitive( run_macro, macros, "run");
def_struct_primitive( edit_macro, macros, "edit");
def_struct_primitive( new_macro, macros, "new");
def_struct_primitive( load_macros, macros, "load");
def_struct_primitive( list_macros, macros, "list");
/* track view window access */
def_struct_primitive( tvw_open, trackView, "open");
def_struct_primitive( tvw_zoomSelected, trackView, "zoomSelected");
def_struct_primitive( tvw_close, trackView, "close");
def_struct_primitive( tvw_numTrackViews, trackView, "numTrackViews");
def_struct_primitive( tvw_getTrackViewName, trackView, "getTrackViewName");
def_struct_primitive( tvw_setFilter, trackView, "setFilter");
def_struct_primitive( tvw_clearFilter, trackView, "clearFilter");
// LAM 4/1/00 - defined in MXSAgni
// def_struct_primitive( tvw_pickTrackDlg, trackView, "pickTrackDlg");
/* schematic view window access */
#ifndef NO_SCHEMATICVIEW
def_struct_primitive( svw_open, schematicView, "open");
def_struct_primitive( svw_zoomSelected, schematicView, "zoomSelected");
def_struct_primitive( svw_close, schematicView, "close");
def_struct_primitive( svw_numSchematicViews, schematicView, "numSchematicViews");
def_struct_primitive( svw_getSchematicViewName, schematicView, "getSchematicViewName");
#endif // NO_SCHEMATICVIEW
/* asset manager access (should be filled out and moved into asset manager eventually) */
#ifdef WEBVERSION // orb 03-18-2002
def_struct_primitive( ab_open, Browser, "open");
def_struct_primitive( ab_gotoURL, Browser, "gotoURL");
#else
def_struct_primitive( ab_open, assetBrowser, "open");
def_struct_primitive( ab_gotoURL, assetBrowser, "gotoURL");
#endif // WEBVERSION
/* modifier panel control */
def_struct_primitive( modp_setCurrentObject, modPanel, "setCurrentObject");
def_struct_primitive( modp_getCurrentObject, modPanel, "getCurrentObject");
def_struct_primitive( modp_getModifierIndex, modPanel, "getModifierIndex");
def_struct_primitive( modp_addModToSelection, modPanel, "addModToSelection");
def_struct_primitive( modp_validModifier, modPanel, "validModifier");
/* MAX map & xref path config */
def_struct_primitive( mapPaths_add, mapPaths, "add");
def_struct_primitive( mapPaths_count, mapPaths, "count");
def_struct_primitive( mapPaths_get, mapPaths, "get");
def_struct_primitive( mapPaths_delete, mapPaths, "delete");
def_struct_primitive( xrefPaths_add, xrefPaths, "add");
def_struct_primitive( xrefPaths_count, xrefPaths, "count");
def_struct_primitive( xrefPaths_get, xrefPaths, "get");
def_struct_primitive( xrefPaths_delete, xrefPaths, "delete");
def_struct_primitive( sessionPaths_add, sessionPaths, "add");
def_struct_primitive( sessionPaths_count, sessionPaths, "count");
def_struct_primitive( sessionPaths_get, sessionPaths, "get");
def_struct_primitive( sessionPaths_delete, sessionPaths, "delete");
/* references */
def_struct_primitive( refs_dependsOn, refs, "dependsOn");
def_struct_primitive( refs_dependents, refs, "dependents");
/* tool modes */
def_struct_primitive( toolMode_uniformScale, toolMode, "uniformScale");
def_struct_primitive( toolMode_nonUniformScale, toolMode, "nonUniformScale");
def_struct_primitive( toolMode_squashScale, toolMode, "squashScale");
def_struct_primitive( toolMode_coordsys, toolMode, "coordsys");
def_struct_primitive( toolMode_pivotCenter, toolMode, "pivotCenter");
def_struct_primitive( toolMode_selectionCenter, toolMode, "selectionCenter");
def_struct_primitive( toolMode_transformCenter, toolMode, "transformCenter");
/* utils */
def_visible_generic ( show_interfaces, "showInterfaces"); // LAM: 06/29/00
def_visible_generic ( show_interface, "showInterface"); // LAM: 08/29/00
def_visible_primitive( show_class, "showClass");
def_visible_generic ( show_props, "showProperties");
def_visible_generic ( get_props, "getPropNames");
def_visible_primitive( has_prop, "hasProperty");
def_visible_primitive( is_prop, "isProperty");
def_visible_generic ( create_instance, "createInstance");
def_visible_primitive( getproperty, "getProperty");
def_visible_primitive( setproperty, "setProperty");
def_visible_primitive( apropos, "apropos");
def_visible_generic ( exprForMAXObject, "exprForMAXObject");
def_visible_generic ( getSubAnim, "getSubAnim");
def_visible_generic ( getSubAnimName, "getSubAnimName");
def_visible_generic ( getSubAnimNames, "getSubAnimNames");
def_visible_primitive( show_source, "showSource");
def_visible_generic ( getAppData, "getAppData");
def_visible_generic ( setAppData, "setAppData");
def_visible_generic ( deleteAppData, "deleteAppData");
def_visible_generic ( clearAllAppData, "clearAllAppData");
def_visible_generic ( addPluginRollouts, "addPluginRollouts");
def_visible_primitive( startObjectCreation, "startObjectCreation");
def_visible_primitive( isCreatingObject, "isCreatingObject");
// def_visible_primitive( waitForToolStop, "waitForToolStop");
def_visible_generic ( iscompatible, "isCompatible");
def_visible_primitive( progressStart, "progressStart");
def_visible_primitive( progressUpdate, "progressUpdate");
def_visible_primitive( progressEnd, "progressEnd");
def_visible_primitive( getProgressCancel, "getProgressCancel");
def_visible_primitive( setProgressCancel, "setProgressCancel");
def_visible_primitive( dos_command, "DOSCommand");
def_visible_primitive( sleep, "sleep");
def_visible_primitive( timeStamp, "timeStamp");
def_visible_primitive( open_utility, "openUtility");
def_visible_primitive( close_utility, "closeUtility");
def_visible_primitive( add_rollout, "addRollout");
def_visible_primitive( remove_rollout, "removeRollout");
def_visible_primitive( new_rollout_floater, "newRolloutFloater");
def_visible_primitive( close_rollout_floater, "closeRolloutFloater");
def_visible_primitive( message_box, "messageBox");
def_visible_primitive( query_box, "queryBox");
def_visible_primitive( yes_no_cancel_box, "yesNoCancelBox");
def_visible_primitive( set_open_scene_script, "setOpenSceneScript");
def_visible_primitive( set_save_scene_script, "setSaveSceneScript");
def_struct_primitive ( callbacks_addScript, callbacks, "addScript");
def_struct_primitive ( callbacks_removeScript, callbacks, "removeScripts");
def_struct_primitive ( callbacks_broadcastCallback, callbacks, "broadcastCallback");
def_struct_primitive ( callbacks_show, callbacks, "show");
def_struct_primitive ( callbacks_notificationParam, callbacks, "notificationParam");
def_struct_primitive ( pesistents_remove, persistents, "remove");
def_struct_primitive ( pesistents_removeAll, persistents, "removeAll");
def_struct_primitive ( pesistents_show, persistents, "show");
def_visible_primitive( gc, "gc");
def_visible_primitive( freeSceneBitmaps, "freeSceneBitmaps");
def_visible_primitive( enumerateFiles, "enumerateFiles");
def_visible_primitive( setSaveRequired, "setSaveRequired");
def_visible_primitive( getSaveRequired, "getSaveRequired");
def_visible_primitive( clearUndoBuffer, "clearUndoBuffer");
def_visible_primitive( getCurrentSelection, "getCurrentSelection");
def_visible_primitive( selectByName, "selectByName");
def_primitive ( getDollarSel, "getDollarSel");
def_primitive ( getCurrentScriptCtrl, "getCurrentScriptCtrl");
def_visible_primitive( animateVertex, "animateVertex");
def_visible_primitive( showTextureMap, "showTextureMap");
def_visible_primitive( setWaitCursor, "setWaitCursor");
def_visible_primitive( setArrowCursor, "setArrowCursor");
def_visible_primitive( registerTimeCallback, "registerTimeCallback");
def_visible_primitive( unregisterTimeCallback, "unregisterTimeCallback");
// #ifdef DESIGN_VER
def_struct_primitive ( mtlBrowser_browseFrom, mtlBrowser, "browseFrom");
// #endif
/* active viewport utils */
def_visible_primitive( getActiveCamera, "getActiveCamera");
def_visible_primitive( getScreenScaleFactor, "getScreenScaleFactor");
def_visible_primitive( mapScreenToWorldRay, "mapScreenToWorldRay");
def_visible_primitive( mapScreenToView, "mapScreenToView");
def_visible_primitive( mapScreenToCP, "mapScreenToCP");
def_visible_primitive( getCPTM, "getCPTM");
def_visible_primitive( getViewTM, "getViewTM");
def_visible_primitive( getViewSize, "getViewSize");
def_visible_primitive( getViewFOV, "getViewFOV");
def_visible_primitive( encryptScript, "encryptScript");
def_visible_primitive( encryptFile, "encryptFile");
def_visible_primitive( deleteChangeHandler, "deleteChangeHandler");
def_visible_primitive( deleteAllChangeHandlers, "deleteAllChangeHandlers");
/* morph objects & keys */
def_visible_primitive( getMKTime, "getMKTime");
def_visible_primitive( setMKTime, "setMKTime");
def_visible_primitive( getMKWeight, "getMKWeight");
def_visible_primitive( setMKWeight, "setMKWeight");
def_visible_primitive( getMKKey, "getMKKey");
def_visible_primitive( getMKKeyIndex, "getMKKeyIndex");
def_visible_primitive( getMKTargetNames, "getMKTargetNames");
def_visible_primitive( getMKTargetWeights, "getMKTargetWeights");
#ifndef NO_OBJECT_MORPH // russom - 10/13/01
def_visible_primitive( createMorphObject, "createMorphObject");
def_visible_primitive( addMorphTarget, "addMorphTarget");
def_visible_primitive( setMorphTarget, "setMorphTarget");
def_visible_primitive( deleteMorphTarget, "deleteMorphTarget");
def_visible_primitive( setMorphTargetName, "setMorphTargetName");
#endif
/* OLE automation */
def_visible_primitive( register_OLE_interface, "registerOLEInterface");
def_visible_primitive( create_OLE_object, "createOLEObject");
def_visible_primitive( release_OLE_object, "releaseOLEObject");
def_visible_primitive( release_all_OLE_objects, "releaseAllOLEObjects");
#ifdef DDE_ENABLED // enable this for R4!!
/* DDE access */
def_struct_primitive( dde_connect, dde, "connect");
def_struct_primitive( dde_disconnect, dde, "disconnect");
def_struct_primitive( dde_request, dde, "request");
def_struct_primitive( dde_execute, dde, "execute");
def_struct_primitive( dde_poke, dde, "poke");
def_struct_primitive( dde_adviseStart, dde, "adviseStart");
def_struct_primitive( dde_adviseStop, dde, "adviseStop");
def_struct_primitive( dde_createServer, dde, "createServer");
def_struct_primitive( dde_deleteServer, dde, "deleteServer");
def_struct_primitive( dde_createTopic, dde, "createTopic");
#endif
// Set Key buffer control on an animatable
def_struct_primitive( setKey_subAnimBufferPresent, setKey, "subAnimBufferPresent");
def_struct_primitive( setKey_bufferPresent, setKey, "bufferPresent");
def_struct_primitive( setKey_subAnimCommitBuffer, setKey, "subAnimCommitBuffer");
def_struct_primitive( setKey_commitBuffer, setKey, "commitBuffer");
def_struct_primitive( setKey_subAnimRevertBuffer, setKey, "subAnimRevertBuffer");
def_struct_primitive( setKey_revertBuffer, setKey, "revertBuffer");
/* evaluator primitives - emitted by parser */
def_primitive( progn, "progn");
def_primitive( max_command, "max");
def_primitive( return, "return");
def_primitive( exit, "exit");
def_primitive( continue, "continue");
def_lazy_primitive( quote, "quote");
def_lazy_primitive( if, "if");
def_lazy_primitive( case, "case");
def_lazy_primitive( while, "while");
def_lazy_primitive( do, "do");
def_lazy_primitive( for, "for");
def_lazy_primitive( and, "and");
def_lazy_primitive( or, "or");
def_lazy_primitive( animate_context, "animate_context");
def_lazy_primitive( redraw_context, "redraw_context");
def_lazy_primitive( pivot_context, "pivot_context");
def_lazy_primitive( level_context, "level_context");
def_lazy_primitive( time_context, "time_context");
def_lazy_primitive( coordsys_context, "coordsys_context");
def_lazy_primitive( center_context, "center_context");
def_lazy_primitive( undo_context, "undo_context");
def_lazy_primitive( printallelements_context, "printallelements_context");
def_lazy_primitive( assign, "=");
def_lazy_primitive( op_assign, "+=");
def_lazy_primitive( make_persistent, "make_persistent");
def_mapped_generic( assign, "=");
def_mapped_generic( op_assign, "+=");
def_generic ( not, "not");
def_lazy_primitive( try, "try");
def_primitive ( throw, "throw");
def_visible_primitive ( getCurrentException,"getCurrentException");
def_lazy_primitive( change_handler, "change_handler");
def_visible_lazy_primitive( swap, "swap");
def_visible_primitive( dependsOn, "dependsOn");
// LAM 4/1/00 - moved from MXSAgni
def_visible_primitive( registerRightClickMenu, "registerRightClickMenu");
def_visible_primitive( unregisterRightClickMenu, "unregisterRightClickMenu");
def_visible_primitive( unregisterAllRightClickMenus, "unregisterAllRightClickMenus");
def_visible_primitive( registerRedrawViewsCallback, "registerRedrawViewsCallback");
def_visible_primitive( unregisterRedrawViewsCallback, "unregisterRedrawViewsCallback");
//watje 7-9-00 exposes the new filter callback
def_visible_primitive( registerSelectFilterCallback, "registerSelectFilterCallback");
def_visible_primitive( unregisterSelectFilterCallback, "unregisterSelectFilterCallback");
//watje 7-11-00 exposes the new display filter callback
def_visible_primitive( registerDisplayFilterCallback, "registerDisplayFilterCallback");
def_visible_primitive( unregisterDisplayFilterCallback, "unregisterDisplayFilterCallback");
// LAM 7/23/02 - moved from gScript
def_visible_primitive(AddSubRollout, "AddSubRollout");
def_visible_primitive(RemoveSubRollout, "RemoveSubRollout");
def_struct_primitive(registerDialogBar, cui, "registerDialogBar");
def_struct_primitive(unRegisterDialogBar, cui, "unRegisterDialogBar");
def_struct_primitive(dockDialogBar, cui, "dockDialogBar");
def_struct_primitive(floatDialogBar, cui, "floatDialogBar");
def_struct_primitive(getDockState, cui, "getDockState");
def_struct_primitive(setAppTitle, cui, "setAppTitle");
def_visible_primitive(CreateDialog, "CreateDialog");
def_visible_primitive(DestroyDialog,"DestroyDialog");
def_visible_primitive(SetDialogPos, "SetDialogPos");
def_visible_primitive(GetDialogPos, "GetDialogPos");
def_visible_primitive(GetDialogSize, "GetDialogSize");
def_visible_primitive(SetDialogBitmap, "SetDialogBitmap");
def_visible_primitive(GetDialogBitmap, "GetDialogBitmap");
def_visible_primitive(PopupMenu, "PopupMenu");
// def_visible_primitive(PopupMenuBar, "PopupMenuBar");
def_visible_primitive ( getNodeByName, "getNodeByName");

View File

@ -0,0 +1,35 @@
/*
* quat_protocol.h - def_generics for quaternion protocol
*
*
* Copyright <20> John Wainwright 1996
*
*/
use_generic(coerce, "coerce");
use_generic( plus, "+" );
use_generic( minus, "-" );
use_generic( times, "*" );
use_generic( div, "/" );
use_generic( uminus, "u-" );
use_generic( eq, "=" );
use_generic( ne, "!=" );
use_generic( random, "random" );
def_visible_generic( isIdentity, "isIdentity" );
use_generic ( normalize, "normalize" );
def_visible_generic( inverse, "Inverse" );
def_visible_generic( conjugate, "Conjugate" );
def_visible_generic( logN, "LogN" );
use_generic ( exp, "Exp" );
def_visible_generic( slerp, "Slerp" );
def_visible_generic( lnDif, "LnDif" );
def_visible_generic( qCompA, "QCompA" );
def_visible_generic( squad, "Squad" );
def_visible_generic( qorthog, "qorthog" );
def_visible_generic( transform, "transform" );
def_visible_primitive( squadrev, "squadrev" );

View File

@ -0,0 +1,930 @@
/*
* Rollouts.h - Rollout panel classes & functions for MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_ROLLOUTS
#define _H_ROLLOUTS
#include "Arrays.h"
typedef struct // rollout control layout data
{
int left;
int top;
int width;
int height;
int columns;
} layout_data;
/* some layout constants (in pixels) ... */
#define TOP_MARGIN 2
#define SIDE_MARGIN 4
#define RADIO_DOT_WIDTH 23
#define CHECK_BOX_WIDTH 24
#define LEFT_ALIGN 13
#define RIGHT_ALIGN 13
#define GROUP_BOX_Y_MARGIN 6
#define GROUP_BOX_X_MARGIN 4
#define SPACING_BEFORE 5
/* ---------------------- Rollout class ----------------------- */
/* contains the defintion of rollout panel. This includes:
* - an 'instance variable' array, these variables can be accessed as locals in rollout handlers
* - a control array, containing rolout control instances
* - a hashtable of event handler functions
* there are associated Thunks for the locals & controls so you can ref them as variables in
* handlers
*/
class RolloutControl;
class RolloutFloater;
class MSPlugin;
class RolloutChangeCallback;
class PB2Param;
visible_class (Rollout)
class Rollout : public Value
{
public:
Value* name; // rollout's variable name
Value* title; // title factor
HashTable* local_scope; // local name space
Value** locals; // local var array
Value** local_inits; // " " " init vals
int local_count; // " " count
RolloutControl** controls; // control array
int control_count; // " " count
HashTable* handlers; // handler tables
short flags; // rollout flags
short order; // rollout open order no.
Interface* ip; // Interface pointer
HWND page; // my dialog HWND when visible
HDC rollout_dc; // my dialog dev. context
HFONT font; // dialog's default font
int text_height; // metrics....
int default_control_leading;
int rollout_width;
int rollout_height;
int rollout_category;
int current_width; // used for across: processing...
int current_left;
int max_y, last_y;
int across_count;
WORD close_button_ID; // id of gen'd close button
BOOL selected; // selected to be open
BOOL disabled; // error in handler -> ro disabled
CharStream* source; // source text if available
BOOL init_values; // whether to init ctrl/local values on (re)open
MSPlugin* plugin; // plugin I'm open on if non-NULL
RolloutChangeCallback* tcb; // timechange callback if rollout has controller-linked spinners
IMtlParams* imp; // MtlEditor interface if open in Mtl Editor and other stuff...
TexDADMgr* texDadMgr;
MtlDADMgr* mtlDadMgr;
HWND hwMtlEdit;
RolloutFloater* rof; // owning rolloutfloater window if present there
WORD next_id; // dialog item ID allocators
Tab<RolloutControl*> id_map; // dialog item ID map for taking item ID's to associated RolloutControl
Rollout(short iflags);
void init(Value* name, Value* title, int local_count, Value** inits, HashTable* local_scope, RolloutControl** controls, int control_count, HashTable* handlers, CharStream* source);
~Rollout();
classof_methods (Rollout, Value);
void collect() { delete this; }
void gc_trace();
ScripterExport void sprin1(CharStream* s);
ScripterExport BOOL add_page(Interface *ip, HINSTANCE hInstance, int ro_flags = 0, RolloutFloater* rof = NULL);
ScripterExport void delete_page(Interface *ip, RolloutFloater* rof = NULL);
void open(Interface *ip, BOOL rolled_up = FALSE);
ScripterExport void close(Interface *ip, RolloutFloater* rof = NULL);
ScripterExport BOOL ok_to_close(RolloutFloater* rof = NULL);
ScripterExport void run_event_handler(Value* event, Value** arg_list, int count);
Value* call_event_handler(Value* event, Value** arg_list, int count);
void add_close_button(HINSTANCE hInstance, int& current_y);
void edit_script();
void TimeChanged(TimeValue t);
// various open/close for scripted plug-in rollouts
// command panel
void BeginEditParams(IObjParam* ip, MSPlugin* plugin, ULONG flags, Animatable *prev);
void EndEditParams(IObjParam* ip, MSPlugin* plugin, ULONG flags, Animatable *next);
// mtl editor
void CreateParamDlg(HWND hwMtlEdit, IMtlParams* imp, MSPlugin* plugin, TexDADMgr* texDadMgr, MtlDADMgr* mtlDadMgr);
void SetThing(MSPlugin* plugin);
void ReloadDialog();
void SetTime(TimeValue t);
void DeleteThis();
// update/reload
void InvalidateUI();
void InvalidateUI(ParamID id, int tabIndex=-1); // nominated param
virtual Value* get_property(Value** arg_list, int count);
virtual Value* set_property(Value** arg_list, int count);
virtual Value* set_nested_controller(Value** arg_list, int count);
};
#define RO_NO_CLOSEBUTTON 0x0001
#define RO_HIDDEN 0x0002
#define RO_ROLLED_UP 0x0004
#define RO_IN_FLOATER 0x0008
#define RO_INSTALLED 0x0010
#define RO_UTIL_MASTER 0x0020
#define RO_SILENT_ERRORS 0x0040
#define RO_HIDDEN2 0x0080
#define RO_PLUGIN_OWNED 0x0100
#define RO_CONTROLS_INSTALLED 0x0200
/* --------------------- RolloutFloater class ------------------------ */
visible_class (RolloutFloater)
class RolloutFloater : public Value
{
public:
HWND window; // modeless dialog window
HWND ru_window; // host rollup winddow cust control
IRollupWindow* irw;
Tab<Rollout*> rollouts; // my rollouts
int width, height; // window size...
int left, top;
bool inDelete;
RolloutFloater(TCHAR* title, int left, int top, int width, int height);
RolloutFloater() {window=ru_window=NULL;irw=NULL;width=height=left=top=0;inDelete=false;tag = class_tag(RolloutFloater);}
~RolloutFloater();
classof_methods (RolloutFloater, Value);
void collect() { delete this; }
void add_rollout(Rollout* ro, BOOL rolledUp);
void remove_rollout(Rollout* ro);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
};
/* -------------------- RolloutControl classes ----------------------- */
/* represent controls such as buttons & spinners on rollout panels, RolloutControl is abstract
* root of all controls */
visible_class (RolloutControl)
class RolloutControl : public Value, public ReferenceMaker
{
public:
Value* name;
Value* caption;
Value* init_caption;
BOOL enabled;
Value** keyparms;
int keyparm_count;
Rollout* parent_rollout;
WORD control_ID;
Control* controller; // optional linked animation controller
ParamDimension* dim; // controllers dimension
PB2Param* pid; // if non-NULL, indicates this control is associated with an MSPlugin parameter &
// points at ParamUIRep-like data for it
short flags;
ScripterExport RolloutControl();
ScripterExport RolloutControl(Value* name, Value* caption, Value** keyparms, int keyparm_count);
ScripterExport ~RolloutControl();
classof_methods (RolloutControl, Value);
BOOL _is_rolloutcontrol() { return 1; }
# define is_rolloutcontrol(o) ((o)->_is_rolloutcontrol())
void collect() { delete this; }
ScripterExport void gc_trace();
virtual ScripterExport void add_control(Rollout *ro, HWND parent, HINSTANCE hInstance, int& current_y);
virtual LPCTSTR get_control_class() = 0;
virtual DWORD get_control_style() { return WS_TABSTOP; }
virtual DWORD get_control_ex_style() { return 0; }
virtual void init_control(HWND control) { }
virtual void compute_layout(Rollout *ro, layout_data* pos) { }
virtual ScripterExport void compute_layout(Rollout *ro, layout_data* pos, int& current_y);
virtual ScripterExport void process_layout_params(Rollout *ro, layout_data* pos, int& current_y);
virtual ScripterExport void setup_layout(Rollout *ro, layout_data* pos, int& current_y);
virtual ScripterExport void process_common_params();
virtual ScripterExport void call_event_handler(Rollout *ro, Value* event, Value** arg_list, int count);
virtual ScripterExport void run_event_handler(Rollout *ro, Value* event, Value** arg_list, int count);
virtual BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam) { return FALSE; }
ScripterExport WORD next_id();
virtual ScripterExport Value* get_property(Value** arg_list, int count);
virtual ScripterExport Value* set_property(Value** arg_list, int count);
virtual ScripterExport void set_text(TCHAR* text, HWND ctl = NULL, Value* align = NULL);
virtual ScripterExport void set_enable();
virtual ScripterExport BOOL set_focus();
virtual ScripterExport int num_controls() { return 1; }
ScripterExport Value* get_event_handler(Value* event);
// ReferenceMaker
int NumRefs() { return (controller != NULL) ? 1 : 0; }
RefTargetHandle GetReference(int i) { return controller; }
void SetReference(int i, RefTargetHandle rtarg) { controller = (Control*)rtarg; }
ScripterExport RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message);
virtual void controller_changed() { }
virtual BOOL controller_ok(Control* c) { return FALSE; }
// PB2 UI update
ScripterExport IParamBlock2* get_pblock();
virtual void Reload() { }
virtual void InvalidateUI() { }
virtual void set_pb2_value() { }
virtual void get_pb2_value(BOOL load_UI=TRUE) { }
virtual void SetTexDADMgr(DADMgr* dad) { }
virtual int FindSubTexFromHWND(HWND hw) { return -1; }
virtual void SetMtlDADMgr(DADMgr* dad) { }
virtual int FindSubMtlFromHWND(HWND hw) { return -1; }
};
// flag bits for RolloutControl::flags
#define ROC_FIXED_WIDTH 0x0001 // a specific width: supplied, don't resize buttons on .text =
#define ROC_MAKING_EDIT 0x0002
#define ROC_INVISIBLE 0x0004 // rollout control is set to invisible and is disabled
#define ROC_VAL_CHANGED 0x0008 // value was changed while control had focus
#define ROC_EDITTEXT_MULTILINE 0x0010 // edittext control is multiline
#define ROC_COLORSWATCH_POINT4 0x0010 // Set if color swatch is a Point4 (FRGBA)
#define ROC_PICKBUTTON_AUTODISP 0x0010 // Set if autoDisplay is turned on for pickbutton (autodisplay node name)
#define ROC_IN_HANDLER 0x0020 // Set if currently running event handler
#define ROC_HANDLER_REENTRANT 0x0040 // Set if rollout control's event handlers are re-entrant. Only case is checkbutton.
#define ROC_EDITTEXT_READONLY 0x0080 // edittext control is read-only
extern LPCTSTR cust_button_class;
/* ------------- PB2Param class -------------------- */
// present in a UI control if rollout is part of a scripted plugin
// and this control is associated with a ParamBlock2 param
class PB2Param
{
public:
ParamID id; // pblock param ID
int index; // pblock direct index of param
int tabIndex; // element index if param is Tab<>
int block_id; // owning block's ID
int subobjno; // texmap or mtl param subobjno in the block
ParamDimension* dim;// parameter's dimension
ParamType2 type; // parameter's type
PB2Param(ParamDef& pd, int index, int block_id, int subobjno, int tabIndex = -1);
};
/* -------------------- LabelControl ------------------- */
visible_class (LabelControl)
class LabelControl : public RolloutControl
{
public:
LabelControl(Value* name, Value* caption, Value** keyparms, int keyparm_count)
: RolloutControl(name, caption, keyparms, keyparm_count) { tag = class_tag(LabelControl); }
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new LabelControl (name, caption, keyparms, keyparm_count); }
classof_methods (LabelControl, RolloutControl);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s) { s->printf(_T("LabelControl:%s"), name->to_string()); }
LPCTSTR get_control_class() { return _T("STATIC"); }
DWORD get_control_style() { return 0; }
void compute_layout(Rollout *ro, layout_data* pos);
};
/* -------------------- ButtonControl ------------------- */
visible_class (ButtonControl)
class ButtonControl : public RolloutControl
{
public:
HIMAGELIST images;
int image_width, image_height;
int iOutEn, iInEn, iOutDis, iInDis;
ButtonControl(Value* name, Value* caption, Value** keyparms, int keyparm_count)
: RolloutControl(name, caption, keyparms, keyparm_count)
{
tag = class_tag(ButtonControl);
images = NULL;
}
~ButtonControl();
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new ButtonControl (name, caption, keyparms, keyparm_count); }
classof_methods (ButtonControl, RolloutControl);
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("ButtonControl:%s"), name->to_string()); }
LPCTSTR get_control_class() { return cust_button_class; }
void init_control(HWND control);
void compute_layout(Rollout *ro, layout_data* pos);
BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void set_enable();
};
/* -------------------- CheckButtonControl ------------------- */
visible_class (CheckButtonControl)
class CheckButtonControl : public RolloutControl
{
public:
int checked; // LAM - 2/11/02 - changed from BOOL (which is actually an int) since now tristate
HIMAGELIST images;
int image_width, image_height;
int iOutEn, iInEn, iOutDis, iInDis;
CheckButtonControl(Value* name, Value* caption, Value** keyparms, int keyparm_count)
: RolloutControl(name, caption, keyparms, keyparm_count)
{
tag = class_tag(CheckButtonControl);
images = NULL;
}
~CheckButtonControl();
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new CheckButtonControl (name, caption, keyparms, keyparm_count); }
classof_methods (CheckButtonControl, RolloutControl);
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("CheckButtonControl:%s"), name->to_string()); }
LPCTSTR get_control_class() { return cust_button_class; }
void init_control(HWND control);
void compute_layout(Rollout *ro, layout_data* pos);
BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void set_enable();
void Reload();
void InvalidateUI();
void set_pb2_value();
void get_pb2_value(BOOL load_UI=TRUE);
};
/* -------------------- EditTextControl ------------------- */
visible_class (EditTextControl)
class EditTextControl : public RolloutControl
{
public:
Value* text;
Value* bold;
bool in_setvalue;
EditTextControl(Value* name, Value* caption, Value** keyparms, int keyparm_count);
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new EditTextControl (name, caption, keyparms, keyparm_count); }
classof_methods (EditTextControl, RolloutControl);
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("EditTextControl:%s"), name->to_string()); }
void gc_trace();
void add_control(Rollout *ro, HWND parent, HINSTANCE hInstance, int& current_y);
LPCTSTR get_control_class() { return CUSTEDITWINDOWCLASS; }
void compute_layout(Rollout *ro, layout_data* pos, int& current_y);
BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void set_enable();
int num_controls() { return 2; }
void Reload();
void InvalidateUI();
void set_pb2_value();
void get_pb2_value(BOOL load_UI=TRUE);
};
/* -------------------- ComboBoxControl ------------------- */
visible_class (ComboBoxControl)
class ComboBoxControl : public RolloutControl
{
public:
Array* item_array;
int selection;
short type;
short flags;
ComboBoxControl(Value* name, Value* caption, Value** keyparms, int keyparm_count, int type = CBS_SIMPLE);
static RolloutControl* create_cb(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new ComboBoxControl (name, caption, keyparms, keyparm_count); }
static RolloutControl* create_dd(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new ComboBoxControl (name, caption, keyparms, keyparm_count, CBS_DROPDOWNLIST); }
classof_methods (ComboBoxControl, RolloutControl);
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("ComboBoxControl:%s"), name->to_string()); }
void gc_trace();
void add_control(Rollout *ro, HWND parent, HINSTANCE hInstance, int& current_y);
LPCTSTR get_control_class() { return _T("COMBOBOX"); }
DWORD get_control_style() { return CBS_DROPDOWNLIST | CBS_NOINTEGRALHEIGHT | WS_TABSTOP; }
void compute_layout(Rollout *ro, layout_data* pos, int& current_y);
BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void set_enable();
int num_controls() { return 2; }
void Reload();
void InvalidateUI();
void set_pb2_value();
void get_pb2_value(BOOL load_UI=TRUE);
};
#define CBF_EDIT_FIELD_CHANGING 0x0001
/* -------------------- ListBoxControl ------------------- */
visible_class (ListBoxControl)
class ListBoxControl : public RolloutControl
{
public:
Array* item_array;
int selection;
ListBoxControl(Value* name, Value* caption, Value** keyparms, int keyparm_count);
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new ListBoxControl (name, caption, keyparms, keyparm_count); }
classof_methods (ListBoxControl, RolloutControl);
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("ListBoxControl:%s"), name->to_string()); }
void gc_trace();
void add_control(Rollout *ro, HWND parent, HINSTANCE hInstance, int& current_y);
LPCTSTR get_control_class() { return _T("LISTBOX"); }
DWORD get_control_style() { return WS_TABSTOP; }
void compute_layout(Rollout *ro, layout_data* pos, int& current_y);
BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void set_enable();
int num_controls() { return 2; }
void Reload();
void InvalidateUI();
void set_pb2_value();
void get_pb2_value(BOOL load_UI=TRUE);
};
/* -------------------- SpinnerControl ------------------- */
visible_class (SpinnerControl)
class SpinnerControl : public RolloutControl
{
public:
float fvalue;
int ivalue;
float max, min;
float scale;
EditSpinnerType spin_type;
SpinnerControl(Value* name, Value* caption, Value** keyparms, int keyparm_count)
: RolloutControl(name, caption, keyparms, keyparm_count) { tag = class_tag(SpinnerControl); }
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new SpinnerControl (name, caption, keyparms, keyparm_count); }
classof_methods (SpinnerControl, RolloutControl);
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("SpinnerControl:%s"), name->to_string()); }
void add_control(Rollout *ro, HWND parent, HINSTANCE hInstance, int& current_y);
LPCTSTR get_control_class() { return SPINNERWINDOWCLASS; }
void compute_layout(Rollout *ro, layout_data* pos, int& current_y);
BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void set_enable();
BOOL set_focus();
int num_controls() { return 3; }
void controller_changed();
BOOL controller_ok(Control* c) { return c->SuperClassID() == CTRL_FLOAT_CLASS_ID; }
void Reload();
void InvalidateUI();
void set_pb2_value();
void get_pb2_value(BOOL load_UI=TRUE);
};
/* -------------------- SliderControl ------------------- */
visible_class (SliderControl)
class SliderControl : public RolloutControl
{
public:
float value;
float max, min;
int ticks;
int slider_type;
bool vertical;
bool sliding;
SliderControl(Value* name, Value* caption, Value** keyparms, int keyparm_count)
: RolloutControl(name, caption, keyparms, keyparm_count), sliding(false) { tag = class_tag(SliderControl); }
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new SliderControl (name, caption, keyparms, keyparm_count); }
classof_methods (SliderControl, RolloutControl);
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("SliderControl:%s"), name->to_string()); }
void add_control(Rollout *ro, HWND parent, HINSTANCE hInstance, int& current_y);
LPCTSTR get_control_class() { return TRACKBAR_CLASS; }
void compute_layout(Rollout *ro, layout_data* pos, int& current_y);
BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void set_enable();
int num_controls() { return 2; }
void Reload();
void InvalidateUI();
void set_pb2_value();
void get_pb2_value(BOOL load_UI=TRUE);
};
/* -------------------- PickerControl ------------------- */
class PickerControl;
class PickerControlFilter : public PickNodeCallback
{
public:
Value* filter_fn;
PickerControl* picker;
PickerControlFilter(Value* filter, PickerControl* picker) : filter_fn(filter), picker(picker) { }
BOOL Filter(INode *node);
};
class PickerControlMode : public PickModeCallback
{
public:
PickerControlFilter* pick_filter;
TCHAR* msg;
PickerControl* picker;
PickerControlMode(PickerControlFilter* ifilter, TCHAR* imsg, PickerControl* ipick);
BOOL HitTest(IObjParam *ip, HWND hWnd, ViewExp *vpt, IPoint2 m, int flags);
BOOL Pick(IObjParam *ip, ViewExp *vpt);
PickNodeCallback *GetFilter() { return pick_filter; }
BOOL RightClick(IObjParam *ip, ViewExp *vpt) { return TRUE; }
void EnterMode(IObjParam *ip);
void ExitMode(IObjParam *ip);
};
visible_class (PickerControl)
class PickerControl : public RolloutControl
{
public:
PickerControlFilter* pick_filter;
PickerControlMode* pick_mode;
ICustButton* cust_button;
Value* picked_object;
PickerControl(Value* name, Value* caption, Value** keyparms, int keyparm_count);
~PickerControl();
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new PickerControl (name, caption, keyparms, keyparm_count); }
classof_methods (PickerControl, RolloutControl);
void collect() { delete this; }
void gc_trace();
void sprin1(CharStream* s) { s->printf(_T("PickerControl:%s"), name->to_string()); }
LPCTSTR get_control_class() { return cust_button_class; }
void compute_layout(Rollout *ro, layout_data* pos);
void init_control(HWND control);
BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void set_enable();
void Reload();
void InvalidateUI();
void set_pb2_value();
void get_pb2_value(BOOL load_UI=TRUE);
};
/* -------------------- ColorPickerControl ------------------- */
visible_class (ColorPickerControl)
class ColorPickerControl : public RolloutControl
{
public:
Value* color;
IColorSwatch* csw;
Value* title;
ColorPickerControl(Value* name, Value* caption, Value** keyparms, int keyparm_count);
~ColorPickerControl();
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new ColorPickerControl (name, caption, keyparms, keyparm_count); }
classof_methods (ColorPickerControl, RolloutControl);
void collect() { delete this; }
void gc_trace();
void sprin1(CharStream* s) { s->printf(_T("ColorPickerControl:%s"), name->to_string()); }
LPCTSTR get_control_class() { return COLORSWATCHWINDOWCLASS; }
void init_control(HWND control);
void add_control(Rollout *ro, HWND parent, HINSTANCE hInstance, int& current_y);
void compute_layout(Rollout *ro, layout_data* pos, int& current_y);
BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void set_enable();
int num_controls() { return 2; }
void Reload();
void InvalidateUI();
void set_pb2_value();
void get_pb2_value(BOOL load_UI=TRUE);
};
/* -------------------- RadioControl ------------------- */
visible_class (RadioControl)
class RadioControl : public RolloutControl
{
public:
int state;
int btn_count;
RadioControl(Value* name, Value* caption, Value** keyparms, int keyparm_count)
: RolloutControl(name, caption, keyparms, keyparm_count) { tag = class_tag(RadioControl); }
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new RadioControl (name, caption, keyparms, keyparm_count); }
classof_methods (RadioControl, RolloutControl);
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("RadioControl:%s"), name->to_string()); }
void add_control(Rollout *ro, HWND parent, HINSTANCE hInstance, int& current_y);
LPCTSTR get_control_class() { return _T("BUTTON"); }
DWORD get_control_style() { return BS_AUTORADIOBUTTON; }
void compute_layout(Rollout *ro, layout_data* pos, int& current_y);
BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void set_enable();
BOOL set_focus();
int num_controls() { return btn_count + 1; } // buttons and caption. don't count 1 dummy button that ends group
void Reload();
void InvalidateUI();
void set_pb2_value();
void get_pb2_value(BOOL load_UI=TRUE);
};
/* -------------------- CheckBoxControl ------------------- */
visible_class (CheckBoxControl)
class CheckBoxControl : public RolloutControl
{
public:
int checked; // LAM - 2/11/02 - added 3rd state (indeterminate). Changed from BOOL to int just for clarity.
CheckBoxControl(Value* name, Value* caption, Value** keyparms, int keyparm_count)
: RolloutControl(name, caption, keyparms, keyparm_count) { tag = class_tag(CheckBoxControl); }
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new CheckBoxControl (name, caption, keyparms, keyparm_count); }
classof_methods (CheckBoxControl, RolloutControl);
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("CheckBoxControl:%s"), name->to_string()); }
LPCTSTR get_control_class() { return _T("BUTTON"); }
DWORD get_control_style() { return BS_AUTO3STATE | WS_TABSTOP; }
void init_control(HWND control);
void compute_layout(Rollout *ro, layout_data* pos);
BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void Reload();
void InvalidateUI();
void set_pb2_value();
void get_pb2_value(BOOL load_UI=TRUE);
};
/* -------------------- BitmapControl ------------------- */
visible_class (BitmapControl)
class BitmapControl : public RolloutControl
{
public:
Value* file_name;
Value* max_bitmap; // if supplied
HBITMAP bitmap;
BitmapControl(Value* name, Value* caption, Value** keyparms, int keyparm_count);
~BitmapControl();
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new BitmapControl (name, caption, keyparms, keyparm_count); }
classof_methods (BitmapControl, RolloutControl);
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("BitmapControl:%s"), name->to_string()); }
void gc_trace();
LPCTSTR get_control_class() { return _T("STATIC"); }
DWORD get_control_style() { return SS_BITMAP + SS_CENTERIMAGE; }
DWORD get_control_ex_style() { return WS_EX_CLIENTEDGE; }
void compute_layout(Rollout *ro, layout_data* pos);
void process_layout_params(Rollout *ro, layout_data* pos, int& current_y);
void init_control(HWND control);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
};
/* -------------------- MapButtonControl ------------------- */
visible_class (MapButtonControl)
class MapButtonControl : public ButtonControl
{
public:
Value* map;
ICustButton* btn;
MapButtonControl(Value* name, Value* caption, Value** keyparms, int keyparm_count)
: ButtonControl(name, caption, keyparms, keyparm_count)
{
tag = class_tag(MapButtonControl);
btn = NULL;
map = NULL;
}
~MapButtonControl() { if (btn != NULL) ReleaseICustButton(btn); }
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new MapButtonControl (name, caption, keyparms, keyparm_count); }
classof_methods (MapButtonControl, RolloutControl);
void gc_trace();
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("MapButtonControl:%s"), name->to_string()); }
void init_control(HWND control);
BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void Reload();
void InvalidateUI();
void set_pb2_value();
void get_pb2_value(BOOL load_UI=TRUE);
void SetTexDADMgr(DADMgr* dad) { if (btn) btn->SetDADMgr(dad); }
int FindSubTexFromHWND(HWND hw);
};
/* -------------------- MtlButtonControl ------------------- */
visible_class (MtlButtonControl)
class MtlButtonControl : public ButtonControl
{
public:
Value* mtl;
ICustButton* btn;
MtlButtonControl(Value* name, Value* caption, Value** keyparms, int keyparm_count)
: ButtonControl(name, caption, keyparms, keyparm_count)
{
tag = class_tag(MtlButtonControl);
btn = NULL;
mtl = NULL;
}
~MtlButtonControl() { if (btn != NULL) ReleaseICustButton(btn); }
static RolloutControl* create(Value* name, Value* caption, Value** keyparms, int keyparm_count)
{ return new MtlButtonControl (name, caption, keyparms, keyparm_count); }
classof_methods (MtlButtonControl, RolloutControl);
void gc_trace();
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("MtlButtonControl:%s"), name->to_string()); }
void init_control(HWND control);
BOOL handle_message(Rollout *ro, UINT message, WPARAM wParam, LPARAM lParam);
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
void set_enable();
void Reload();
void InvalidateUI();
void set_pb2_value();
void get_pb2_value(BOOL load_UI=TRUE);
void SetMtlDADMgr(DADMgr* dad) { if (btn) btn->SetDADMgr(dad); }
int FindSubMtlFromHWND(HWND hw);
};
/* ----------------------- GroupControls ---------------------- */
visible_class (GroupStartControl)
class GroupStartControl : public RolloutControl
{
public:
int start_y; /* y coord of top of group */
GroupStartControl(Value* caption)
: RolloutControl(NULL, caption, NULL, 0) { tag = class_tag(GroupStartControl); }
classof_methods (GroupStartControl, RolloutControl);
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("GroupStartControl:%s"), caption->to_string()); }
void add_control(Rollout *ro, HWND parent, HINSTANCE hInstance, int& current_y);
LPCTSTR get_control_class() { return _T(""); }
void compute_layout(Rollout *ro, layout_data* pos) { }
};
visible_class (GroupEndControl)
class GroupEndControl : public RolloutControl
{
GroupStartControl* my_start; /* link back to my group start control */
public:
GroupEndControl(GroupStartControl* starter)
: RolloutControl(NULL, starter->caption, NULL, 0) { tag = class_tag(GroupEndControl); my_start = starter; }
classof_methods (GroupEndControl, RolloutControl);
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("GroupEndControl:%s"), caption->to_string()); }
void add_control(Rollout *ro, HWND parent, HINSTANCE hInstance, int& current_y);
LPCTSTR get_control_class() { return _T(""); }
void compute_layout(Rollout *ro, layout_data* pos) { }
};
// ---- time change callback for rollouts with controller-linked spinners in them ----
class RolloutChangeCallback : public TimeChangeCallback
{
public:
Rollout* ro;
RolloutChangeCallback(Rollout* iro) { ro = iro; }
void TimeChanged(TimeValue t) { ro->TimeChanged(t); }
};
/* control keyword parameter access macros... */
extern ScripterExport Value* _get_control_param(Value** keyparms, int count, Value* key_name);
extern ScripterExport Value* _get_control_param_or_default(Value** keyparms, int count, Value* key_name, Value* def);
#define control_param(key) _get_control_param(keyparms, keyparm_count, n_##key)
#define control_param_or_default(key, def) _get_control_param_or_default(keyparms, keyparm_count, n_##key##, def)
#define int_control_param(key, var, def) ((var = _get_control_param(keyparms, keyparm_count, n_##key)) == &unsupplied ? def : var->to_int())
#define float_control_param(key, var, def) ((var = _get_control_param(keyparms, keyparm_count, n_##key)) == &unsupplied ? def : var->to_float())
#endif

View File

@ -0,0 +1,114 @@
/*
* SceneIO.h - MAXScript-related scene file I/O (persistent globals, on-open script, etc.)
*
* Copyright <20> Autodesk, Inc, 1998. John Wainwright.
*
*/
#ifndef _H_SCENEIO
#define _H_SCENEIO
class ValueLoader;
/* --------- Scene I/O chunk ID's ---------- */
#define OPENSCRIPT_CHUNK 0x0010 // obsoleted by CALLBACKSCRIPT_CHUNK
#define SAVESCRIPT_CHUNK 0x0020 // obsoleted by CALLBACKSCRIPT_CHUNK
#define PSGLOBALS_CHUNK 0x0030
#define MSPLUGINCLASS_CHUNK 0x0040
#define MSPLUGINCLASSHDR_CHUNK 0x0050
#define LENGTH_CHUNK 0x0060
#define CALLBACKSCRIPT_CHUNK 0x0070
#define CUSTATTRIBDEF_CHUNK 0x0080
#define SOURCE_CHUNK 0x00a0
/* ---- persistent global value loading ----- */
typedef Value* (*load_fn)(ILoad* iload, USHORT chunkID, ValueLoader* vl);
enum LoadableClassID
{
Undefined_Chunk = 0, Boolean_Chunk, Ok_Chunk,
Integer_Chunk, Float_Chunk, String_Chunk,
Name_Chunk, Array_Chunk, Point3Value_Chunk,
QuatValue_Chunk, RayValue_Chunk, AngAxisValue_Chunk,
EulerAnglesValue_Chunk, Matrix3Value_Chunk, Point2Value_Chunk,
ColorValue_Chunk, MSTime_Chunk, MSInterval_Chunk,
MAXWrapper_Chunk, Unsupplied_Chunk, Struct_Chunk,
Point4Value_Chunk,
// add more here...
HIGH_CLASS_CHUNK // must be last
};
extern ScripterExport Value* load_value(ILoad* iload, ValueLoader* vload);
extern void save_persistent_callback_scripts(ISave* isave);
extern IOResult load_persistent_callback_script(ILoad* iload);
extern Tab<ValueLoader*> value_loaders;
#ifdef _DEBUG
extern BOOL dump_load_postload_callback_order;
#endif
// post global load callback scheme, allows different loaders to
// permit ::Load() fns to register a callback to clean-up a load.
// Eg, Array loader gets such a callback from MAXWrapper::Load() which
// uses this to build the MAXWrapper at post-load time, after object pointers
// have been back-patched.
// ::Load()'s that need to specialize this to provide a callback
class ValueLoadCallback
{
public:
virtual Value* post_load() { return &undefined; } // return the cleaned-up value
};
// each loader specializes this and gives it to the ::Load()
class ValueLoader
{
public:
virtual void register_callback(ValueLoadCallback* cb) { }
virtual void call_back() { }
};
// A post load callback to process persistent value load callbacks
class ValueLoadPLCB : public PostLoadCallback
{
public:
void proc(ILoad *iload)
{
for (int i = 0; i < value_loaders.Count(); i++)
value_loaders[i]->call_back();
value_loaders.ZeroCount();
delete this;
#ifdef _DEBUG
if (dump_load_postload_callback_order)
DebugPrint("MXS: PostLoadCallback run: ValueLoadPLCB\n");
#endif
}
};
// callback script (see MAXCallbacks.cpp)
class CallbackScript
{
public:
TSTR script; // callback script or script filename
Value* code; // cached compiled code
Value* id; // script ID
short flags; // flags
CallbackScript(TCHAR* iscript, Value* iid, short iflags)
{
script = iscript; code = NULL; id = iid; flags = iflags;
}
};
#define MCB_SCRIPT_IS_FILE 0x0001
#define MCB_PERSISTENT 0x0002
#define MCB_HAS_ID 0x0004
#define MCB_INVALID 0x0008
extern Tab<CallbackScript*>* callback_scripts[];
#endif

View File

@ -0,0 +1,63 @@
/************************************************************************
* ScriptEd.h - wrapper classes for script editor windows *
* *
* Author: Ravi Karra *
************************************************************************/
#ifndef _SCRIPTEDITOR_H
#define _SCRIPTEDITOR_H
#include "MaxScrpt.h"
#include "Listener.h"
// defines for script editor window menu items
#define IDM_NEW 10
#define IDM_OPEN 11
#define IDM_EVAL_ALL 40026
#define IDM_CLOSE 40024
// wrapper class for script editor windows
class ScriptEditor
{
TCHAR* editScript;
TSTR title;
protected:
WNDPROC originalWndProc;
IntTab disable_menus;
edit_window *ew;
HWND hScript;
public:
ScriptEditor(TCHAR* ititle=NULL) :
title(ititle),
ew(NULL),
hScript(NULL),
editScript(NULL) { }
~ScriptEditor() { if (editScript) delete editScript; editScript = NULL; }
virtual LRESULT APIENTRY proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
return CallWindowProc(originalWndProc, hwnd, uMsg, wParam, lParam);
}
ScripterExport virtual HWND DisplayWindow(HWND hParent=NULL/*for future use*/);
ScripterExport virtual void CloseWindow(bool notify=false);
ScripterExport virtual TCHAR* GetEditScript();
ScripterExport virtual void SetEditScript(TCHAR* script);
ScripterExport virtual void SetTitle(TCHAR* t) { title = t; }
ScripterExport virtual bool OnFileOpen(HWND hwnd);
ScripterExport virtual bool OnClose(HWND hwnd);
virtual TCHAR* GetTitle() { return title; }
virtual Value* GetValueTitle() { return (ew) ? ew->file_name : NULL; }
virtual bool OnExecute(HWND hwnd){ return false; } // return false to default handling
virtual bool IsDisplayed() { return ew!=NULL; }
virtual IntTab& GetDisabledMenuTab(){ return disable_menus; }
};
// open new editor on existing file, pop openfilename dialog if no filename supplied
// if ew is NULL, a new editor window is opened
ScripterExport void open_script(TCHAR* filename=NULL, edit_window *ew=NULL);
#endif //_SCRIPTEDITOR_H

View File

@ -0,0 +1,47 @@
/*
* ScrpCtrl.h - interface to scripter-based expression controllers
*
* John Wainwright
* Copyright <20> Autodesk, Inc. 1997
*/
#ifndef _H_SCRPTCTRL
#define _H_SCRPTCTRL
#define FLOAT_SCRIPT_CONTROL_CNAME GetString(IDS_RB_SCRIPTFLOAT)
#define FLOAT_SCRIPT_CONTROL_CLASS_ID Class_ID(0x498702e6, 0x71f11548)
#define POSITION_SCRIPT_CONTROL_CNAME GetString(IDS_RB_SCRIPTPOSITION)
#define POSITION_SCRIPT_CONTROL_CLASS_ID Class_ID(0x5065767b, 0x683a42a5)
#define POINT3_SCRIPT_CONTROL_CNAME GetString(IDS_RB_SCRIPTPOINT3)
#define POINT3_SCRIPT_CONTROL_CLASS_ID Class_ID(0x46972869, 0x2f7f05ce)
#define POINT4_SCRIPT_CONTROL_CNAME GetString(IDS_RB_SCRIPTPOINT4)
#define POINT4_SCRIPT_CONTROL_CLASS_ID Class_ID(0x46972870, 0x2f7f05cf)
#define ROTATION_SCRIPT_CONTROL_CNAME GetString(IDS_RB_SCRIPTROTATION)
#define ROTATION_SCRIPT_CONTROL_CLASS_ID Class_ID(0x31381912, 0x3a904166)
#define SCALE_SCRIPT_CONTROL_CNAME GetString(IDS_RB_SCRIPTSCALE)
#define SCALE_SCRIPT_CONTROL_CLASS_ID Class_ID(0x7c8f3a2a, 0x1e954d91)
#define PRS_SCRIPT_CONTROL_CNAME GetString(IDS_RB_SCRIPTPRS)
#define PRS_SCRIPT_CONTROL_CLASS_ID Class_ID(0x7f56455c, 0x1be66c68)
class IBaseScriptControl : public StdControl {
public:
virtual TCHAR* get_script_text() = 0;
virtual void set_script_text(TCHAR* text) = 0;
virtual bool update_refs() = 0;
virtual void depends_on(ReferenceTarget* ref) = 0;
};
#define push_control(_c) \
Control* _save_cc = thread_local(current_controller); \
thread_local(current_controller) = _c;
#define pop_control() \
thread_local(current_controller) = _save_cc;
#endif

View File

@ -0,0 +1,6 @@
// Protocol for Shadow Type class
def_visible_generic (CanDoOmni, "CanDoOmni");
def_visible_generic (SupportStdMapInterface, "SupportStdMapInterface");
def_visible_generic (MapSize, "MapSize");

View File

@ -0,0 +1,22 @@
/*
* stream_protocol.h - def_generics for Stream protocol
*
* Copyright <20> John Wainwright 1996
*/
def_visible_generic(read_value, "readValue");
def_visible_generic(read_expr, "readExpr");
def_visible_generic(read_line, "readLine");
def_visible_generic(read_char, "readChar");
def_visible_generic(read_chars, "readChars");
def_visible_generic(read_delimited_string, "readDelimitedString");
def_visible_generic(skip_to_string, "skipToString");
def_visible_generic(skip_to_next_line, "skipToNextLine");
def_visible_generic(execute, "execute");
def_visible_generic(file_pos, "filepos");
def_visible_generic(seek, "seek");
def_visible_generic(eof, "eof");
def_visible_generic(close, "close");
def_visible_generic(flush, "flush");

View File

@ -0,0 +1,166 @@
/*
* Streams.h - stream family for MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_STREAM
#define _H_STREAM
class Listener;
class FileStream;
class Parser;
visible_class (CharStream)
class CharStream : public Value
{
public:
classof_methods (CharStream, Value);
BOOL _is_charstream() { return 1; }
# define is_charstream(o) ((o)->_is_charstream())
virtual TCHAR get_char() = 0;
virtual void unget_char(TCHAR c) = 0;
virtual TCHAR peek_char() = 0;
virtual int at_eos() = 0;
virtual void rewind() = 0;
virtual int pos() { return 0; }
virtual void seek(int pos) { };
virtual void flush_to_eol() = 0;
virtual void flush_to_eobuf() {}
virtual void flush_whitespace();
virtual TCHAR putch(TCHAR c) { return c; }
virtual TCHAR* puts(TCHAR* str) { return str; }
virtual int printf(const TCHAR *format, ...) { return 0; }
virtual void close() {}
virtual void flush() {}
virtual void log_to(CharStream* log) {}
virtual void close_log() {}
virtual Listener* get_listener() { return NULL; }
virtual CharStream* get_log() { return NULL; }
virtual Value* get_file_name() { return NULL; }
};
visible_class (FileStream)
class FileStream : public CharStream
{
public:
Value* file_name;
TCHAR* mode;
FILE* file;
CharStream* log;
int ungetchar_count;
TCHAR ungetchar_buf[8];
Parser* reader;
DWORD decrypt; // was BOOL. russom - 10/09/2002
ScripterExport FileStream ();
ScripterExport ~FileStream ();
classof_methods (FileStream, CharStream);
# define is_filestream(v) ((v)->tag == class_tag(FileStream))
void collect() { delete this; }
void gc_trace();
ScripterExport void sprin1(CharStream* s);
#include "defimpfn.h"
# include "streampr.h"
/* internal char stream protocol */
ScripterExport TCHAR get_char();
ScripterExport void unget_char(TCHAR c);
ScripterExport TCHAR peek_char();
ScripterExport int at_eos();
ScripterExport int pos();
ScripterExport void seek(int pos);
ScripterExport void rewind();
ScripterExport void flush_to_eol();
ScripterExport TCHAR putch(TCHAR c);
ScripterExport TCHAR* puts(TCHAR* str);
ScripterExport int printf(const TCHAR *format, ...);
ScripterExport FileStream* open_decrypt(TCHAR* ifile_name, int seed);
ScripterExport FileStream* open(TCHAR* ifile_name, TCHAR* imode);
ScripterExport void flush();
ScripterExport void close();
void log_to(CharStream* log);
void close_log();
Value* get_file_name() { return file_name; }
void undo_lookahead();
void check_readable();
void check_writeable();
};
visible_class (WindowStream)
class WindowStream : public CharStream
{
public:
HWND window;
int cursor;
TCHAR* title;
Listener* listener;
CharStream* log;
TCHAR wputs_buf[512]; // edit control output buffer
TCHAR* wputs_p;
HWND echo;
WindowStream(HWND iwin);
WindowStream(TCHAR* title); /* for background scripts; window with given title will open if output generated */
~WindowStream();
classof_methods (WindowStream, CharStream);
void collect() { delete this; }
void gc_trace();
ScripterExport void sprin1(CharStream* s);
#include "defimpfn.h"
def_generic(sprint, "sprint");
use_generic( coerce, "coerce");
// use_generic( flush, "flush"); // LAM - defect 307041 - uncomment when SDK can change (tested)
/* internal TCHAR stream protocol */
TCHAR get_char() { return 0; }
void unget_char(TCHAR c) {}
TCHAR peek_char() {return 0; }
int at_eos() { return TRUE; }
void rewind() {}
void flush_to_eol() {}
ScripterExport TCHAR putch(TCHAR c);
ScripterExport TCHAR* puts(TCHAR* str);
ScripterExport int printf(const TCHAR *format, ...);
ScripterExport void flush();
void ensure_window_open();
void log_to(CharStream* log);
void close_log();
Listener* get_listener() { return listener; }
CharStream* get_log() { return log; }
// edit control output primitives
ScripterExport TCHAR* wputs(const TCHAR *str);
ScripterExport void wflush();
ScripterExport TCHAR wputch(const TCHAR c);
ScripterExport int wprintf(const TCHAR *format, ...);
void set_echo_window(HWND wnd) { echo = wnd; }
void echo_cur_line();
int get_cur_line(TSTR& line);
};
#endif

View File

@ -0,0 +1,98 @@
/*
* Strings.h - string family for MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
#ifndef _H_STRING
#define _H_STRING
#include "streams.h"
visible_class (String)
// Collectable::flags3 - bit 0 set if string is a literal
class String : public Value
{
TCHAR* string;
public:
ScripterExport String(TCHAR *init_string);
~String();
classof_methods (String, Value);
# define is_string(o) ((o)->tag == class_tag(String))
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* append(TCHAR* str);
Value* append(Value* str_val) { return append(str_val->to_string()); }
#include "defimpfn.h"
# include "strngpro.h"
def_property( count );
TCHAR* to_string();
TSTR to_filename();
void to_fpvalue(FPValue& v) { v.s = to_string(); v.type = TYPE_STRING; }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
friend class StringStream;
};
applyable_class (StringStream)
class StringStream : public CharStream
{
public:
TCHAR* content_string; /* the content string */
TCHAR* cursor; /* current read/write cursor */
size_t buf_len; /* allocated buffer length */
int ungetchar_count;
Parser* reader;
ScripterExport StringStream();
ScripterExport ~StringStream();
ScripterExport StringStream(TCHAR* init_string);
ScripterExport StringStream(int ilen);
ScripterExport StringStream(Value* init_string_value);
ScripterExport void init(TCHAR* init_string);
classof_methods (StringStream, CharStream);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
#include "defimpfn.h"
# include "streampr.h"
use_generic( coerce, "coerce");
use_generic( copy, "copy");
ScripterExport TCHAR get_char();
ScripterExport void unget_char(TCHAR c);
ScripterExport TCHAR peek_char();
ScripterExport int pos();
void seek(int pos);
ScripterExport int at_eos();
ScripterExport void rewind();
ScripterExport void set_size(int size);
ScripterExport void flush_to_eol();
ScripterExport void flush_to_eobuf();
ScripterExport void undo_lookahead();
ScripterExport TCHAR* puts(TCHAR* str);
ScripterExport TCHAR putch(TCHAR c);
ScripterExport int printf(const TCHAR *format, ...);
TCHAR* to_string();
void to_fpvalue(FPValue& v) { v.s = to_string(); v.type = TYPE_STRING; }
};
ScripterExport TSTR expand_file_name(TCHAR* file_name);
ScripterExport TSTR expand_file_dir(TCHAR* dir);
#endif

View File

@ -0,0 +1,28 @@
/*
* string_protocol.h - def_generics for the string protocol
*
* Copyright <20> John Wainwright 1996
*
*/
use_generic( plus, "+");
use_generic( eq, "=");
use_generic( ne, "!=");
use_generic( gt, ">");
use_generic( lt, "<");
use_generic( ge, ">=");
use_generic( le, "<=");
use_generic( get, "get");
use_generic( put, "put");
def_visible_generic( findString, "findString");
def_visible_generic( findPattern, "findPattern");
def_visible_generic( substring, "substring");
def_visible_generic( replace, "replace");
use_generic( append, "append"); // LAM - 5/28/02
use_generic( execute, "execute");
use_generic( coerce, "coerce");
use_generic( copy, "copy");

View File

@ -0,0 +1,69 @@
/* Structs.h - the MAXSript struct definition classes
*
* Copyright (c) John Wainwright, 1996
*
*/
#ifndef _H_STRUCT
#define _H_STRUCT
visible_class (StructDef)
class StructDef : public Value
{
public:
Value* name; /* struct's global var name */
Value** member_inits; /* member init vals */
int member_count; /* " count */
HashTable* members; /* member name to index table */
ScripterExport StructDef(Value* name, int member_count, Value** inits, HashTable* members);
~StructDef();
classof_methods (StructDef, Value);
# define is_structdef(o) ((o)->tag == class_tag(StructDef))
void collect() { delete this; }
void gc_trace();
ScripterExport void sprin1(CharStream* s);
#include "defimpfn.h"
def_generic ( get_props, "getPropNames"); // LAM: added 4/27/00
ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL);
ScripterExport Value* get_property(Value** arg_list, int count);
ScripterExport Value* set_property(Value** arg_list, int count);
};
class Struct : public Value
{
public:
StructDef* definition; /* pointer to my struct def */
Value** member_data; /* data elements, indexed via struct def hashtable */
ScripterExport Struct(StructDef* idef, int mem_count);
~Struct();
# define is_struct(o) ((o)->tag == INTERNAL_STRUCT_TAG)
Value* classOf_vf(Value** arg_list, int count);
Value* superClassOf_vf(Value** arg_list, int count);
Value* isKindOf_vf(Value** arg_list, int count);
BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(StructDef)) ? 1 : Value::is_kind_of(c); }
void collect() { delete this; }
void gc_trace();
ScripterExport void sprin1(CharStream* s);
#include "defimpfn.h"
use_generic ( copy, "copy" );
def_generic ( get_props, "getPropNames"); // LAM: added 4/27/00
Value* get_property(Value** arg_list, int count);
Value* set_property(Value** arg_list, int count);
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
#endif

View File

@ -0,0 +1,10 @@
/*
* texture_map_protocol.h - def_generics for the operations on MAX texture maps
*
* Copyright <20> John Wainwright 1997
*
*/
/* rendering */
def_visible_generic ( render_map, "renderMap");

View File

@ -0,0 +1,53 @@
/*
* thread_locals.h - thread locals for each interpreter thread in MAXScript
*
* Copyright <20> John Wainwright 1996
*
*/
/* thread locals and initial values */
def_thread_local( CharStream*, current_stdout, new (GC_IN_HEAP) WindowStream(_T("Script Output")));
def_thread_local( BOOL, force_listener_open, TRUE); // whether to force listener open on output to it
def_thread_local( Value**, current_frame, NULL); // current interpreter frame (for thunk evals)
def_thread_local( Value**, current_scan_frame, NULL); // current interpreter frame (for gc scanner)
def_thread_local( Value**, current_locals_frame, NULL); // C++ local frame
def_thread_local( Value*, current_result, NULL); // C++ current Value* function result
def_thread_local( long, stack_limit, 1024000); // max stack size to catch recurse loops, 1Mb to start
def_thread_local( LONG_PTR, stack_base, (LONG_PTR)_alloca(sizeof(int))); // current stack base
def_thread_local( MSPlugin*, current_plugin, NULL); // current scripted plugin (for plugin thunk evals)
def_thread_local( Struct*, current_struct, NULL); // current struct (for struct member thunk evals)
def_thread_local( Value*, current_container, NULL); // current container for nested property access
def_thread_local( int, container_index, 0); // current container index (if any)
def_thread_local( Value*, container_prop, NULL); // current container prop (if any)
def_thread_local( Value*, current_prop, NULL); // most recent prop access (if any)
def_thread_local( Value*, source_file, NULL); // current source file
def_thread_local( int, source_pos, 0); // current pos in source file
def_thread_local( BOOL, needs_redraw, 0);
def_thread_local( BOOL, redraw_mode, 1); // redraw on
def_thread_local( BOOL, pivot_mode, 0); // pivot off
def_thread_local( BOOL, undo_mode, 1); // undo on
def_thread_local( Value*, current_level, &all_objects); // $objects
def_thread_local( BOOL, use_time_context, 0); // use MAX time slider
def_thread_local( TimeValue, current_time, 0);
def_thread_local( Value*, current_coordsys, n_default);
def_thread_local( Value*, center_mode, n_default);
def_thread_local( int, rand_accum, 0); // for our own rand()
def_thread_local( HANDLE, message_event, NULL); // listener_message synch event
def_thread_local( int, stream_rand_accum, 0); // for stream_rand()
def_thread_local( MSZipPackage*, current_pkg, NULL); // currently open zip package, if any
def_thread_local( void*, alloc_frame, NULL); // top frame of allocator stack
def_thread_local( void*, alloc_tos, NULL); // top of allocator stack
def_thread_local( void*, alloc_stack_lim, NULL); // limit of allocator stack
def_thread_local( Control*, current_controller, NULL); // currently evaluating scripted controller
def_thread_local( String*, undo_label, new (GC_PERMANENT) String(_T("MAXScript"))); // current undo label
def_thread_local( BOOL, try_mode, 0); // try(...)
def_thread_local( MAXScriptException*, current_exception, NULL); // current exception that was thrown, if any. Non-null only in catch expression

View File

@ -0,0 +1,519 @@
/* Numbers.h - the Thunk family of classes - variable accessors for MAXScript
*
* Copyright (c) John Wainwright, 1996
*
*
*/
#ifndef _H_THUNKS
#define _H_THUNKS
#include "Name.h"
#include "Arrays.h"
#include "Rollouts.h"
#include "MouseTool.h"
#include "UIExtend.h"
/* ----------------------- Thunk ---------------------- */
visible_class (Thunk)
class Thunk : public Value
{
public:
Value* name;
BOOL clear_container; // outer-level prop in a prop sequence, clear current_container when done
classof_methods (Thunk, Value);
# define is_thunk(o) ((o)->_is_thunk())
# define is_indirect_thunk(o) ((o)->_is_indirect_thunk())
BOOL _is_thunk() { return TRUE; }
ScripterExport void gc_trace();
Thunk() : clear_container(FALSE), name(NULL) { }
Thunk* to_thunk() {return this; }
virtual Thunk* make_free_thunk(int level) { return NULL; }
void assign(Value* val) { assign_vf(&val, 1); }
ScripterExport Value* get_property(Value** arg_list, int count);
ScripterExport Value* set_property(Value** arg_list, int count);
};
/* -------------------- GlobalThunk ------------------- */
class GlobalThunk : public Thunk
{
public:
Value* cell;
ScripterExport GlobalThunk(Value* init_name) { init(init_name); }
ScripterExport GlobalThunk(Value* init_name, Value* init_val);
ScripterExport void init(Value* init_name);
# define is_globalthunk(p) ((p)->tag == INTERNAL_GLOBAL_THUNK_TAG)
ScripterExport Value* eval();
ScripterExport void gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* assign_vf(Value**arg_list, int count);
};
class ConstGlobalThunk : public GlobalThunk
{
public:
ConstGlobalThunk(Value* iname) : GlobalThunk(iname) { tag = INTERNAL_CONST_GLOBAL_THUNK_TAG; }
ConstGlobalThunk(Value* iname, Value* ival) : GlobalThunk(iname, ival) { tag = INTERNAL_CONST_GLOBAL_THUNK_TAG; }
# define is_constglobalthunk(p) ((p)->tag == INTERNAL_CONST_GLOBAL_THUNK_TAG)
Value* eval() { return cell->is_const() ? cell->copy_vf(NULL, 0) : cell; }
void collect() { delete this; }
Value* assign_vf(Value**arg_list, int count) { throw AssignToConstError (this); return &undefined; }
};
/* -------------------- SystemGlobalThunk ------------------- */
/* system globals are abstractions over some system state accessing functions, such as
* animation_range, current_renderer,e tc. */
class SystemGlobalThunk : public Thunk
{
Value* (*get_fn)();
Value* (*set_fn)(Value*);
public:
ScripterExport SystemGlobalThunk(Value* init_name, Value* (*iget)(), Value* (*iset)(Value*));
// LAM 4/1/00 - added following to prevent AF in name clash debugging output in HashTable::put_new()
# define is_systemglobalthunk(p) ((p)->tag == INTERNAL_SYS_GLOBAL_THUNK_TAG)
ScripterExport Value* eval();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s) { s->printf(_T("SystemGlobal:%s"), name->to_string()); }
Value* assign_vf(Value**arg_list, int count);
};
/* -------------------- LocalThunk ------------------- */
class LocalThunk : public Thunk
{
public:
int frame_level; // frame nest level at declaration
int index; // local var's index in local frame
LocalThunk(Value* init_name, int init_index, int iframe_lvl);
# define is_localthunk(p) ((p)->tag == INTERNAL_LOCAL_THUNK_TAG)
Thunk* make_free_thunk(int level);
Value* eval();
void collect() { delete this; }
void sprin1(CharStream* s);
Value* assign_vf(Value**arg_list, int count);
};
class IndirectLocalThunk : public LocalThunk
{
public:
IndirectLocalThunk(Value* init_name, int init_index, int iframe_lvl) :
LocalThunk(init_name, init_index, iframe_lvl) { }
BOOL _is_indirect_thunk() { return TRUE; }
Thunk* make_free_thunk(int level);
Value* eval();
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("&")); LocalThunk::sprin1(s); }
Value* assign_vf(Value**arg_list, int count);
};
// ContextThunk created from an IndirectLocal/FreeThunk on entry to a MAXScript function apply
// to contain the callers frame context for evals and assigns
class ContextThunk : public Thunk
{
public:
Thunk* thunk; // the wrapped thunk
Value** frame; // callers frame
ENABLE_STACK_ALLOCATE(ContextLocalThunk);
ContextThunk(Thunk* thunk, Value** frame) :
thunk(thunk), frame(frame) { }
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("&")); thunk->sprin1(s); }
Value* eval();
Value* assign_vf(Value**arg_list, int count);
};
/* -------------------- FreeThunk ------------------- */
class FreeThunk : public Thunk
{
public:
int level; // how many levels to reach back
int index; // index there
FreeThunk(Value* init_name, int level, int index);
# define is_freethunk(p) ((p)->tag == INTERNAL_FREE_THUNK_TAG)
Thunk* make_free_thunk(int level);
void collect() { delete this; }
void sprin1(CharStream* s);
Value* eval();
Value* assign_vf(Value**arg_list, int count);
};
class IndirectFreeThunk : public FreeThunk
{
public:
IndirectFreeThunk(Value* init_name, int level, int index) :
FreeThunk(init_name, level, index) { }
BOOL _is_indirect_thunk() { return TRUE; }
Thunk* make_free_thunk(int level);
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("&")); FreeThunk::sprin1(s); }
Value* eval();
Value* assign_vf(Value**arg_list, int count);
};
/* -------------------- ClosureFreeThunk ------------------- */
class ClosureFreeThunk : public Thunk
{
public:
ScripterExport Value* eval();
void gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
ClosureFreeThunk();
~ClosureFreeThunk();
};
/* -------------------- PropertyThunk ------------------- */
class PropertyThunk : public Thunk
{
public:
Value* target_code; // code to eval to get target
Value* property_name; // property name
getter_vf getter; // getter virtual fn for built-in properties
setter_vf setter; // setter " " " "
PropertyThunk(Value* target, Value* prop_name);
PropertyThunk(Value* target, Value* prop_name, getter_vf get_fn, setter_vf set_fn);
void gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
# define is_propertythunk(p) ((p)->tag == INTERNAL_PROP_THUNK_TAG)
ScripterExport Value* eval();
Value* assign_vf(Value**arg_list, int count);
Value* op_assign_vf(Value**arg_list, int count);
};
// a PropThunk subclass that is used when a Prop access occurs in a function call
// this is basically a hack to support OLE client method calls, since OLE IDISPATCH
// cannot distinguish methods from props
class FnCallPropertyThunk : public PropertyThunk
{
public:
FnCallPropertyThunk(Value* target, Value* prop_name, getter_vf get_fn, setter_vf set_fn)
: PropertyThunk (target, prop_name, get_fn, set_fn) {}
void collect() { delete this; }
ScripterExport Value* eval();
};
#ifdef USE_PROPERTY_PATH_THUNKS
/* PropertyPathThunk encodes a multi-level property access, such as $foo.twist.gizmo.pos.x
* in a single thunk so that MAXWrapper objects (and others that want) can look-ahead doing the whole path at once and
* not need backreferencing leaf-values for some of the funnier pseudo property accesses
* allowed in MAXScript */
class PropertyPathThunk : public Thunk
{
Value* target_code; // code to eval to get target
Array* property_path; // list of property names
public:
PropertyPathThunk(Value* target, Array* prop_path);
void gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* append_property(Value* prop_name);
ScripterExport Value* eval();
Value* assign_vf(Value**arg_list, int count);
};
#endif
/* -------------------- IndexThunk ------------------- */
class IndexThunk : public Thunk
{
Value* target_code; // code to eval to get target
Value* index_code; // code to eval to get index
public:
IndexThunk(Value* index);
# define is_indexthunk(o) ((o)->tag == INTERNAL_INDEX_THUNK_TAG)
void gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* set_target(Value* targ) { target_code = targ; return this; }
ScripterExport Value* eval();
Value* assign_vf(Value**arg_list, int count);
};
/* -------------------- RolloutControlThunk ------------------- */
class RolloutControlThunk : public Thunk
{
public:
int index;
Rollout* rollout;
RolloutControlThunk(Value* name, int control_index, Rollout* rollout);
BOOL _is_rolloutthunk() { return 1; }
# define is_rolloutthunk(o) ((o)->_is_rolloutthunk())
Value* eval() { return rollout->controls[index]; }
void ScripterExport gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* assign_vf(Value**arg_list, int count);
};
/* -------------------- RolloutLocalThunk ------------------- */
class RolloutLocalThunk : public Thunk
{
public:
int index;
Rollout* rollout;
RolloutLocalThunk(Value* name, int control_index, Rollout* rollout);
BOOL _is_rolloutthunk() { return 1; }
ScripterExport Value* eval();
void gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* assign_vf(Value**arg_list, int count);
};
class ConstRolloutLocalThunk : public RolloutLocalThunk
{
public:
ConstRolloutLocalThunk(Value* name, int control_index, Rollout* rollout)
: RolloutLocalThunk(name, control_index, rollout) { }
void collect() { delete this; }
Value* assign_vf(Value**arg_list, int count) { throw AssignToConstError (this); return &undefined; }
};
/* -------------------- ToolLocalThunk ------------------- */
class ToolLocalThunk : public Thunk
{
public:
int index;
MouseTool* tool;
ToolLocalThunk(Value* name, int iindex, MouseTool* tool);
ScripterExport Value* eval();
void gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* assign_vf(Value**arg_list, int count);
};
/* -------------------- CodeBlockLocalThunk ------------------- */
class CodeBlock;
class CodeBlockLocalThunk : public Thunk
{
public:
int index;
CodeBlock* block;
CodeBlockLocalThunk(Value* name, int iindex, CodeBlock* block);
ScripterExport Value* eval();
void gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* assign_vf(Value**arg_list, int count);
};
/* -------------------- RCMenuItemThunk ------------------- */
class RCMenuItemThunk : public Thunk
{
public:
int index;
RCMenu* rcmenu;
RCMenuItemThunk(Value* name, int item_index, RCMenu* menu);
BOOL _is_rolloutthunk() { return 1; }
# define is_rcmenuthunk(o) ((o)->_is_rcmenuthunk())
Value* eval() { return rcmenu->items[index]; }
void ScripterExport gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* assign_vf(Value**arg_list, int count);
};
/* -------------------- RCMenuLocalThunk ------------------- */
class RCMenuLocalThunk : public Thunk
{
public:
int index;
RCMenu* rcmenu;
RCMenuLocalThunk(Value* name, int iindex, RCMenu* menu);
BOOL _is_rcmenuthunk() { return 1; }
ScripterExport Value* eval();
void gc_trace();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* assign_vf(Value**arg_list, int count);
};
/* -------------------- PluginLocalThunk ------------------- */
class PluginLocalThunk : public Thunk
{
public:
int index; // access via current_plugin thread local
BOOL re_init; // indicate whether this local needs re-initialization on a redefinition (say for local rollouts, fns, etc.)
PluginLocalThunk(Value* name, int iindex, BOOL re_init = FALSE);
# define is_pluginlocalthunk(p) ((p)->tag == INTERNAL_PLUGIN_LOCAL_THUNK_TAG)
ScripterExport Value* eval();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* assign_vf(Value**arg_list, int count);
};
class ConstPluginLocalThunk : public PluginLocalThunk
{
public:
ConstPluginLocalThunk(Value* name, int iindex, BOOL re_init = FALSE) : PluginLocalThunk(name, iindex, re_init) { }
void collect() { delete this; }
Value* assign_vf(Value**arg_list, int count) { throw AssignToConstError (this); return &undefined; }
};
/* -------------------- PluginParamThunk ------------------- */
class PluginParamThunk : public Thunk
{
public:
PluginParamThunk(Value* name);
ScripterExport Value* eval();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* assign_vf(Value**arg_list, int count);
Value* get_container_property(Value* prop, Value* cur_prop);
Value* set_container_property(Value* prop, Value* val, Value* cur_prop);
};
#define push_plugin(_pi) \
MSPlugin* _save_cp = thread_local(current_plugin); \
thread_local(current_plugin) = _pi;
#define pop_plugin() \
thread_local(current_plugin) = _save_cp;
/* -------------------- StructMemberThunk ------------------- */
class StructMemberThunk : public Thunk
{
public:
int index; // access via current_plugin thread local
StructMemberThunk(Value* name, int iindex);
ScripterExport Value* eval();
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* assign_vf(Value**arg_list, int count);
};
/* -------------------- ThunkReference ------------------- */
// indirect thunk (eg, &foo)
class ThunkReference : public Thunk
{
public:
Thunk* target; // the target thunk
ScripterExport ThunkReference(Thunk* target);
# define is_thunkref(p) ((p)->tag == INTERNAL_THUNK_REF_TAG)
void gc_trace();
void collect() { delete this; }
void sprin1(CharStream* s);
Value* eval();
};
class DerefThunk : public Thunk // generated by a '*' prefix operator
{
public:
Value* target; // the target to deref
ScripterExport DerefThunk(Value* target);
void gc_trace();
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("*")); target->sprin1(s); }
Value* eval();
Value* assign_vf(Value**arg_list, int count);
};
#endif

View File

@ -0,0 +1,35 @@
/*
* MAX_time_functions.h - recursive animatable time functions
*
* Copyright <20> John Wainwright 1996
*
*/
/* time operations */
def_time_fn ( deleteTime );
def_time_fn ( reverseTime );
def_time_fn ( scaleTime );
def_time_fn ( insertTime );
def_time_fn ( setTimeRange );
/* key operations */
def_time_fn ( addNewKey );
def_time_fn ( deleteKeys );
// def_time_fn ( appendKey ); // RK: 6/19/02, Commenting these, breaks the SDK
// def_time_fn ( assignKey ); // RK: 6/19/02, Commenting these, breaks the SDK
def_time_fn ( selectKeys );
def_time_fn ( deselectKeys );
def_time_fn ( moveKeys );
def_time_fn ( mapKeys );
def_time_fn ( sortKeys );
def_time_fn ( reduceKeys );
/* ORT, ease/multiplier curves */
def_time_fn ( addEaseCurve );
def_time_fn ( deleteEaseCurve );
def_time_fn ( setBeforeORT );
def_time_fn ( setAfterORT );
def_time_fn ( enableORTs );

View File

@ -0,0 +1,27 @@
/*
* time_protocol.h - def_generics for the Time protocol
*
* see def_abstract_generics.h for more info.
*
*
* Copyright <20> John Wainwright 1996
*
*/
use_generic( plus, "+");
use_generic( minus, "-");
use_generic( times, "*");
use_generic( div, "/");
use_generic( uminus, "u-");
use_generic( eq, "=");
use_generic( ne, "!=");
use_generic( gt, ">");
use_generic( lt, "<");
use_generic( ge, ">=");
use_generic( le, "<=");
use_generic( random, "random");
use_generic( abs, "abs");
def_visible_primitive( normtime, "normtime" );

View File

@ -0,0 +1,9 @@
/*
* toolpro.h - def_generics for the operations on MouseTool
*
* Copyright <20> John Wainwright 1996
*/
def_visible_primitive(start_tool, "startTool");
def_visible_primitive(stop_tool, "stopTool");

View File

@ -0,0 +1,143 @@
/**********************************************************************
*<
FILE: UIExtend.h
DESCRIPTION: MaxScript user interface extensions
CREATED BY: Ravi Karra, 1998
HISTORY:
*> Copyright (c) 1994, All Rights Reserved.
**********************************************************************/
#ifndef _H_UIEXTEND
#define _H_UIEXTEND
#define MF_SUBMENU_START (MF_SEPARATOR+10)
#define MF_SUBMENU_END (MF_SEPARATOR+11)
class RCMenu;
visible_class (MenuItem)
class MenuItem : public Value
{
public:
Value *name, *caption, *flt_fn;
Value **keyparms;
RCMenu *menu;
int keyparm_count;
UINT flags;
MenuItem (RCMenu *m, Value* n, Value* c, Value **keyparms, int keyparm_count, UINT f=0);
MenuItem () {menu= NULL; name=caption=NULL; keyparms=NULL; flags=keyparm_count=0;}
~MenuItem ();
ScripterExport void setup_params();
void collect() { delete this; }
void gc_trace();
ScripterExport void sprin1(CharStream* s);
virtual Value* get_property(Value** arg_list, int count);
virtual Value* set_property(Value** arg_list, int count);
};
class MSRightClickMenu : public RightClickMenu
{
public:
RCMenu *menu;
void Init(RightClickMenuManager* manager, HWND hWnd, IPoint2 m);
void Selected(UINT id);
Value* call_filt_fn(Value* fn);
};
visible_class (RCMenu)
class RCMenu : public Value
{
public:
Value* name; // menu name
HashTable* local_scope; // local name space
MenuItem** items; // menu item array
int item_count; // " " count
Value** locals; // local var array
Value** local_inits; // " " " init vals
int local_count; // " " count
HashTable* handlers; // handler tables
short flags; // menu flags
BOOL init_values; // whether to init ctrl/local values on (re)open
BOOL end_rcmenu_mode; // signals end of rcmenu mode
MSRightClickMenu msmenu; // right-click menu
// command mode locals...
Value* result; // rcmenu result
MSPlugin* plugin; // current plugin under manip if non-NULL
RCMenu(short iflags);
void init(Value* name, int local_count, Value** inits, HashTable* local_scope, MenuItem** iitems, int iitem_count, HashTable* handlers);
~RCMenu();
classof_methods (RCMenu, Value);
void collect() { delete this; }
void gc_trace();
ScripterExport void sprin1(CharStream* s);
Value* get_event_handler(Value* name, Value* event);
BOOL call_event_handler(Value* name, Value* event, Value** arg_list, int count);
virtual Value* get_property(Value** arg_list, int count);
virtual Value* set_property(Value** arg_list, int count);
};
// LAM - 9/10/01
// The following classes have been added
// in 3ds max 4.2. If your plugin utilizes this new
// mechanism, be sure that your clients are aware that they
// must run your plugin with 3ds max version 4.2 or higher.
class MSSelectFilterCallback : public SelectFilterCallback
{
public:
MSSelectFilterCallback()
{
selectFilter_call_back_on = FALSE;
in_selectfilter_callback = FALSE;
}
TCHAR dname[128];
TCHAR* GetName() {return dname;};
BOOL IsFiltered(SClass_ID isid, Class_ID icid, INode *node);
Value* selectFilters_fns;
BOOL selectFilter_call_back_on;
BOOL in_selectfilter_callback;
};
class MSDisplayFilterCallback : public DisplayFilterCallback
{
public:
MSDisplayFilterCallback()
{
displayFilter_call_back_on = FALSE;
in_displayfilter_callback = FALSE;
}
TCHAR dname[128];
TCHAR* GetName() {return dname;};
BOOL IsVisible(SClass_ID isid, Class_ID icid, INode *node);
Value* displayFilters_fns;
BOOL displayFilter_call_back_on;
BOOL in_displayfilter_callback;
};
// End of 3ds max 4.2 Extension
#endif //_H_UIEXTEND

View File

@ -0,0 +1,546 @@
/* Value.h - metaclass system MAXScript values
*
* All MAXScript-specific C++ objects are subclasses of a single root class, Value,
* and allocated & automatically freed in a specially maintained heap. There is also
* a metaclass system to provide a runtime type calculus for the scripter. Value subclasses
* are divided into those that are scripter-visible, (ie, may wind up as objects that the
* scripter may pass around or store in variables, etc.), and those that are entirely
* internal to the scripter operation (such as thunks, etc.). The scripter-visible
* classes (the majority) are represented in the metasystem by instances of separate
* metaclasses. The metaclasses are all subclasses of ValueMetaClass, the metaclass of
* a class X is named XClass and its sole instance is X_class. The class instances are
* made visible in globals (usually) named X.
*
* Each Value instance has a tag word that either contains a pointer to the instance's
* class instance (in the case of scripter-visible classes) or the reserved value INTERNAL_CLASS_TAG.
* This value is used in performing runtimne type tests and for yielding results to classOf
* methods.
*
* The metaclass, its instance and some of the class calculus methods are usually defined via
* a bunch of macros defined here (see visible_class, visible_class_instance, etc.)
*
* Some of the classes are can be instanced directly as literals in a script, such as strings,
* Point3s, arrays, etc. Some others are instantiable directly by applying the class value
* to a set of initializing parameters, ie, using the class as a function in a function call,
* for example, ray, quat, interval, etc. These are defined via a variant macro: applyable_class().
* A special case of this is provided in the MAXWrapper subsytem for creatable MAX objects, such as
* boxes, lights, camera, etc.. These are represnted by instances of the class MAXClass, and again, thses
* instances are exposed in globals to be applied to creation paramters. These instances
* contain a lot of property metadata and are defined in MAX_classes.cpp. See MAXObject.h for more
* info.
*
* Copyright (c) John Wainwright, 1996
*
*/
#ifndef _H_VALUE
#define _H_VALUE
#include "Colctble.h"
#include "Max.h"
#include "STDMAT.H"
#include "Surf_api.h"
#include "Collect.h"
class Name;
#include "defextfn.h"
# include "corename.h"
// forward declarations...
class PathName;
class Undefined;
class UserProp;
class UserGeneric;
class CallContext;
extern ScripterExport Undefined undefined;
extern ScripterExport bool dontThrowAccessorError;
class ValueMetaClass;
typedef struct node_map node_map;
// the root MAXScript class
class Value : public Collectable
{
private:
ScripterExport static Matrix3 s_error_matrix;
ScripterExport static Box2 s_error_box2;
public:
ValueMetaClass* tag; // runtime type tag; filled in by subclasses
ScripterExport virtual BOOL is_kind_of(ValueMetaClass* c);
ScripterExport virtual ValueMetaClass* local_base_class(); // local base class in this class's plug-in
virtual Value* eval() { check_interrupts(); return this; }
virtual Value* eval_no_wrapper() { check_interrupts(); return this; }
ScripterExport virtual Value* apply(Value** arglist, int count, CallContext* cc=NULL);
virtual void export_to_scripter() { }
virtual Value* map(node_map& m) { unimplemented(_T("map"), this) ; return this; }
virtual Value* map_path(PathName* path, node_map& m) { unimplemented(_T("map_path"), this) ; return this; }
virtual Value* find_first(BOOL (*test_fn)(INode* node, int level, void* arg), void* test_arg) { unimplemented(_T("find_first"), this) ; return this; }
virtual Value* get_path(PathName* path) { unimplemented(_T("get"), this) ; return this; }
ScripterExport virtual void sprin1(CharStream* stream);
ScripterExport virtual void sprint(CharStream* stream);
virtual void prin1() { sprin1(thread_local(current_stdout)); }
virtual void print() { sprint(thread_local(current_stdout)); }
/* include all the protocol declarations */
#include "defabsfn.h"
# include "mathpro.h"
# include "vectpro.h"
# include "matpro.h"
# include "quatpro.h"
# include "arraypro.h"
# include "streampr.h"
# include "strngpro.h"
# include "timepro.h"
# include "colorpro.h"
# include "nodepro.h"
# include "ctrlrpro.h"
# include "prims.h"
# include "biprops.h"
# include "bitmapro.h"
# include "texmapro.h"
# include "atmspro.h"
# include "nurbspro.h"
# include "ctbmapro.h"
// MXSAgni specific -- START --
# include "bmatpro.h"
# include "boxpro.h"
# include "phyblpro.h"
# include "phymcpro.h"
# include "bipedpro.h"
# include "notespro.h"
# include "xrefspro.h"
// MXSAgni specific -- END --
ScripterExport virtual Class_ID get_max_class_id() { return Class_ID(0, 0); }
ScripterExport virtual Value* delete_vf(Value** arglist, int arg_count) { ABSTRACT_FUNCTION(_T("delete"), this, Value*); }
ScripterExport virtual Value* clearSelection_vf(Value** arglist, int arg_count) { ABSTRACT_FUNCTION(_T("clearSelection"), this, Value*); }
#undef def_generic
#define def_generic(fn, name) ScripterExport virtual Value* fn##_vf(Value** arglist, int arg_count);
# include "kernlpro.h"
virtual float to_float() { ABSTRACT_CONVERTER(float, Float); }
virtual TCHAR* to_string() { ABSTRACT_CONVERTER(TCHAR*, String); }
virtual TSTR to_filename() { ABSTRACT_CONVERTER(TCHAR*, FileName); }
virtual int to_int() { ABSTRACT_CONVERTER(int, Integer); }
virtual BOOL to_bool() { ABSTRACT_CONVERTER(BOOL, Boolean); }
virtual BitArray& to_bitarray() { throw ConversionError (this, _T("BitArray")); return *(BitArray*)NULL; }
virtual Point4 to_point4() { ABSTRACT_CONVERTER(Point4, Point4); }
virtual Point3 to_point3() { ABSTRACT_CONVERTER(Point3, Point3); }
virtual Point2 to_point2() { ABSTRACT_CONVERTER(Point2, Point2); }
virtual AColor to_acolor() { throw ConversionError (this, _T("Color")); return AColor(0,0,0); }
virtual COLORREF to_colorref() { throw ConversionError (this, _T("Color")); return RGB(0,0,0); }
virtual INode* to_node() { ABSTRACT_CONVERTER(INode*, <node>); }
virtual Ray to_ray() { throw ConversionError (this, _T("Ray")); return Ray(); }
virtual Interval to_interval() { throw ConversionError (this, _T("Interval")); return Interval(); }
virtual Quat to_quat() { throw ConversionError (this, _T("Quaternion")); return Quat(); }
virtual AngAxis to_angaxis() { throw ConversionError (this, _T("AngleAxis")); return AngAxis(); }
virtual Matrix3& to_matrix3() { throw ConversionError (this, _T("Matrix")); return s_error_matrix; }
virtual float* to_eulerangles() { ABSTRACT_CONVERTER(float*, Float); }
virtual Mtl* to_mtl() { ABSTRACT_CONVERTER(Mtl*, Material); }
virtual Texmap* to_texmap() { ABSTRACT_CONVERTER(Texmap*, TextureMap); }
virtual MtlBase* to_mtlbase() { ABSTRACT_CONVERTER(MtlBase*, MtlBase); }
virtual Modifier* to_modifier() { ABSTRACT_CONVERTER(Modifier*, Modifier); }
virtual TimeValue to_timevalue() { ABSTRACT_CONVERTER(TimeValue, Time); }
virtual Control* to_controller() { ABSTRACT_CONVERTER(Control*, Controller); }
virtual Atmospheric* to_atmospheric() { ABSTRACT_CONVERTER(Atmospheric*, Atmospheric); }
virtual Effect* to_effect() { ABSTRACT_CONVERTER(Effect*, Effect); } // RK: Added this
virtual IMultiPassCameraEffect* to_mpassCamEffect() { ABSTRACT_CONVERTER(IMultiPassCameraEffect*, Effect); } // LAM: Added this
virtual ShadowType* to_shadowtype() { ABSTRACT_CONVERTER(ShadowType*, ShadowType); } // RK: Added this
virtual FilterKernel* to_filter() { ABSTRACT_CONVERTER(FilterKernel*, FilterKernel); } // RK: Added this
virtual INode* to_rootnode() { ABSTRACT_CONVERTER(INode*, <root>); } // RK: Added this
virtual ITrackViewNode* to_trackviewnode() { ABSTRACT_CONVERTER(ITrackViewNode*, TrackViewNode); }
virtual NURBSIndependentPoint* to_nurbsindependentpoint() { throw ConversionError (this, _T("NURBSIndependentPoint")); return (NURBSIndependentPoint*)0; }
virtual NURBSPoint* to_nurbspoint() { throw ConversionError (this, _T("NURBSPoint")); return (NURBSPoint*)0; }
virtual NURBSObject* to_nurbsobject() { throw ConversionError (this, _T("NURBSObject")); return (NURBSObject*)0; }
virtual NURBSControlVertex* to_nurbscontrolvertex() { throw ConversionError (this, _T("NURBSControlVertex")); return (NURBSControlVertex*)0; }
virtual NURBSCurve* to_nurbscurve() { throw ConversionError (this, _T("NURBSCurve")); return (NURBSCurve*)0; }
virtual NURBSCVCurve* to_nurbscvcurve() { throw ConversionError (this, _T("NURBSCVCurve")); return (NURBSCVCurve*)0; }
virtual NURBSSurface* to_nurbssurface() { throw ConversionError (this, _T("NURBSSurface")); return (NURBSSurface*)0; }
virtual NURBSTexturePoint* to_nurbstexturepoint() { throw ConversionError (this, _T("NURBSTexturePoint")); return (NURBSTexturePoint*)0; }
virtual NURBSSet* to_nurbsset() { throw ConversionError (this, _T("NURBSSet")); return (NURBSSet*)0; }
virtual ReferenceTarget* to_reftarg() { ABSTRACT_CONVERTER(ReferenceTarget*, MaxObject); }
virtual Mesh* to_mesh() { ABSTRACT_CONVERTER(Mesh*, Mesh); }
virtual Thunk* to_thunk() { ABSTRACT_CONVERTER(Thunk*, &-reference); }
virtual void to_fpvalue(FPValue& v) { throw ConversionError (this, _T("FPValue")); }
virtual Renderer* to_renderer() { ABSTRACT_CONVERTER(Renderer*, Renderer); } // LAM: Added this 9/15/01
// MXSAgni specific -- START --
virtual Box2& to_box2() { throw ConversionError (this, _T("Box2")); return s_error_box2; }
// MXSAgni specific -- END --
virtual NURBSTextureSurface* to_nurbstexturesurface() { throw ConversionError (this, _T("NURBSTextureSurface")); return (NURBSTextureSurface*)0; }
virtual NURBSDisplay* to_nurbsdisplay() { throw ConversionError (this, _T("NURBSDisplay")); return (NURBSDisplay*)0; }
virtual TessApprox* to_tessapprox() { throw ConversionError (this, _T("TessApprox")); return (TessApprox*)0; }
virtual Value* widen_to(Value* arg, Value** arg_list) { ABSTRACT_WIDENER(arg); }
virtual BOOL comparable(Value* arg) { return (tag == arg->tag); }
virtual BOOL is_const() { return FALSE; }
// LAM - 7/8/03 - defect 504956 - following identifies classes that derive from MAXWrapper. Only other implementation is in MAXWrapper
// used by garbage collector to prevent collection of MAXWrapper-derived values while doing light collection
virtual BOOL derives_from_MAXWrapper() { return FALSE; }
ScripterExport virtual Value* get_property(Value** arg_list, int count);
ScripterExport virtual Value* set_property(Value** arg_list, int count);
ScripterExport Value* _get_property(Value* prop);
ScripterExport virtual Value* _set_property(Value* prop, Value* val);
virtual Value* get_container_property(Value* prop, Value* cur_prop) { if (!dontThrowAccessorError) throw AccessorError (cur_prop, prop); return NULL; }
// Win64 Cleanup: Shuler
virtual Value* set_container_property(Value* prop, Value* val, Value* cur_prop) { throw AccessorError (cur_prop, prop); return NULL;}
// Win64 Cleanup: Shuler
#ifdef USE_PROPERTY_PATH_THUNKS
virtual Value* get_property_path(Value** arg_list, int count);
virtual Value* set_property_path(Value** arg_list, int count);
#endif
// polymorphic default type predicates - abstracted over by is_x(v) macros as needed
virtual BOOL _is_collection() { return FALSE; }
virtual BOOL _is_charstream() { return FALSE; }
virtual BOOL _is_rolloutcontrol() { return FALSE; }
virtual BOOL _is_rolloutthunk() { return FALSE; }
virtual BOOL _is_function() { return FALSE; }
virtual BOOL _is_selection() { return FALSE; }
virtual BOOL _is_thunk() { return FALSE; }
virtual BOOL _is_indirect_thunk() { return FALSE; }
// yield selection set iterator if you can
virtual SelectionIterator* selection_iterator() { throw RuntimeError (_T("Operation requires a selection (Array or BitArray)")); return NULL; }
// scene persistence functions
ScripterExport virtual IOResult Save(ISave* isave);
// the Load fn is a static method on loadbale classes, see SceneIO.cpp & .h and each loadable class
// called during MAX exit to have all MAXScript-side refs dropped (main implementation in MAXWrapper)
virtual void drop_MAX_refs() { }
// access ID'd FPInterface if supported
virtual BaseInterface* GetInterface(Interface_ID id) { return NULL; }
// stack allocation routines
ScripterExport Value* make_heap_permanent();
ScripterExport Value* make_heap_static() { Value* v = make_heap_permanent(); v->flags |= GC_STATIC; return v; }
ScripterExport Value* get_heap_ptr() { if (!has_heap_copy()) return migrate_to_heap(); return is_on_stack() ? get_stack_heap_ptr() : this; }
ScripterExport Value* get_stack_heap_ptr() { return (Value*)next; }
ScripterExport Value* migrate_to_heap();
ScripterExport Value* get_live_ptr() { return is_on_stack() && has_heap_copy() ? get_stack_heap_ptr() : this; }
};
inline Value* heap_ptr(Value* v) { return v ? v->get_heap_ptr() : NULL; } // ensure v is in heap, migrate if not, return heap pointer
inline Value* live_ptr(Value* v) { return v->get_live_ptr(); } // get live pointer, if on stack & migrated, heap copy is live
/* ---------- the base class for all metaclasses ---------- */
class MetaClassClass;
extern MetaClassClass value_metaclass; // the metaclass class
class ValueMetaClass : public Value
{
public:
TCHAR* name;
UserProp* user_props; // additional, user defined property accessors
short uprop_count;
UserGeneric* user_gens; // " " " generic fns
short ugen_count;
Tab<FPInterfaceDesc*> prop_interfaces; // static interfaces who methods appear as properties on instances of the class
ValueMetaClass() { }
ScripterExport ValueMetaClass(TCHAR* iname);
ScripterExport BOOL is_kind_of(ValueMetaClass* c);
# define is_valueclass(o) ((o)->tag == (ValueMetaClass*)&value_metaclass)
ScripterExport void sprin1(CharStream* s);
ScripterExport void export_to_scripter();
ScripterExport void add_user_prop(TCHAR* prop, value_cf getter, value_cf setter);
ScripterExport void add_user_generic(TCHAR* name, value_cf fn);
ScripterExport UserGeneric* find_user_gen(Value* name);
ScripterExport UserProp* find_user_prop(Value* prop);
// static property interfaces
ScripterExport void add_prop_interface(FPInterfaceDesc* fpd) { prop_interfaces.Append(1, &fpd); }
ScripterExport int num_prop_interfaces() { return prop_interfaces.Count(); }
ScripterExport FPInterfaceDesc* get_prop_interface(int i) { return prop_interfaces[i]; }
/* #include "defimpfn.h"
// subclass & instance virtual array accessors
def_prop_getter(subclasses);
def_prop_getter(instances);
*/
};
#define classof_methods(_cls, _super) \
Value* classOf_vf(Value** arg_list, int count) \
{ \
check_arg_count(classOf, 1, count + 1); \
return &_cls##_class; \
} \
Value* superClassOf_vf(Value** arg_list, int count) \
{ \
check_arg_count(superClassOf, 1, count + 1); \
return &_super##_class; \
} \
Value* isKindOf_vf(Value** arg_list, int count) \
{ \
check_arg_count(isKindOf, 2, count + 1); \
return (arg_list[0] == &_cls##_class) ? \
&true_value : \
_super::isKindOf_vf(arg_list, count); \
} \
BOOL is_kind_of(ValueMetaClass* c) \
{ \
return (c == &_cls##_class) ? 1 \
: _super::is_kind_of(c); \
}
#define visible_class(_cls) \
class _cls##Class : public ValueMetaClass \
{ \
public: \
_cls##Class(TCHAR* name) : ValueMetaClass (name) { } \
void collect() { delete this; } \
}; \
extern ScripterExport _cls##Class _cls##_class;
#define visible_class_s(_cls, _super) \
class _cls##Class : public ValueMetaClass \
{ \
public: \
_cls##Class(TCHAR* name) : ValueMetaClass (name) { } \
void collect() { delete this; } \
Value* classOf_vf(Value** arg_list, int count) \
{ \
check_arg_count(classOf, 1, count + 1); \
return &_super##_class; \
} \
Value* superClassOf_vf(Value** arg_list, int count) \
{ \
return _super##_class.classOf_vf(NULL, 0); \
} \
}; \
extern ScripterExport _cls##Class _cls##_class;
#define applyable_class(_cls) \
class _cls##Class : public ValueMetaClass \
{ \
public: \
_cls##Class(TCHAR* name) : ValueMetaClass (name) { }\
void collect() { delete this; } \
ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL); \
}; \
extern ScripterExport _cls##Class _cls##_class;
#define applyable_class_s(_cls, _super) \
class _cls##Class : public ValueMetaClass \
{ \
public: \
_cls##Class(TCHAR* name) : ValueMetaClass (name) { }\
Value* classOf_vf(Value** arg_list, int count) \
{ \
check_arg_count(classOf, 1, count + 1); \
return &_super##_class; \
} \
Value* superClassOf_vf(Value** arg_list, int count) \
{ \
return _super##_class.classOf_vf(NULL, 0); \
} \
void collect() { delete this; } \
ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL); \
}; \
extern ScripterExport _cls##Class _cls##_class;
#define visible_class_instance(_cls, _name) \
ScripterExport _cls##Class _cls##_class (_T(_name));
#define class_tag(_cls) &_cls##_class
#define INTERNAL_CLASS_TAG ((ValueMetaClass*)0L)
#define INTERNAL_INDEX_THUNK_TAG ((ValueMetaClass*)1L)
#define INTERNAL_PROP_THUNK_TAG ((ValueMetaClass*)2L)
#define INTERNAL_LOCAL_THUNK_TAG ((ValueMetaClass*)3L)
#define INTERNAL_FREE_THUNK_TAG ((ValueMetaClass*)4L)
#define INTERNAL_RO_LOCAL_THUNK_TAG ((ValueMetaClass*)5L)
#define INTERNAL_CODE_TAG ((ValueMetaClass*)6L)
#define INTERNAL_SOURCEWRAPPER_TAG ((ValueMetaClass*)7L)
#define INTERNAL_PIPE_TAG ((ValueMetaClass*)8L)
#define INTERNAL_TOOL_LOCAL_THUNK_TAG ((ValueMetaClass*)9L)
#define INTERNAL_GLOBAL_THUNK_TAG ((ValueMetaClass*)10L)
#define INTERNAL_CONST_GLOBAL_THUNK_TAG ((ValueMetaClass*)11L)
#define INTERNAL_SYS_GLOBAL_THUNK_TAG ((ValueMetaClass*)12L)
#define INTERNAL_PLUGIN_LOCAL_THUNK_TAG ((ValueMetaClass*)13L)
#define INTERNAL_PLUGIN_PARAM_THUNK_TAG ((ValueMetaClass*)14L)
#define INTERNAL_RCMENU_LOCAL_THUNK_TAG ((ValueMetaClass*)15L)
#define INTERNAL_STRUCT_MEM_THUNK_TAG ((ValueMetaClass*)16L)
#define INTERNAL_MSPLUGIN_TAG ((ValueMetaClass*)17L)
#define INTERNAL_STRUCT_TAG ((ValueMetaClass*)18L)
#define INTERNAL_MAKER_TAG ((ValueMetaClass*)19L)
#define INTERNAL_CODEBLOCK_LOCAL_TAG ((ValueMetaClass*)20L)
#define INTERNAL_CODEBLOCK_TAG ((ValueMetaClass*)21L)
#define INTERNAL_THUNK_REF_TAG ((ValueMetaClass*)22L)
#define INTERNAL_THUNK_DEREF_TAG ((ValueMetaClass*)23L)
#define INTERNAL_STRUCT_METHOD_TAG ((ValueMetaClass*)24L) // LAM - defect 307069
#define INTERNAL_MSPLUGIN_METHOD_TAG ((ValueMetaClass*)25L) // LAM - 9/6/02 - defect 291499
#define INTERNAL_TAGS ((ValueMetaClass*)100L) // must be higher than all internal tags
visible_class (Value)
/* ---------- the distinguished value subclasses ---------- */
visible_class (Boolean)
class Boolean;
class ValueLoader;
extern ScripterExport Boolean true_value;
extern ScripterExport Boolean false_value;
class Boolean : public Value
{
public:
Boolean() { tag = &Boolean_class; }
classof_methods (Boolean, Value);
void collect() { delete this; }
void sprin1(CharStream* s);
# define is_bool(o) ((o)->tag == &Boolean_class)
Value* not_vf(Value**arg_list, int count);
BOOL to_bool() { return this == &true_value; }
void to_fpvalue(FPValue& v) { v.i = (this == &true_value) ? 1 : 0; v.type = (ParamType2)TYPE_BOOL; }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
/* ----- */
visible_class (Undefined)
class Undefined : public Value
{
public:
Undefined() { tag = &Undefined_class; }
classof_methods (Undefined, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
Value* copy_vf(Value** arg_list, int count) { return this; }
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
Mtl* to_mtl() { return NULL; } // undefined is a NULL material
};
extern ScripterExport Undefined undefined;
extern ScripterExport Undefined dontCollect;
extern ScripterExport Undefined loopExit;
/* ----- */
visible_class (Ok)
class Ok : public Value
{
public:
Ok() { tag = &Ok_class; }
classof_methods (Ok, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
extern ScripterExport Ok ok;
/* ----- */
visible_class (Empty)
class Empty : public Value
{
public:
Empty() { tag = &Empty_class; }
classof_methods (Empty, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
};
extern ScripterExport Empty empty;
/* ----- */
visible_class (Unsupplied)
class Unsupplied : public Value
{
public:
Unsupplied() { tag = &Unsupplied_class; }
classof_methods (Unsupplied, Value);
void collect() { delete this; }
ScripterExport void sprin1(CharStream* s);
// scene I/O
IOResult Save(ISave* isave);
static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
};
extern ScripterExport Unsupplied unsupplied;
/* ---------- subclass and instance virtual arrays ----------
visible_class (SubclassArray)
class SubclassArray : Value
{
public:
ValueMetaClass* theClass; // whose subclasses we represent
SubclassArray(ValueMetaClass* cls);
classof_methods (SubclassArray, Value);
BOOL _is_collection() { return 1; }
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("<Subclasses of %s>"), theClass->name); }
// operations
Value* map(node_map& m);
Value* get_vf(Value** arg_list, int count);
// built-in property accessors
def_property ( count );
};
visible_class (InstanceArray)
class InstanceArray : Value
{
public:
ValueMetaClass* theClass; // whose instances we represent
InstanceArray(ValueMetaClass* cls);
classof_methods (InstanceArray, Value);
BOOL _is_collection() { return 1; }
void collect() { delete this; }
void sprin1(CharStream* s) { s->printf(_T("<Instances of %s>"), theClass->name); }
// operations
Value* map(node_map& m);
Value* get_vf(Value** arg_list, int count);
// built-in property accessors
def_property ( count );
};
*/
#endif

View File

@ -0,0 +1,26 @@
/*
* vector_protocol.h - def_generics for Vector protocol
*
* see def_abstract_generics.h for more info.
*
*
* Copyright <20> John Wainwright 1996
*
*/
use_generic( plus, "+" );
use_generic( minus, "-" );
use_generic( times, "*" );
use_generic( div, "/" );
use_generic( uminus, "u-");
use_generic( eq, "=");
use_generic( ne, "!=");
use_generic( random, "random");
def_visible_generic( length, "length");
def_visible_generic( dot, "dot");
def_visible_generic( cross, "cross");
def_visible_generic( normalize, "normalize");
def_visible_generic( distance, "distance");

View File

@ -0,0 +1,46 @@
/*
* WireCtrl.h - interface to parameter-wiring controllers
*
* John Wainwright
* Copyright <20> Autodesk, Inc. 1999
*/
#ifndef _H_WIRETCTRL
#define _H_WIRETCTRL
#define FLOAT_WIRE_CONTROL_CNAME _T("Float Wire") //GetString(IDS_RB_WIREFLOAT)
#define FLOAT_WIRE_CONTROL_CLASS_ID Class_ID(0x498702e7, 0x71f11549)
#define POSITION_WIRE_CONTROL_CNAME _T("Position Wire") //GetString(IDS_RB_WIREPOSITION)
#define POSITION_WIRE_CONTROL_CLASS_ID Class_ID(0x5065767c, 0x683a42a6)
#define POINT3_WIRE_CONTROL_CNAME _T("Point3 Wire") //GetString(IDS_RB_WIREPOINT3)
#define POINT3_WIRE_CONTROL_CLASS_ID Class_ID(0x4697286a, 0x2f7f05cf)
#define ROTATION_WIRE_CONTROL_CNAME _T("Rotation Wire") //GetString(IDS_RB_WIREROTATION)
#define ROTATION_WIRE_CONTROL_CLASS_ID Class_ID(0x31381913, 0x3a904167)
#define SCALE_WIRE_CONTROL_CNAME _T("Scale Wire") //GetString(IDS_RB_WIRESCALE)
#define SCALE_WIRE_CONTROL_CLASS_ID Class_ID(0x7c8f3a2b, 0x1e954d92)
typedef short ParamID;
class IBaseWireControl : public StdControl {
public:
// number of wires, wire param access
virtual int get_num_wires()=0; // how many wires out of this controller (number of dependent params)
virtual Animatable* get_wire_anim(int i)=0; // get ith dependent parameter animatable
virtual int get_wire_subnum(int i)=0; // get ith dependent parameter subanim num in the animatable
// transfer expression script
virtual TCHAR* get_expr_text(int i)=0;
virtual void set_expr_text(int i, TCHAR* text)=0;
// animation sub-controller
virtual void set_slave_animation(Control* c)=0;
virtual Control* get_animation()=0;
virtual bool is_master()=0;
virtual bool is_slave()=0;
};
#endif

View File

@ -0,0 +1,6 @@
// xrefs_protocol.h - def_generics for XRefs protocol
def_visible_generic ( merge_xref_file, "merge");
use_generic ( updateXRef, "updateXRef");
def_visible_generic ( flag_xref_changed, "flagChanged");
use_generic ( delete, "delete");