00001
00002
00003
00004
00005
00006
00007
00008 #pragma once
00009
00010 #include "..\kernel\value.h"
00011 #include "..\foundation\collection.h"
00012 #include "..\..\3dsmaxport.h"
00013 #include "..\..\buildver.h"
00014 #include "..\..\object.h"
00015 #include "..\..\surf_api.h"
00016 #include "..\..\tvnode.h"
00017 #include "..\..\triobj.h"
00018
00019
00020 class ScaleValue;
00021 class MNMesh;
00022 class GenericNamedSelSetList;
00023 class IMeshSelectData;
00024 class PatchObject;
00025 class IPatchSelectData;
00026 class ClassDesc2;
00027 struct ParamDef;
00028 class TrackViewUtility;
00029 class CustAttrib;
00030 class Array;
00031 class HashTable;
00032
00033 extern ScripterExport Interface* MAXScript_interface;
00034 extern ScripterExport Interface7* MAXScript_interface7;
00035 extern ScripterExport Interface8* MAXScript_interface8;
00036 extern ScripterExport Interface9* MAXScript_interface9;
00037 extern ScripterExport Interface11* MAXScript_interface11;
00038 extern ScripterExport Interface13* MAXScript_interface13;
00039 class MAXControl;
00040
00041 #define MESH_READ_ACCESS 0 // mesh access modes
00042 #define MESH_WRITE_ACCESS 1
00043 #define MESH_BASE_OBJ 2
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 extern ScripterExport MCHAR* get_deleted_obj_err_message();
00056
00057 #define check_for_deletion_test() \
00058 ( ref_deleted || \
00059 ( NumRefs() > 0 && (GetReference(0) == NULL) ) || \
00060 ( NumRefs() > 0 && \
00061 GetReference(0)->TestAFlag(A_IS_DELETED) && \
00062 ( (GetReference(0)->GetInterface(INODE_INTERFACE)==NULL) || \
00063 (((INode*)GetReference(0))->GetTMController() == NULL) || \
00064 (((INode*)GetReference(0))->GetParentNode() == NULL) \
00065 ) \
00066 ) \
00067 )
00068 #define check_for_deletion() if (check_for_deletion_test()) throw RuntimeError (get_deleted_obj_err_message(), class_name());
00069 #define deletion_check_test(val) \
00070 ( (val)->ref_deleted || \
00071 ( (val)->NumRefs() > 0 && ((val)->GetReference(0) == NULL) ) || \
00072 ( (val)->NumRefs() > 0 && \
00073 (val)->GetReference(0)->TestAFlag(A_IS_DELETED) && \
00074 ( ((val)->GetReference(0)->GetInterface(INODE_INTERFACE)==NULL) || \
00075 (((INode*)(val)->GetReference(0))->GetTMController() == NULL) || \
00076 (((INode*)(val)->GetReference(0))->GetParentNode() == NULL) \
00077 ) \
00078 ) \
00079 )
00080 #define deletion_check(val) if (deletion_check_test(val)) throw RuntimeError (get_deleted_obj_err_message(), (val)->class_name());
00081
00082
00083
00084
00085 visible_class (MAXWrapper)
00086
00087 class MAXWrapper : public Value, public ReferenceTarget
00088 {
00089 public:
00090 Tab<RefTargetHandle> refs;
00091 short ref_deleted;
00092
00093 ScripterExport MAXWrapper();
00094 ScripterExport virtual ~MAXWrapper();
00095
00096
00097 using Collectable::operator new;
00098 using Collectable::operator delete;
00099
00100 ScripterExport Value* classOf_vf(Value** arg_list, int count);
00101 ScripterExport Value* superClassOf_vf(Value** arg_list, int count);
00102 ScripterExport Value* isKindOf_vf(Value** arg_list, int count);
00103 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXWrapper)) ? 1 : Value::is_kind_of(c); }
00104 ScripterExport BOOL not_on_undo_stack();
00105 void collect() { if (not_on_undo_stack()) delete this; }
00106 ScripterExport void gc_trace();
00107 virtual MCHAR* class_name() = 0;
00108 virtual ReferenceTarget* get_max_object() { return (NumRefs()) ? GetReference(0) : NULL; }
00109 ScripterExport Value* copy_no_undo(Value** arg_list, int count);
00110 BOOL derives_from_MAXWrapper() { return TRUE; }
00111
00112 ScripterExport void make_ref(int ref_no, ReferenceTarget* ref);
00113 void drop_MAX_refs() { DeleteAllRefsFromMe(); }
00114
00115 bool can_collect_in_gc_light();
00116
00117
00118 Class_ID ClassID() { return Class_ID(MAXSCRIPT_WRAPPER_CLASS_ID, 0); }
00119 SClass_ID SuperClassID() { return MAXSCRIPT_WRAPPER_CLASS_ID; }
00120
00121
00122 int NumRefs() { return refs.Count(); }
00123 RefTargetHandle GetReference(int i) { return refs[i]; }
00124 protected:
00125 ScripterExport virtual void SetReference(int i, RefTargetHandle rtarg);
00126 public:
00127 ScripterExport RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message);
00128 ScripterExport void DeleteThis();
00129 #pragma warning(push)
00130 #pragma warning(disable:4100)
00131 BOOL CanTransferReference(int i) { return FALSE; }
00132
00133
00134
00135 ScripterExport BOOL IsRealDependency(ReferenceTarget *rtarg);
00136
00137
00138 ScripterExport Value* get_property(Value** arg_list, int count);
00139 ScripterExport Value* set_property(Value** arg_list, int count);
00140
00141
00142 static ScripterExport Value* get_property(ReferenceTarget* ref, Value* prop, Value* owner);
00143 static ScripterExport Value* set_property(ReferenceTarget* ref, Value* prop, Value* val);
00144
00145 #ifdef def_generic
00146 # undef def_generic
00147 # undef def_generic_debug_ok
00148 # undef def_property
00149 # undef def_2_prop_path
00150 # undef def_nested_prop
00151 #endif
00152 #ifdef def_prop_getter
00153 # undef def_prop_getter
00154 # undef def_prop_setter
00155 #endif
00156
00157 #define def_generic(fn, name) \
00158 ScripterExport Value* fn##_vf(Value** arglist, int arg_count)
00159
00160 #define def_generic_debug_ok(fn, name) \
00161 ScripterExport Value* fn##_vf(Value** arglist, int arg_count)
00162
00163 #define def_property(p) \
00164 ScripterExport Value* get_##p(Value** arg_list, int count); \
00165 ScripterExport Value* set_##p(Value** arg_list, int count)
00166 #define def_prop_getter(p) \
00167 ScripterExport Value* get_##p(Value** arg_list, int count)
00168 #define def_prop_setter(p) \
00169 ScripterExport Value* set_##p(Value** arg_list, int count)
00170 #define def_2_prop_path(p1, p2) \
00171 ScripterExport Value* get_##p1##_##p2(Value** arg_list, int count); \
00172 ScripterExport Value* set_##p1##_##p2(Value** arg_list, int count)
00173 #define def_nested_prop(p1) \
00174 ScripterExport Value* get_nested_##p1(Value** arg_list, int count); \
00175 ScripterExport Value* set_nested_##p1(Value** arg_list, int count)
00176
00177 def_generic( eq, "=");
00178 def_generic( ne, "!=");
00179
00180 def_generic (coerce, "coerce");
00181
00182 def_generic (show_props, "showProperties");
00183 def_generic (get_props, "getPropNames");
00184 def_generic (copy, "copy");
00185 def_generic (isDeleted, "isDeleted");
00186 def_generic (exprForMAXObject, "exprForMAXObject");
00187
00188 def_generic (show_interfaces, "showInterfaces");
00189 def_generic (get_interfaces, "getInterfaces");
00190 def_generic (get_interface, "getInterface");
00191
00192
00193 def_property ( pos );
00194 def_2_prop_path ( pos, controller );
00195 def_2_prop_path ( pos, isAnimated );
00196 def_2_prop_path ( pos, keys );
00197 def_2_prop_path ( pos, track );
00198 def_2_prop_path ( pos, x );
00199 def_2_prop_path ( pos, y );
00200 def_2_prop_path ( pos, z );
00201 def_property ( rotation );
00202 def_2_prop_path ( rotation, angle );
00203 def_2_prop_path ( rotation, x_rotation );
00204 def_2_prop_path ( rotation, y_rotation );
00205 def_2_prop_path ( rotation, z_rotation );
00206 def_2_prop_path ( rotation, axis );
00207 def_2_prop_path ( rotation, controller );
00208 def_2_prop_path ( rotation, isAnimated );
00209 def_2_prop_path ( rotation, keys );
00210 def_2_prop_path ( rotation, track );
00211 def_property ( scale );
00212 def_2_prop_path ( scale, controller );
00213 def_2_prop_path ( scale, isAnimated );
00214 def_2_prop_path ( scale, keys );
00215 def_2_prop_path ( scale, track );
00216 def_2_prop_path ( scale, x );
00217 def_2_prop_path ( scale, y );
00218 def_2_prop_path ( scale, z );
00219 def_property ( controller );
00220 def_property ( transform );
00221 def_property ( isAnimated );
00222 def_property ( numsubs );
00223
00224 def_nested_prop ( angle );
00225 def_nested_prop ( x_rotation );
00226 def_nested_prop ( y_rotation );
00227 def_nested_prop ( z_rotation );
00228 def_nested_prop ( axis );
00229 def_nested_prop ( controller );
00230 def_nested_prop ( isAnimated );
00231 def_nested_prop ( keys );
00232 def_nested_prop ( x );
00233 def_nested_prop ( y );
00234 def_nested_prop ( z );
00235 def_nested_prop ( w );
00236
00237
00238
00239 virtual Control* get_max_pos_controller(ParamDimension** pdim) { return NULL; }
00240 virtual Control* get_max_scale_controller(ParamDimension** pdim) { return NULL; }
00241 virtual Control* get_max_rotation_controller(ParamDimension** pdim) { return NULL; }
00242 virtual Control* get_max_tm_controller(ParamDimension** pdim) { return NULL; }
00243 virtual Control* get_max_controller(ParamDimension** pdim) { return NULL; }
00244 ScripterExport virtual Control* get_max_prop_controller(Value* prop, ParamDimension** pdim);
00245 virtual BOOL set_max_pos_controller(MAXControl* c) { return FALSE; }
00246 virtual BOOL set_max_scale_controller(MAXControl* c) { return FALSE; }
00247 virtual BOOL set_max_rotation_controller(MAXControl* c) { return FALSE; }
00248 virtual BOOL set_max_tm_controller(MAXControl* c) { return FALSE; }
00249 virtual BOOL set_max_controller(MAXControl* c) { return FALSE; }
00250 ScripterExport virtual BOOL set_max_prop_controller(Value* prop, MAXControl* c);
00251
00252 static ScripterExport Control* get_max_prop_controller(ReferenceTarget* ref, Value* prop, ParamDimension** pdim);
00253 static ScripterExport BOOL set_max_prop_controller(ReferenceTarget* ref, Value* prop, MAXControl* c);
00254
00255 ScripterExport virtual BOOL is_max_prop_animatable(Value* prop);
00256
00257 ScripterExport Value* get_container_property(Value* prop, Value* cur_prop);
00258 ScripterExport Value* set_container_property(Value* prop, Value* val, Value* cur_prop);
00259
00260
00261 virtual void object_to_current_coordsys(Point3& p, int mode=0) { }
00262 virtual void object_from_current_coordsys(Point3& p, int mode=0) { }
00263 virtual void world_to_current_coordsys(Point3& p, int mode=0) { }
00264 virtual void world_from_current_coordsys(Point3& p, int mode=0) { }
00265 virtual void world_to_current_coordsys(Quat& q) { }
00266 virtual void world_from_current_coordsys(Quat& q) { }
00267
00268
00269 virtual void ctrl_to_current_coordsys(Point3& p, int mode=0) { }
00270 virtual void ctrl_from_current_coordsys(Point3& p, int mode=0) { }
00271 virtual void ctrl_to_current_coordsys(Quat& q) { }
00272 virtual void ctrl_from_current_coordsys(Quat& q) { }
00273 virtual void ctrl_to_current_coordsys(ScaleValue& s) { }
00274 virtual void ctrl_from_current_coordsys(ScaleValue& s) { }
00275 #pragma warning(pop)
00276
00277 virtual Matrix3& local_tm() { return idTM; }
00278 virtual Matrix3 local_tm_inv() { return Inverse(local_tm()); }
00279
00280
00281 #undef def_time_fn
00282 #define def_time_fn(_fn) ScripterExport Value* _fn##_vf(Value** arglist, int arg_count)
00283 #include "..\protocols\timefunctions.inl"
00284 #undef def_time_fn
00285 #define def_time_fn(_fn) ScripterExport Value* _fn(Animatable* anim, Value** arglist, int arg_count)
00286 #include "..\protocols\timefunctions.inl"
00287
00288
00289 ScripterExport virtual Mesh* set_up_mesh_access(int access, ReferenceTarget** owner = NULL);
00290 ScripterExport virtual Mesh* set_up_mesh_face_access(int index, int access, ReferenceTarget** owner = NULL);
00291 ScripterExport virtual Mesh* set_up_mesh_vertex_access(int index, int access, ReferenceTarget** owner = NULL);
00292 ScripterExport virtual MNMesh* set_up_mnmesh_access(int access, ReferenceTarget** owner = NULL);
00293 ScripterExport virtual MNMesh* set_up_mnmesh_face_access(int index, int access, ReferenceTarget** owner = NULL);
00294 ScripterExport virtual MNMesh* set_up_mnmesh_vertex_access(int index, int access, ReferenceTarget** owner = NULL);
00295 ScripterExport virtual BitArray get_vertsel();
00296 ScripterExport virtual BitArray get_facesel();
00297 ScripterExport virtual BitArray get_edgesel();
00298 ScripterExport virtual void set_vertsel(BitArray &sel);
00299 ScripterExport virtual void set_facesel(BitArray &sel);
00300 ScripterExport virtual void set_edgesel(BitArray &sel);
00301 ScripterExport virtual GenericNamedSelSetList& get_named_vertsel_set();
00302 ScripterExport virtual GenericNamedSelSetList& get_named_facesel_set();
00303 ScripterExport virtual GenericNamedSelSetList& get_named_edgesel_set();
00304 virtual void update_sel() { NotifyDependents(FOREVER, PART_SELECT, REFMSG_CHANGE); }
00305 ScripterExport virtual bool isPolyObject(int access);
00306 ScripterExport virtual IMeshSelectData* set_up_IMeshSelectData_access(int access, ReferenceTarget** owner);
00307 #ifndef NO_PATCHES
00308 ScripterExport virtual bool isPatchObject(int access);
00309 ScripterExport virtual PatchObject* set_up_patch_access(int access, ReferenceTarget** owner = NULL);
00310 ScripterExport virtual PatchObject* set_up_patch_face_access(int index, int access, ReferenceTarget** owner = NULL);
00311 ScripterExport virtual PatchObject* set_up_patch_vertex_access(int index, int access, ReferenceTarget** owner = NULL);
00312 ScripterExport virtual IPatchSelectData* set_up_IPatchSelectData_access(int access, ReferenceTarget** owner);
00313 #endif // NO_PATCHES
00314
00315 def_property ( category );
00316 def_prop_getter( classID );
00317 def_prop_getter( superclassID );
00318
00319 def_generic ( get, "get" );
00320 def_generic ( getSubAnim, "getSubAnim" );
00321 def_generic ( getSubAnimName, "getSubAnimName" );
00322 def_generic ( getSubAnimNames, "getSubAnimNames" );
00323 def_generic ( getAppData, "getAppData");
00324 def_generic ( setAppData, "setAppData");
00325 def_generic ( deleteAppData, "deleteAppData");
00326 def_generic ( clearAllAppData, "clearAllAppData");
00327 def_generic ( addPluginRollouts, "addPluginRollouts");
00328
00329 ReferenceTarget* to_reftarg() { return get_max_object(); }
00330 void to_fpvalue(FPValue& v) { v.r = get_max_object(); v.type = TYPE_REFTARG; }
00331
00332
00333 ScripterExport IOResult Save(ISave* isave);
00334 static ScripterExport Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
00335
00336
00337 using ReferenceTarget::GetInterface;
00338 ScripterExport BaseInterface* GetInterface(Interface_ID id);
00339 };
00340
00341
00342 #define NO_TRANSLATE 0x0001
00343 #define NO_SCALE 0x0002
00344
00345 #define ctrl_to_current_coordsys_rotate(p) ctrl_to_current_coordsys(p, NO_TRANSLATE + NO_SCALE)
00346 #define ctrl_from_current_coordsys_rotate(p) ctrl_from_current_coordsys(p, NO_TRANSLATE + NO_SCALE)
00347 #define object_to_current_coordsys_rotate(p) object_to_current_coordsys(p, NO_TRANSLATE + NO_SCALE)
00348 #define object_from_current_coordsys_rotate(p) object_from_current_coordsys(p, NO_TRANSLATE + NO_SCALE)
00349 #define world_to_current_coordsys_rotate(p) world_to_current_coordsys(p, NO_TRANSLATE + NO_SCALE)
00350 #define world_from_current_coordsys_rotate(p) world_from_current_coordsys(p, NO_TRANSLATE + NO_SCALE)
00351 #define object_to_current_coordsys_scaleRotate(p) object_to_current_coordsys(p, NO_TRANSLATE)
00352 #define object_from_current_coordsys_scaleRotate(p) object_from_current_coordsys(p, NO_TRANSLATE)
00353
00354
00355
00356 #pragma warning(push)
00357 #pragma warning(disable:4201)
00358
00359
00360
00361
00362
00363
00364 struct parm_desc
00365 {
00366 Value* name;
00367 MCHAR desc_type;
00368 MCHAR flags;
00369 union
00370 {
00371 struct
00372 {
00373 int parm_id;
00374 };
00375 struct
00376 {
00377 max_getter_cf getter;
00378 max_setter_cf setter;
00379 };
00380 struct
00381 {
00382 int subanim_num;
00383 };
00384 struct
00385 {
00386 int refno;
00387 int pbn_id;
00388 };
00389 };
00390 ParamType type;
00391 union
00392 {
00393 float fval;
00394 int ival;
00395 BOOL bval;
00396 INT_PTR pval;
00397 struct {float x, y, z, w;};
00398 struct {float r, g, b, a;};
00399 struct {float h, s, v;};
00400 struct {int btn_min, btn_max, btn_val;};
00401 } init_val;
00402 } ;
00403
00404 #pragma warning(pop) // 4201
00405
00406 #define PD_NO_INIT 0x01 // flags this property as reqiring no init
00407 #define PD_LOCAL_DUP 0x02 // this is a duplicate local translation
00408 #define PD_HAS_LOCAL_DUPS 0x04 // this has duplicate local translations
00409 #define PD_SHOWN 0x08 // temp flag to mark already shown props in showProps()
00410
00411 class MAXClass;
00412 class MAXSuperClass;
00413
00414 struct superclass_table
00415 {
00416 SClass_ID key;
00417 MAXSuperClass* mx_superclass;
00418 };
00419
00420 typedef Value* (*maker_fn)(MAXClass* cls, ReferenceTarget* obj, Value** arglist, int count);
00421
00422 visible_class_debug_ok (MAXSuperClass)
00423
00424 class MAXSuperClass : public Value
00425 {
00426 public:
00427 Value* name;
00428 SClass_ID sclass_id;
00429 Value* superclass;
00430 maker_fn maker;
00431 short n_parms;
00432 short flags;
00433 parm_desc* parms;
00434
00435
00436 ScripterExport MAXSuperClass(MCHAR* cname, SClass_ID sid, Value* superClass, maker_fn maker, ...);
00437 ScripterExport ~MAXSuperClass();
00438 void complete_init();
00439
00440 static superclass_table* superclasses;
00441 static short n_superclasses;
00442 static BOOL superclass_table_dirty;
00443 static void free_classes();
00444 static MAXSuperClass* lookup_superclass(SClass_ID sid);
00445
00446 Value* classOf_vf(Value** arg_list, int count);
00447 Value* superClassOf_vf(Value** arg_list, int count);
00448 Value* isKindOf_vf(Value** arg_list, int count);
00449
00450 BOOL is_kind_of(ValueMetaClass* c) { return ((c == class_tag(MAXSuperClass)) ? 1 : Value::is_kind_of(c)); }
00451 # define is_maxsuperclass(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXSuperClass))
00452 void collect() { delete this; }
00453 void gc_trace();
00454 ScripterExport void sprin1(CharStream* s);
00455 void export_to_scripter();
00456
00457 ScripterExport short getNumSuperclasses ();
00458 ScripterExport MAXSuperClass* getSuperclass (int index);
00459
00460 ScripterExport void apply_keyword_parms(ReferenceTarget* obj, Value** key_arg_list, int count);
00461
00462 def_generic (get_props, "getPropNames");
00463 def_generic (show_interfaces, "showInterfaces");
00464 def_generic (get_interfaces, "getInterfaces");
00465 def_generic (get_interface, "getInterface");
00466
00467 def_property( categories );
00468 def_property( classes );
00469 };
00470
00471 extern ScripterExport MAXSuperClass* lookup_MAXSuperClass (SClass_ID scid);
00472
00473 #define SC_SUPERCLASS_INITED 0x0001
00474 #define SC_NON_REFTARG 0x0002
00475
00476 struct class_key
00477 {
00478 Class_ID cid;
00479 SClass_ID scid;
00480 };
00481
00482 struct class_table
00483 {
00484 class_key key;
00485 MAXClass* mx_class;
00486 };
00487
00488 enum metadata_flags
00489 {
00490 md_use_getref = 0x0001,
00491 md_use_getref0 = 0x0002,
00492 md_use_getref1 = 0x0004,
00493 md_no_create = 0x0008,
00494 md_no_access = 0x0010,
00495 md_direct_index = 0x0020,
00496 md_new_plugin = 0x0040,
00497 md_auto_parms = 0x0080,
00498 md_name_clash = 0x0100,
00499 md_initialized = 0x0200,
00500 };
00501
00502 enum metadata_flag
00503 {
00504
00505 getters = 1,
00506 setters,
00507 accessors,
00508 path_getters,
00509 path_setters,
00510 path_accessors,
00511 fns,
00512 paramblock,
00513 subanims,
00514 paramblockn,
00515 subanimparamblock
00516 };
00517
00518 enum
00519 {
00520 TYPE_POINT3_ANGLE = TYPE_USER + 128,
00521 TYPE_POINT3_PCNT,
00522
00523 };
00524
00525
00526 visible_class_debug_ok (MAXClass)
00527
00528 class MAXClass : public Value
00529 {
00530 public:
00531 Value* name;
00532 Class_ID class_id;
00533 SClass_ID sclass_id;
00534 ClassDesc* cd;
00535 ClassDesc2* cd2;
00536 short md_flags;
00537 int n_parms;
00538 parm_desc* parms;
00539 MAXSuperClass* superclass;
00540 short paramblock_ref_no;
00541 Value* category;
00542 HashTable* interfaces;
00543
00544 static class_table* classes;
00545 static int n_classes;
00546 static BOOL class_table_dirty;
00547 static void free_classes();
00548 static ScripterExport MAXClass* lookup_class(Class_ID* cid, SClass_ID scid, bool make_new_if_missing = true);
00549
00550 MAXClass() { }
00551 ScripterExport MAXClass(MCHAR* cname, Class_ID cid, SClass_ID sid, MAXSuperClass* sclass, short cflags, ...);
00552 ScripterExport ~MAXClass();
00553 ClassDesc* complete_init();
00554
00555 static void setup();
00556 Value* classOf_vf(Value** arg_list, int count);
00557 Value* superClassOf_vf(Value** arg_list, int count);
00558 Value* isKindOf_vf(Value** arg_list, int count);
00559 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXClass)) ? 1 : Value::is_kind_of(c); }
00560 # define is_maxclass(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXClass))
00561 void collect() { delete this; }
00562 void gc_trace();
00563 ScripterExport void sprin1(CharStream* s);
00564 void export_to_scripter();
00565
00566 ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL);
00567
00568 static ScripterExport Value* make_wrapper_for(ReferenceTarget* ref);
00569 static ScripterExport Value* make_node_for(ReferenceTarget* ref);
00570
00571 parm_desc* get_parm_desc(ReferenceTarget* ref, Value* key);
00572 BOOL build_parm_descs(ReferenceTarget* ref);
00573 ScripterExport void apply_keyword_parms(ReferenceTarget* ref, Value** key_arg_list, int count);
00574 ScripterExport void initialize_object(ReferenceTarget* ref);
00575 Value* get_max_property(ReferenceTarget* ref, parm_desc* pd, TimeValue t, Interval& valid);
00576 void set_max_property(ReferenceTarget* ref, parm_desc* pd, TimeValue t, Value* val);
00577
00578
00579 ParamDef* get_parm_def(Value* prop, ParamBlockDesc2*& pbd, int& tabIndex, ReferenceTarget* ref = NULL);
00580 void set_max_property(ReferenceTarget* ref, ParamDef* pd, int tabIndex, ParamBlockDesc2* pbd, TimeValue t, Value* val);
00581 Value* get_max_property(ReferenceTarget* ref, ParamDef* pd, int tabIndex, ParamBlockDesc2* pbd, TimeValue t, Interval& valid);
00582 static Value* get_pb2_property(IParamBlock2* pb, ParamDef* pd, int tabIndex, TimeValue t, Interval& valid);
00583 static void set_pb2_property(IParamBlock2* pb, ParamDef* pd, int tabIndex, TimeValue t, Value* val);
00584 static ParamDef* get_parm_def(ClassDesc2* cd2, Value* prop, ParamBlockDesc2*& pbd, int& tabIndex, ReferenceTarget* ref = NULL);
00585
00586 def_generic (get_props, "getPropNames");
00587 def_generic (create_instance, "createInstance");
00588 def_generic (show_interfaces, "showInterfaces");
00589 def_generic (get_interfaces, "getInterfaces");
00590 def_generic (get_interface, "getInterface");
00591
00592 Class_ID get_max_class_id() { return class_id; }
00593
00594 def_property ( category );
00595 def_prop_getter( classID );
00596 def_prop_getter( superclassID );
00597 def_property ( creatable );
00598
00599 void to_fpvalue(FPValue& v);
00600
00601 Value* Category();
00602
00603 Value* get_property(Value** arg_list, int count);
00604 Value* set_property(Value** arg_list, int count);
00605 };
00606
00607
00608
00609 Value* make_max_node(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00610 Value* make_max_object(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00611 Value* make_max_light(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00612 Value* make_max_camera(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00613 Value* make_max_modifier(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00614 Value* make_max_material(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00615 Value* make_max_texturemap(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00616 Value* make_max_mtlbase(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00617 Value* make_max_system(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00618 Value* make_max_helper(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00619 Value* make_max_controller(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00620 Value* make_max_atmospheric(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00621 Value* make_max_effect(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00622 Value* make_max_mpassCamEffect(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00623 Value* make_max_filter(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00624 Value* make_max_shadow(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00625 Value* make_max_reftarg(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00626 Value* no_max_maker(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00627 Value* make_max_renderer(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00628 Value* make_max_custattrib(MAXClass* cls, ReferenceTarget* obj, Value** arg_list, int count);
00629
00630 extern ScripterExport MAXClass* lookup_MAXClass (Class_ID* cid, SClass_ID scid, bool make_new_if_missing = false);
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640 #define MAXWRAPPER_CACHE_SIZE 2048 // must be power of 2
00641 extern ScripterExport MAXWrapper* maxwrapper_cache[];
00642
00643
00644
00645 #ifndef MAXWRAPPER_CACHE_STATS
00646
00647 inline BOOL
00648 _maxwrapper_cache_get(LONG_PTR index_ptr, MAXWrapper*** pw)
00649 {
00650
00651 int index = DL_abs((int)((PointerLoPart(index_ptr) ^ PointerHiPart(index_ptr)))) % MAXWRAPPER_CACHE_SIZE;
00652 *pw = &maxwrapper_cache[index];
00653
00654 MAXWrapper* w = **pw;
00655 return (w && !w->ref_deleted);
00656 }
00657
00658
00659 #define maxwrapper_cache_get(_mw_class, _mw_ref, _mw_var, _ce_var) \
00660 (_maxwrapper_cache_get((LONG_PTR)(_mw_ref) ^ (LONG_PTR)class_tag(_mw_class), (MAXWrapper***)&_ce_var) && \
00661 (_mw_var = *_ce_var)->tag == class_tag(_mw_class))
00662
00663 #else
00664
00665 static long _maxwrapper_cache_hit = 0;
00666 static long _maxwrapper_cache_miss = 0;
00667 static long _maxwrapper_cache_clash = 0;
00668
00669 static BOOL
00670 _maxwrapper_cache_get(LONG_PTR index_ptr, MAXWrapper*** pw, ValueMetaClass* tag)
00671 {
00672
00673 int index = DL_abs((UINT)((PointerLoPart(index_ptr) ^ PointerHiPart(index_ptr)))) % MAXWRAPPER_CACHE_SIZE;
00674 *pw = &maxwrapper_cache[index];
00675
00676 MAXWrapper* w = **pw;
00677 BOOL res_h = w && !w->ref_deleted;
00678 BOOL res_nc = res_h && (w->tag == tag);
00679 if (res_h)
00680 {
00681 if (res_nc)
00682 _maxwrapper_cache_hit++;
00683 else
00684 _maxwrapper_cache_clash++;
00685 }
00686 else
00687 _maxwrapper_cache_miss++;
00688 return res_h;
00689 }
00690
00691 #define maxwrapper_cache_get(_mw_class, _mw_ref, _mw_var, _ce_var) \
00692 (_maxwrapper_cache_get((LONG_PTR)(_mw_ref) ^ (LONG_PTR)class_tag(_mw_class), (MAXWrapper***)&_ce_var, class_tag(_mw_class)) && \
00693 (_mw_var = *_ce_var)->tag == class_tag(_mw_class))
00694
00695 #endif
00696
00697
00698
00699
00700 inline LONG_PTR maxwrapper_genref(void* pObject, LONG_PTR index)
00701 {
00702 return(reinterpret_cast<LONG_PTR>(pObject) ^ index);
00703 }
00704
00705 inline LONG_PTR maxwrapper_genref(void* pObject1, void* pObject2)
00706 {
00707 return(maxwrapper_genref(pObject1, reinterpret_cast<LONG_PTR>(pObject2)));
00708 }
00709
00710
00711
00712
00713
00714
00715 class FindMAXWrapperEnum : public DependentEnumProc
00716 {
00717 ValueMetaClass* mytag;
00718 ReferenceTarget* myref;
00719 void* arg;
00720 bool (*finalCheckProc)(MAXWrapper*, void*);
00721
00722 public:
00723 FindMAXWrapperEnum(ReferenceTarget* ref, ValueMetaClass* tag, bool (*finalCheckProc)(MAXWrapper*, void*) = NULL, void* arg = NULL)
00724 {
00725 mytag = tag;
00726 myref = ref;
00727 result = NULL;
00728 this->finalCheckProc = finalCheckProc;
00729 this->arg = arg;
00730 }
00731 int proc(ReferenceMaker* rm)
00732 {
00733 if (rm == myref)
00734 return DEP_ENUM_CONTINUE;
00735 if (rm->SuperClassID() == MAXSCRIPT_WRAPPER_CLASS_ID &&
00736 ((MAXWrapper*)rm)->tag == mytag &&
00737 rm->NumRefs() && rm->GetReference(0) == myref &&
00738 (finalCheckProc == NULL || (*finalCheckProc)((MAXWrapper*)rm, arg))
00739 )
00740 {
00741 result = (MAXWrapper*)rm;
00742 return DEP_ENUM_HALT;
00743 }
00744 return DEP_ENUM_SKIP;
00745 }
00746 Value* result;
00747 };
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758 extern ScripterExport void InvalidateNodeRect(INode*node, TimeValue t);
00759
00760
00761 enum GetINodeTabResult
00762 {
00763 ResultOk,
00764 ErrSelectionEmpty,
00765 ErrRequireNodes
00766 };
00767
00768
00769
00770
00771
00772 ScripterExport extern GetINodeTabResult GetINodeTabFromValue(Value* val, INodeTab& nodeTab, INodeTab** pResult);
00773
00774
00775 visible_class (MAXNode)
00776
00777 class MAXNode : public MAXWrapper
00778 {
00779 public:
00780 INode* node;
00781
00782 ScripterExport MAXNode(INode* init_node);
00783 static ScripterExport Value* intern(INode* init_node);
00784
00785 Value* classOf_vf(Value** arg_list, int count);
00786 Value* superClassOf_vf(Value** arg_list, int count);
00787 Value* isKindOf_vf(Value** arg_list, int count);
00788 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXNode)) ? 1 : MAXWrapper::is_kind_of(c); }
00789 # define is_node(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXNode))
00790 ScripterExport void sprin1(CharStream* s);
00791 MCHAR* class_name();
00792 ScripterExport ReferenceTarget* get_max_object();
00793 ScripterExport static Value* ConvertTo(INode* node, Class_ID ccid);
00794
00795
00796
00797
00798 #include "..\macros\define_implementations.h"
00799 # include "..\protocols\node.inl"
00800
00801 def_generic( distance, "distance" );
00802 def_generic( eq, "=");
00803 def_generic( ne, "!=");
00804 def_generic( coerce, "coerce");
00805 def_generic (get_interfaces, "getInterfaces");
00806 def_generic (get_interface, "getInterface");
00807
00808
00809
00810 def_property ( dir );
00811 def_property ( target );
00812 def_property ( mat );
00813 def_property ( modifiers );
00814 def_property ( name );
00815 def_property ( max );
00816 def_property ( min );
00817 def_property ( center );
00818 def_property ( transform );
00819 def_property ( parent );
00820 def_property ( children );
00821 def_property ( pivot );
00822 def_2_prop_path ( pivot, x );
00823 def_2_prop_path ( pivot, y );
00824 def_2_prop_path ( pivot, z );
00825 def_property ( objectoffsetpos );
00826 def_property ( objectoffsetrot );
00827 def_property ( objectoffsetscale );
00828 def_property ( objecttransform );
00829
00830 def_nested_prop ( angle );
00831 def_nested_prop ( axis );
00832
00833
00834
00835 def_property ( numverts );
00836 def_property ( numtverts );
00837 def_property ( numfaces );
00838 def_property ( numcpvverts );
00839 def_property ( mesh );
00840 def_property ( displacementMapping );
00841 def_property ( subdivisionDisplacement );
00842 def_property ( splitMesh );
00843
00844
00845
00846 def_property ( vertices );
00847 def_property ( selectedVertices );
00848 def_property ( faces );
00849 def_property ( selectedFaces );
00850 def_property ( edges );
00851 def_property ( selectedEdges );
00852
00853
00854
00855 def_property ( numsplines );
00856
00857
00858
00859 Value* get_property(Value** arg_list, int count);
00860 Value* set_property(Value** arg_list, int count);
00861 Value* find_modifier(Object* obj, Value* prop);
00862 Value* get_property_via_metadata(Value* prop);
00863 Control* get_max_prop_controller(Value* prop, ParamDimension** pdim);
00864 BOOL set_max_prop_controller(Value* prop, MAXControl* c);
00865
00866
00867
00868 ScripterExport Value* map(node_map& m);
00869 ScripterExport Value* map_path(PathName* path, node_map& m);
00870 ScripterExport Value* find_first(BOOL (*test_fn)(INode* node, int level, void* arg), void* test_arg);
00871 ScripterExport Value* get_path(PathName* path);
00872
00873 INode* to_node() { check_for_deletion(); return node; }
00874 void to_fpvalue(FPValue& v) { v.n = node; v.type = TYPE_INODE; }
00875
00876
00877 ScripterExport void object_to_current_coordsys(Point3& p, int mode=0);
00878 ScripterExport void object_from_current_coordsys(Point3& p, int mode=0);
00879 ScripterExport void world_to_current_coordsys(Point3& p, int mode=0);
00880 ScripterExport void world_from_current_coordsys(Point3& p, int mode=0);
00881 ScripterExport void world_to_current_coordsys(Quat& q);
00882 ScripterExport void world_from_current_coordsys(Quat& q);
00883 ScripterExport void world_to_current_coordsys(ScaleValue& s);
00884 ScripterExport void world_from_current_coordsys(ScaleValue& s);
00885
00886
00887 Control* get_max_pos_controller(ParamDimension** pdim);
00888 Control* get_max_scale_controller(ParamDimension** pdim);
00889 Control* get_max_rotation_controller(ParamDimension** pdim);
00890 Control* get_max_tm_controller(ParamDimension** pdim);
00891 Control* get_max_controller(ParamDimension** pdim);
00892 BOOL set_max_pos_controller(MAXControl* c);
00893 BOOL set_max_scale_controller(MAXControl* c);
00894 BOOL set_max_rotation_controller(MAXControl* c);
00895 BOOL set_max_tm_controller(MAXControl* c);
00896 BOOL set_max_controller(MAXControl* c);
00897
00898 void ctrl_to_current_coordsys(Point3& p, int mode=0);
00899 void ctrl_from_current_coordsys(Point3& p, int mode=0);
00900 void ctrl_to_current_coordsys(Quat& q);
00901 void ctrl_from_current_coordsys(Quat& q);
00902 void ctrl_to_current_coordsys(ScaleValue& s);
00903 void ctrl_from_current_coordsys(ScaleValue& s);
00904
00905
00906 #undef def_time_fn
00907 #define def_time_fn(_fn) Value* _fn##_vf(Value** arglist, int arg_count)
00908 #include "..\protocols\timefunctions.inl"
00909
00910
00911 Mesh* set_up_mesh_access(int access, ReferenceTarget** owner = NULL);
00912 Mesh* set_up_mesh_face_access(int index, int access, ReferenceTarget** owner = NULL);
00913 Mesh* set_up_mesh_vertex_access(int index, int access, ReferenceTarget** owner = NULL);
00914 MNMesh* set_up_mnmesh_access(int access, ReferenceTarget** owner = NULL);
00915 MNMesh* set_up_mnmesh_face_access(int index, int access, ReferenceTarget** owner = NULL);
00916 MNMesh* set_up_mnmesh_vertex_access(int index, int access, ReferenceTarget** owner = NULL);
00917 BitArray get_vertsel();
00918 BitArray get_facesel();
00919 BitArray get_edgesel();
00920 void set_vertsel(BitArray &sel);
00921 void set_facesel(BitArray &sel);
00922 void set_edgesel(BitArray &sel);
00923 GenericNamedSelSetList& get_named_vertsel_set();
00924 GenericNamedSelSetList& get_named_facesel_set();
00925 GenericNamedSelSetList& get_named_edgesel_set();
00926 void update_sel();
00927 bool isPolyObject(int access);
00928 IMeshSelectData* set_up_IMeshSelectData_access(int access, ReferenceTarget** owner);
00929
00930
00931 #ifndef NO_PATCHES
00932 bool isPatchObject(int access);
00933 PatchObject* set_up_patch_access(int access, ReferenceTarget** owner = NULL);
00934 PatchObject* set_up_patch_face_access(int index, int access, ReferenceTarget** owner = NULL);
00935 PatchObject* set_up_patch_vertex_access(int index, int access, ReferenceTarget** owner = NULL);
00936 IPatchSelectData* set_up_IPatchSelectData_access(int access, ReferenceTarget** owner);
00937 #endif // NO_PATCHES
00938
00939 };
00940
00941 #define INODE_CLASS_ID Class_ID(BASENODE_CLASS_ID, 0)
00942 #define INODE_SUPERCLASS_ID BASENODE_CLASS_ID
00943
00944
00945
00946 visible_class (MAXNodeChildrenArray)
00947
00948 class MAXNodeChildrenArray : public Value, public Collection
00949 {
00950 public:
00951 MAXNode* parent;
00952
00953 ENABLE_STACK_ALLOCATE(MAXNodeChildrenArray);
00954 ScripterExport MAXNodeChildrenArray(INode* parent);
00955 ScripterExport MAXNodeChildrenArray(MAXNode* parent);
00956 # define is_nodechildrenarray(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXNodeChildrenArray))
00957
00958 classof_methods (MAXNodeChildrenArray, Value);
00959 BOOL _is_collection() { return 1; }
00960 void collect() { delete this; }
00961 void gc_trace();
00962 ScripterExport void sprin1(CharStream* s);
00963
00964
00965 ScripterExport Value* map(node_map& m);
00966
00967 #include "..\macros\define_implementations.h"
00968 # include "..\protocols\arrays.inl"
00969
00970
00971 def_property ( count );
00972 def_property ( center );
00973 def_property ( min );
00974 def_property ( max );
00975
00976 };
00977
00978
00979
00980
00981
00982 visible_class (MAXObject)
00983
00984 class MAXObject : public MAXWrapper
00985 {
00986 public:
00987 Object* obj;
00988
00989 ScripterExport MAXObject(Object* o);
00990 static ScripterExport Value* intern(Object* o);
00991 # define is_maxobject(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXObject))
00992
00993 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXObject)) ? 1 : MAXWrapper::is_kind_of(c); }
00994
00995 void collect() { delete this; }
00996 ScripterExport void sprin1(CharStream* s);
00997 MCHAR* class_name();
00998
00999 BOOL CanTransferReference(int i) { UNUSED_PARAM(i); return FALSE; }
01000
01001 def_property ( mesh );
01002
01003 Value* get_property(Value** arg_list, int count);
01004 Value* set_property(Value** arg_list, int count);
01005
01006 void to_fpvalue(FPValue& v) { v.obj = obj; v.type = TYPE_OBJECT; }
01007
01008 def_visible_generic ( updateXRef, "updateXRef");
01009 };
01010
01011
01012
01013
01014
01015
01016 visible_class (MAXPB2ArrayParam)
01017
01018 #pragma warning(push)
01019 #pragma warning(disable:4100)
01020 class MAXPB2ArrayParam : public MAXWrapper, public Collection
01021 {
01022 public:
01023 IParamBlock2* pblock;
01024 ParamDef* pdef;
01025
01026 MAXPB2ArrayParam(IParamBlock2* pb, ParamDef* pd);
01027 static ScripterExport Value* intern(IParamBlock2* pb, ParamDef* pd);
01028
01029 classof_methods (MAXPB2ArrayParam, MAXWrapper);
01030 # define is_tab_param(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXPB2ArrayParam))
01031 void collect() { delete this; }
01032 ScripterExport void sprin1(CharStream* s);
01033 MCHAR* class_name() { return _M("Array Parameter"); }
01034
01035
01036 ScripterExport Value* map(node_map& m);
01037
01038 #include "..\macros\define_implementations.h"
01039 # include "..\protocols\arrays.inl"
01040
01041 def_generic( coerce, "coerce");
01042 ScripterExport Value* insertItem(Value** arg_list, int count);
01043
01044
01045 def_property ( count );
01046
01047
01048 ScripterExport Value* get_container_property(Value* prop, Value* cur_prop);
01049 ScripterExport Value* set_container_property(Value* prop, Value* val, Value* cur_prop);
01050
01051
01052 Value* show_props_vf(Value** arg_list, int count) { return &false_value; }
01053 Value* get_props_vf(Value** arg_list, int count) { return &undefined; }
01054 };
01055 #pragma warning(pop) // 4100
01056
01057
01058
01059
01060 visible_class (MAXModifier)
01061
01062 class MAXModifier : public MAXWrapper
01063 {
01064 public:
01065 Modifier* mod;
01066
01067 ScripterExport MAXModifier(Modifier* imod);
01068 static ScripterExport Value* intern(Modifier* imod);
01069
01070 # define is_modifier(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXModifier))
01071 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXModifier)) ? 1 : MAXWrapper::is_kind_of(c); }
01072 void collect() { delete this; }
01073 ScripterExport void sprin1(CharStream* s);
01074 MCHAR* class_name();
01075
01076 def_property ( name );
01077 Value* get_property(Value** arg_list, int count);
01078 Value* set_property(Value** arg_list, int count);
01079
01080 Modifier* to_modifier() { check_for_deletion(); return mod; }
01081 void to_fpvalue(FPValue& v) { v.r = mod; v.type = TYPE_REFTARG; }
01082 };
01083
01084 visible_class (MAXModifierArray)
01085
01086 class MAXModifierArray : public Value
01087 {
01088 public:
01089 MAXNode* node;
01090
01091 ENABLE_STACK_ALLOCATE(MAXModifierArray);
01092 ScripterExport MAXModifierArray(INode* node);
01093 ScripterExport MAXModifierArray(MAXNode* node);
01094
01095 classof_methods (MAXModifierArray, Value);
01096 void collect() { delete this; }
01097 void gc_trace();
01098 BOOL _is_collection() { return 1; }
01099 ScripterExport void sprin1(CharStream* s);
01100 Modifier* get_modifier(int index);
01101 Modifier* find_modifier(MCHAR* name);
01102 MCHAR* class_name();
01103
01104
01105 ScripterExport Value* map(node_map& m);
01106
01107 #include "..\macros\define_implementations.h"
01108 # include "..\protocols\arrays.inl"
01109
01110
01111 def_property ( count );
01112
01113 };
01114
01115
01116
01117
01118
01121 #define REFMSG_MAXCONTROL_NOT_NEW REFMSG_USER + 0x4af551aa
01122
01123 visible_class (MAXControl)
01124
01125 class MAXControl : public MAXWrapper
01126 {
01127 public:
01128 Control* controller;
01129 ParamDimension* dim;
01130 short flags;
01131
01132 ScripterExport MAXControl(Control* icont, ParamDimension* idim);
01133 ScripterExport MAXControl(Control* icont, int flags = 0);
01134 static ScripterExport Value* intern(Control* icont, ParamDimension* idim);
01135 static ScripterExport Value* intern(Control* icont, int flags = 0);
01136
01137 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXControl)) ? 1 : MAXWrapper::is_kind_of(c); }
01138 void collect() { delete this; }
01139 ScripterExport void sprin1(CharStream* s);
01140 MCHAR* class_name();
01141 # define is_controller(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXControl))
01142
01143 RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message);
01144
01145
01146
01147 #include "..\macros\define_implementations.h"
01148 use_generic ( copy, "copy");
01149 def_visible_generic ( supportsTimeOperations, "supportsTimeOperations");
01150 def_visible_generic ( getTimeRange, "getTimeRange");
01151 def_visible_generic ( deleteKey, "deleteKey");
01152 def_visible_generic ( selectKey, "selectKey");
01153 def_visible_generic ( deselectKey, "deselectKey");
01154 def_visible_generic ( isKeySelected, "isKeySelected");
01155 def_visible_generic ( moveKey, "moveKey");
01156 def_visible_generic ( numKeys, "numKeys");
01157 def_visible_generic ( getKey, "getKey");
01158 def_visible_generic ( getKeyTime, "getKeyTime");
01159 def_visible_generic ( getKeyIndex, "getKeyIndex");
01160 def_visible_generic ( numSelKeys, "numSelKeys");
01161 def_visible_generic ( numEaseCurves, "numEaseCurves");
01162 def_visible_generic ( applyEaseCurve, "applyEaseCurve");
01163 def_visible_generic ( addMultiplierCurve, "addMultiplierCurve");
01164 def_visible_generic ( deleteMultiplierCurve, "deleteMultiplierCurve");
01165 def_visible_generic ( numMultiplierCurves, "numMultiplierCurves");
01166 def_visible_generic ( getMultiplierValue, "getMultiplierValue");
01167 def_visible_generic ( getBeforeORT, "getBeforeORT");
01168 def_visible_generic ( getAfterORT, "getAfterORT");
01169
01170
01171 def_property ( value );
01172 def_property ( keys );
01173
01174 Control* to_controller() { check_for_deletion(); return controller; }
01175 void to_fpvalue(FPValue& v) { v.ctrl = controller; v.type = TYPE_CONTROL; }
01176
01177
01178 def_visible_generic ( reduceKeys, "reduceKeys");
01179
01180 Value* get_property(Value** arg_list, int count);
01181 Value* set_property(Value** arg_list, int count);
01182 };
01183
01184 #define MAX_CTRL_NO_DIM 0x01 // indicates no explicit dimension yet assigned
01185 #define MAX_CTRL_NEW 0x02 // new controller, copy(old) when first assigned
01186
01187
01188
01189
01190
01191 visible_class (MAXSubAnim)
01192
01193 class MAXSubAnim : public MAXWrapper
01194 {
01195 public:
01196 ReferenceTarget* ref;
01197 int subanim_num;
01198
01199 ScripterExport MAXSubAnim(ReferenceTarget* ref, int index);
01200 static ScripterExport Value* intern(ReferenceTarget* ref, int index);
01201
01202 classof_methods(MAXSubAnim, MAXWrapper);
01203 void collect() { delete this; }
01204 ScripterExport void sprin1(CharStream* s);
01205 MCHAR* class_name() { return _M("SubAnim"); }
01206 ScripterExport ReferenceTarget* get_max_object();
01208 Value* _set_property(Value* prop, Value* val) { UNUSED_PARAM(prop); return val; }
01209 # define is_subAnim(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXSubAnim))
01210
01211
01212 Control* get_max_pos_controller(ParamDimension** pdim);
01213 Control* get_max_scale_controller(ParamDimension** pdim);
01214 Control* get_max_rotation_controller(ParamDimension** pdim);
01215 Control* get_max_tm_controller(ParamDimension** pdim);
01216 Control* get_max_controller(ParamDimension** pdim);
01217 BOOL set_max_pos_controller(MAXControl* c);
01218 BOOL set_max_scale_controller(MAXControl* c);
01219 BOOL set_max_rotation_controller(MAXControl* c);
01220 BOOL set_max_tm_controller(MAXControl* c);
01221 BOOL set_max_controller(MAXControl* c);
01222
01223 def_property( controller );
01224 def_property( isAnimated );
01225 def_property( keys );
01226 def_property( value );
01227 def_property( object );
01228 def_property( name );
01229 def_property( parent );
01230 def_property( index );
01231
01232
01233 Value* subanim_obj();
01234
01235 INode* to_node() { return subanim_obj() != this ? subanim_obj()->to_node() : Value::to_node(); }
01236 Mtl* to_mtl() { return subanim_obj() != this ? subanim_obj()->to_mtl() : Value::to_mtl(); }
01237 Texmap* to_texmap() { return subanim_obj() != this ? subanim_obj()->to_texmap() : Value::to_texmap(); }
01238 Modifier* to_modifier() { return subanim_obj() != this ? subanim_obj()->to_modifier() : Value::to_modifier(); }
01239 Control* to_controller() { return subanim_obj() != this ? subanim_obj()->to_controller() : Value::to_controller() ; }
01240 Atmospheric* to_atmospheric() { return subanim_obj() != this ? subanim_obj()->to_atmospheric() : Value::to_atmospheric(); }
01241 Effect* to_effect() { return subanim_obj() != this ? subanim_obj()->to_effect() : Value::to_effect(); }
01242 ITrackViewNode* to_trackviewnode() { return subanim_obj() != this ? subanim_obj()->to_trackviewnode() : Value::to_trackviewnode(); }
01243 void to_fpvalue(FPValue& v);
01244 };
01245
01246
01247
01248
01249 visible_class (MAXRefTarg)
01250
01251 class MAXRefTarg : public MAXWrapper
01252 {
01253 public:
01254 ReferenceTarget* ref;
01255
01256 ScripterExport MAXRefTarg(ReferenceTarget* ref);
01257 static ScripterExport Value* intern(ReferenceTarget* ref);
01258
01259
01260 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXRefTarg)) ? 1 : MAXWrapper::is_kind_of(c); }
01261 void collect() { delete this; }
01262 ScripterExport void sprin1(CharStream* s);
01263 MCHAR* class_name() { return _M("MAXRefTarg"); }
01264
01265 };
01266
01267
01268
01269
01270
01271 visible_class (MAXTVNode)
01272
01273 class MAXTVNode : public MAXWrapper
01274 {
01275 public:
01276 ITrackViewNode* parent;
01277 int index;
01278 ITrackViewNode* me;
01279
01280 ScripterExport MAXTVNode(ITrackViewNode* parent, int index);
01281 static ScripterExport Value* intern(ITrackViewNode* parent, int index);
01282 static ScripterExport Value* intern(ITrackViewNode* itvnode);
01283
01284 classof_methods (MAXTVNode, MAXWrapper);
01285 void collect() { delete this; }
01286 ScripterExport void sprin1(CharStream* s);
01287 MCHAR* class_name() { return _M("TrackViewNode"); }
01288 ReferenceTarget* get_max_object();
01289 ScripterExport ITrackViewNode* get_tvnode();
01290
01291 Value* get_property(Value** arg_list, int count);
01292 Value* set_property(Value** arg_list, int count);
01293
01294 Control* get_max_prop_controller(Value* prop, ParamDimension** pdim);
01295 BOOL set_max_prop_controller(Value* prop, MAXControl* c);
01296 Control* get_max_pos_controller(ParamDimension** pdim) { return get_max_prop_controller(n_position, pdim); }
01297 Control* get_max_scale_controller(ParamDimension** pdim) { return get_max_prop_controller(n_scale, pdim); }
01298 Control* get_max_rotation_controller(ParamDimension** pdim) { return get_max_prop_controller(n_rotation, pdim); }
01299
01300 def_generic ( get_props, "getPropNames" );
01301 def_property ( name );
01302
01303 RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message);
01304 BOOL IsRealDependency(ReferenceTarget *rtarg);
01305
01306 ITrackViewNode* to_trackviewnode() { check_for_deletion(); return (parent == NULL) ? MAXScript_interface->GetTrackViewRootNode() : parent->GetNode(index); }
01307 };
01308
01309
01310
01311 visible_class (TrackViewPickValue)
01312
01313 class TrackViewPickValue : public Value
01314 {
01315 public:
01316 TrackViewPick track;
01317 Value* client;
01318 Value* anim;
01319 int sub_num;
01320 MSTR name;
01321 ScripterExport TrackViewPickValue(TrackViewPick pick);
01322 classof_methods (TrackViewPickValue, Value);
01323 void collect() { delete this; }
01324 ScripterExport void sprin1(CharStream* s);
01325 void gc_trace();
01326 # define is_trackviewpick(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(TrackViewPickValue))
01327 Value* get_property(Value** arg_list, int count);
01328 Value* set_property(Value** arg_list, int count);
01329 };
01330
01331 visible_class (MAXTVUtility)
01332
01333 class MAXTVUtility : public MAXWrapper
01334 {
01335 public:
01336 ITreeView* tv;
01337 MSTR name;
01338 TrackViewUtility* tvUtil;
01339
01340 ScripterExport MAXTVUtility(TrackViewUtility* util, ITreeView* tv);
01341 static ScripterExport Value* intern(TrackViewUtility* util, ITreeView* tv);
01342
01343 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXTVUtility)) ? 1 : MAXWrapper::is_kind_of(c); }
01344 MCHAR* class_name();
01345 void collect() { delete this; }
01346 ScripterExport void sprin1(CharStream* s);
01347 void gc_trace();
01348
01349 Value* get_property(Value** arg_list, int count);
01350 Value* set_property(Value** arg_list, int count);
01351
01352 def_generic ( get_props, "getPropNames" );
01353 def_property ( name );
01354 };
01355
01356
01357
01358
01359
01360
01361
01362
01363 visible_class (MAXMeshClass)
01364
01365 class MAXMeshClass : public Value
01366 {
01367 public:
01368 MAXMeshClass();
01369
01370 classof_methods (MAXMeshClass, Value);
01371 void collect() { delete this; }
01372 ScripterExport void sprin1(CharStream* s);
01373 void export_to_scripter();
01374
01375 ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL);
01376 Class_ID get_max_class_id() { return triObjectClassID; }
01377 };
01378
01379
01380
01381
01382
01383 applyable_class (MeshValue)
01384
01385 class MeshValue : public MAXWrapper
01386 {
01387 public:
01388 Object* obj;
01389 Mesh* mesh;
01390 BOOL owned;
01391
01392 ScripterExport MeshValue(Mesh* imesh, BOOL owned = FALSE);
01393 ScripterExport MeshValue(Object* obj);
01394 static ScripterExport Value* intern(Object* obj);
01395 ~MeshValue();
01396
01397 classof_methods (MeshValue, MAXWrapper);
01398 # define is_mesh(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MeshValue))
01399 void collect() { delete this; }
01400 void sprin1(CharStream* s);
01401 MCHAR* class_name() { return _M("TriMesh"); }
01402 ReferenceTarget* get_max_object() { return obj; }
01403 protected:
01404 virtual void SetReference(int i, RefTargetHandle rtarg);
01405 public:
01406 RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message);
01408 BOOL CanTransferReference(int i) { UNUSED_PARAM(i); return FALSE; }
01409 BOOL IsRealDependency(ReferenceTarget* target);
01410
01411 void setup_mesh(int access = MESH_READ_ACCESS);
01412
01413
01414 def_generic ( setvert, "setvert");
01415 def_generic_debug_ok ( getvert, "getvert");
01416 def_generic ( settvert, "settvert");
01417 def_generic_debug_ok ( gettvert, "gettvert");
01418 def_generic ( setvertcolor, "setvertcolor");
01419 def_generic_debug_ok ( getvertcolor, "getvertcolor");
01420 def_generic ( setnumverts, "setnumverts");
01421 def_generic_debug_ok ( getnumverts, "getnumverts");
01422 def_generic ( setnumtverts, "setnumtverts");
01423 def_generic_debug_ok ( getnumtverts, "getnumtverts");
01424 def_generic ( setnumcpvverts, "setnumcpvverts");
01425 def_generic_debug_ok ( getnumcpvverts, "getnumcpvverts");
01426 def_generic ( setnumfaces, "setnumfaces");
01427 def_generic_debug_ok ( getnumfaces, "getnumfaces");
01428 def_generic ( buildtvfaces, "buildTVFaces");
01429 def_generic ( buildvcfaces, "buildVCFaces");
01430 def_generic ( defaultvcfaces, "defaultVCFaces");
01431 def_generic_debug_ok ( getnormal, "getnormal");
01432 def_generic ( setnormal, "setnormal");
01433 def_generic ( setface, "setface");
01434 def_generic_debug_ok ( getface, "getface");
01435 def_generic ( settvface, "setTVFace");
01436 def_generic_debug_ok ( gettvface, "getTVFace");
01437 def_generic ( setvcface, "setVCFace");
01438 def_generic_debug_ok ( getvcface, "getVCFace");
01439 def_generic_debug_ok ( getfacenormal, "getfacenormal");
01440 def_generic ( setfacenormal, "setfacenormal");
01441 def_generic ( setfacematid, "setfaceMatID");
01442 def_generic_debug_ok ( getfacematid, "getfaceMatID");
01443 def_generic ( setfacesmoothgroup, "setfaceSmoothGroup");
01444 def_generic_debug_ok ( getfacesmoothgroup, "getfaceSmoothGroup");
01445 def_generic ( setedgevis, "setedgevis");
01446 def_generic_debug_ok ( getedgevis, "getedgevis");
01447 def_generic ( detachVerts, "detachVerts");
01448 def_generic ( detachFaces, "detachFaces");
01449 def_generic ( extrudeface, "extrudeface");
01450 def_generic ( deletevert, "deletevert");
01451 def_generic ( deleteface, "deleteface");
01452 def_generic ( collapseface, "collapseface");
01453 def_generic ( setMesh, "setMesh");
01454 def_generic ( update, "update");
01455 def_generic_debug_ok ( getVertSelection, "getVertSelection");
01456 def_generic ( setVertSelection, "setVertSelection");
01457 def_generic_debug_ok ( getFaceSelection, "getFaceSelection");
01458 def_generic ( setFaceSelection, "setFaceSelection");
01459 def_generic_debug_ok ( getEdgeSelection, "getEdgeSelection");
01460 def_generic ( setEdgeSelection, "setEdgeSelection");
01461
01462 def_generic ( copy, "copy");
01463 def_generic ( delete, "delete");
01464 use_generic ( plus, "+" );
01465 use_generic ( minus, "-" );
01466 use_generic ( times, "*" );
01467
01468 use_generic ( move, "move" );
01469 use_generic ( rotate, "rotate" );
01470 use_generic ( scale, "scale" );
01471 use_generic ( transform, "transform" );
01472
01473 use_generic ( free, "free");
01474
01475 def_property( numverts );
01476 def_property( numtverts );
01477 def_property( numfaces );
01478 def_property( numcpvverts );
01479 def_property( mesh );
01480
01481 def_property( vertices );
01482 def_property( selectedVertices );
01483 def_property( faces );
01484 def_property( selectedFaces );
01485 def_property( edges );
01486 def_property( selectedEdges );
01487
01488
01489 Mesh* to_mesh() { setup_mesh(); return mesh; }
01490 void to_fpvalue(FPValue& v) { setup_mesh(); v.msh = mesh; v.type = TYPE_MESH; }
01491
01492 Value* get_property(Value** arg_list, int count);
01493 Value* set_property(Value** arg_list, int count);
01494
01495 BitArray get_vertsel() { setup_mesh(); return mesh->vertSel; }
01496 BitArray get_facesel() { setup_mesh(); return mesh->faceSel; }
01497 BitArray get_edgesel() { setup_mesh(); return mesh->edgeSel; }
01498 void set_vertsel(BitArray &sel) { setup_mesh(MESH_WRITE_ACCESS); mesh->vertSel = sel; }
01499 void set_facesel(BitArray &sel) { setup_mesh(MESH_WRITE_ACCESS); mesh->faceSel = sel; }
01500 void set_edgesel(BitArray &sel) { setup_mesh(MESH_WRITE_ACCESS); mesh->edgeSel = sel; }
01501 Mesh* set_up_mesh_access(int access, ReferenceTarget** owner = NULL);
01502 Mesh* set_up_mesh_face_access(int index, int access, ReferenceTarget** owner = NULL);
01503 Mesh* set_up_mesh_vertex_access(int index, int access, ReferenceTarget** owner = NULL);
01504 };
01505
01506
01507
01508 visible_class (MAXAtmospheric)
01509
01510 class MAXAtmospheric : public MAXWrapper
01511 {
01512 public:
01513 Atmospheric* atmos;
01514
01515 ScripterExport MAXAtmospheric(Atmospheric* iatmos);
01516 static ScripterExport Value* intern(Atmospheric* iatmos);
01517
01518 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXAtmospheric)) ? 1 : MAXWrapper::is_kind_of(c); }
01519 void collect() { delete this; }
01520 ScripterExport void sprin1(CharStream* s);
01521 MCHAR* class_name() { return _M("Atmospheric"); }
01522
01523 #include "..\macros\define_implementations.h"
01524 #include "..\protocols\atmospherics.inl"
01525
01526 def_property ( name );
01527 def_prop_getter ( numGizmos );
01528
01529 Atmospheric* to_atmospheric() { check_for_deletion(); return atmos; }
01530 };
01531
01532
01533
01534 visible_class (MAXEffect)
01535
01536 class MAXEffect : public MAXWrapper
01537 {
01538 public:
01539 Effect* effect;
01540
01541 ScripterExport MAXEffect(Effect* ieffect);
01542 static ScripterExport Value* intern(Effect* ieffect);
01543
01544 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXEffect)) ? 1 : MAXWrapper::is_kind_of(c); }
01545 void collect() { delete this; }
01546 ScripterExport void sprin1(CharStream* s);
01547 MCHAR* class_name() { return _M("Effect"); }
01548
01549 #include "..\macros\define_implementations.h"
01550 #include "..\protocols\atmospherics.inl"
01551
01552 def_property ( name );
01553 def_prop_getter ( numGizmos );
01554
01555 Effect* to_effect() { check_for_deletion(); return effect; }
01556 };
01557
01558
01559
01560 visible_class (MAXMultiPassCameraEffect)
01561
01562 class MAXMultiPassCameraEffect : public MAXWrapper
01563 {
01564 public:
01565 IMultiPassCameraEffect* effect;
01566
01567 ScripterExport MAXMultiPassCameraEffect(IMultiPassCameraEffect* ieffect);
01568 static ScripterExport Value* intern(IMultiPassCameraEffect* ieffect);
01569
01570 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXMultiPassCameraEffect)) ? 1 : MAXWrapper::is_kind_of(c); }
01571 void collect() { delete this; }
01572 ScripterExport void sprin1(CharStream* s);
01573 MCHAR* class_name() { return _M("MultiPassCameraEffect"); }
01574
01575 def_generic( iscompatible, "isCompatible");
01576
01577 IMultiPassCameraEffect* to_mpassCamEffect() { check_for_deletion(); return effect; }
01578 };
01579
01580
01581
01582 visible_class (MAXShadowType)
01583
01584 class MAXShadowType : public MAXWrapper
01585 {
01586 public:
01587 ShadowType* shadow;
01588
01589 ScripterExport MAXShadowType(ShadowType* ishadow);
01590 static ScripterExport Value* intern(ShadowType* ishadow);
01591
01592 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXShadowType)) ? 1 : MAXWrapper::is_kind_of(c); }
01593 void collect() { delete this; }
01594 ScripterExport void sprin1(CharStream* s);
01595 MCHAR* class_name() { return _M("MAXShadowType"); }
01596
01597 ShadowType* to_shadowtype() { check_for_deletion(); return shadow; }
01598 };
01599
01600
01601
01602
01603 visible_class (MAXRenderer)
01604
01605 class MAXRenderer : public MAXWrapper
01606 {
01607 public:
01608 Renderer* renderer;
01609
01610 ScripterExport MAXRenderer(Renderer* irenderer);
01611 static ScripterExport Value* intern(Renderer* irenderer);
01612
01613 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXRenderer)) ? 1 : MAXWrapper::is_kind_of(c); }
01614 void collect() { delete this; }
01615 ScripterExport void sprin1(CharStream* s);
01616 MCHAR* class_name() { return _M("MAXRenderer"); }
01617
01618 Value* get_property(Value** arg_list, int count);
01619 Value* set_property(Value** arg_list, int count);
01620
01621 Renderer* to_renderer() { check_for_deletion(); return renderer; }
01622 };
01623
01624
01625
01626 visible_class (MAXCustAttrib)
01627
01628 class MAXCustAttrib : public MAXWrapper
01629 {
01630 public:
01631 CustAttrib* custattrib;
01632
01633 ScripterExport MAXCustAttrib(CustAttrib* icustattrib);
01634 static ScripterExport Value* intern(CustAttrib* icustattrib);
01635 # define is_custattrib(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXCustAttrib))
01636
01637 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(MAXCustAttrib)) ? 1 : MAXWrapper::is_kind_of(c); }
01638 void collect() { delete this; }
01639 ScripterExport void sprin1(CharStream* s);
01640 MCHAR* class_name() { return _M("MAXCustAttrib"); }
01641
01642
01643
01644
01645 def_property ( name );
01646 CustAttrib* to_custattrib() { check_for_deletion(); return custattrib; }
01647 };
01648
01649
01650 visible_class (MAXCustAttribArray)
01651
01652 class MAXCustAttribArray : public Value
01653 {
01654 public:
01655 MAXWrapper* ref;
01656
01657 ENABLE_STACK_ALLOCATE(MAXCustAttribArray);
01658 ScripterExport MAXCustAttribArray(MAXWrapper* ref);
01659 ScripterExport MAXCustAttribArray(ReferenceTarget* ref);
01660 ScripterExport MAXCustAttribArray(MAXRefTarg* ref);
01661
01662 classof_methods (MAXCustAttribArray, Value);
01663 void collect() { delete this; }
01664 void gc_trace();
01665 BOOL _is_collection() { return 1; }
01666 ScripterExport void sprin1(CharStream* s);
01667 CustAttrib* get_CustAttrib(int index);
01668 CustAttrib* find_CustAttrib(MCHAR* name);
01669
01670
01671 ScripterExport Value* map(node_map& m);
01672
01673 #include "..\macros\define_implementations.h"
01674 # include "..\protocols\arrays.inl"
01675
01676
01677 def_property ( count );
01678
01679 };
01680
01681
01682
01683
01684
01685
01686 class ChangeHandler;
01687
01688 visible_class (ChangeHandler)
01689
01690 class CHTimeChangeCallback : public TimeChangeCallback
01691 {
01692 public:
01693 static BOOL registered;
01694 static Tab<ChangeHandler*> handlers;
01695 static BOOL notified;
01696 public:
01697 void TimeChanged(TimeValue t);
01698 };
01699
01700 class CHRedrawViewsCallback : public RedrawViewsCallback
01701 {
01702 public:
01703 static BOOL registered;
01704 static Tab<ChangeHandler*> handlers;
01705 static BOOL notified;
01706 public:
01707 void proc(Interface *ip);
01708 };
01709
01710 class ChangeHandler : public MAXWrapper
01711 {
01712 public:
01713 Value* fn;
01714 Value* attribute;
01715 Value* id;
01716 Value* handle_at;
01717 short parameter_count;
01718 short flags;
01719 Tab<ReferenceTarget*> targets;
01720
01721 static CHRedrawViewsCallback chrvcb;
01722 static CHTimeChangeCallback chtccb;
01723 static Tab<ChangeHandler*> handlers;
01724 static BOOL delete_flagged;
01725
01726 ChangeHandler(Value* ifn, Value* attrib, Value* id, Value* handle_at);
01727
01728 classof_methods (ChangeHandler, Value);
01729 void collect() { delete this; }
01730 void gc_trace();
01731 MCHAR* class_name() { return _M("<ChangeHandler>"); }
01732 void handle_event(ReferenceTarget* target);
01733 void call_handler(ReferenceTarget* target);
01734
01735 RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget,
01736 PartID& partID, RefMessage message);
01737 BOOL IsRealDependency(ReferenceTarget* target) { UNUSED_PARAM(target); return FALSE; }
01738 };
01739
01740 #define CH_BROKEN 0x0001 // fn had a runtime error, disabled
01741 #define CH_BUSY 0x0002 // fn is running, ignore recursive events
01742 #define CH_NOTIFIED 0x0004 // change notified, handle at next specied handleAt: event
01743 #define CH_DELETE 0x0008 // attempted delete within the change handler, mark for delayed delete
01744
01745
01746
01747
01748
01749 visible_class (MAXRootNode)
01750
01751 class MAXRootNode : public MAXWrapper
01752 {
01753 public:
01754 INode *node;
01755
01756 ScripterExport MAXRootNode(INode* init_node);
01757 static ScripterExport Value* intern(INode* init_node);
01758
01759 classof_methods (MAXRootNode, MAXWrapper);
01760 # define is_rootnode(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXRootNode))
01761 void collect() { delete this; }
01762 ScripterExport void sprin1(CharStream* s);
01763 MCHAR* class_name() { return _M("<root>"); }
01764
01765
01766
01767 #include "..\macros\define_implementations.h"
01768
01769 def_generic( eq, "=");
01770 def_generic( ne, "!=");
01771
01772
01773 def_property ( name );
01774 def_property ( children );
01775
01776 INode* to_rootnode() { check_for_deletion(); return node; }
01777 };
01778
01779
01780
01781
01782
01783 struct node_map
01784 {
01785 value_vf vfn_ptr;
01786 value_cf cfn_ptr;
01787 Value** arg_list;
01788 int count;
01789 BOOL (*selector)(INode*, int, void*);
01790 void* sel_arg;
01791 int get_index;
01792 int get_count;
01793 Value** get_result_p;
01794 Array* collection;
01795 short flags;
01796 };
01797
01798 #define NM_INVERT 0x0001 // invert map order, map parents last on the way out of the recursion
01799 #define NM_SELECT 0x0002 // applying a select, adjust clear flag
01800 #define NM_GET 0x0004 // doing a get, return get_index'th item
01801 #define NM_MXS_FN 0x0008 // cfn_ptr is actually a MAXScriptFunction*, apply directly
01802
01803 struct node_find
01804 {
01805 BOOL (*tester)(INode*, int, void*);
01806 void* test_arg;
01807 BOOL (*selector)(INode*, int, void*);
01808 void* sel_arg;
01809 };
01810
01811 struct node_get
01812 {
01813 PathName* path;
01814 BOOL (*selector)(INode*, int, void*);
01815 void* sel_arg;
01816 };
01817
01818 class ConvertToRestore : public RestoreObj
01819 {
01820 BOOL onlyForRedo;
01821 public:
01822 ConvertToRestore(BOOL onlyForRedo = FALSE) { this->onlyForRedo = onlyForRedo; }
01823 void Restore(int isUndo);
01824 void Redo();
01825 MSTR Description() {return MSTR(_M("convertTo()"));}
01826 };
01827
01828
01829 struct gbuff_chan_code
01830 {
01831 MCHAR* name;
01832 int code;
01833 };
01834
01835 extern gbuff_chan_code gbuff_chan_codes[];
01836
01837
01838 extern bool for_all_nodes(INode* root, node_map* m);
01839 extern Value* find_first_node(INode* root, node_find* f);
01840 extern Value* get_node(INode* root, node_get* g);
01841 extern bool for_all_path_nodes(INode* root, PathName* path, node_map* m);
01842 extern BOOL all_objects_selector(INode* node, int level, void* selector_arg);
01843 extern int max_name_compare(const MCHAR* max_name, const MCHAR* other);
01844 extern Value* get_subanim_property(Animatable* anim, Value* prop);
01845 extern Value* get_subanim_property(Animatable* anim, int i);
01846 extern Value* set_subanim_property(Animatable* anim, Value* prop, Value* val);
01847 extern Value* set_subanim_property(Animatable* anim, int i, Value* val);
01848 extern BOOL set_subanim_controller(Animatable* anim, Value* prop, Control* newc, MAXControl* newcv);
01849 extern Control* find_subanim_controller(Animatable* anim, Value* prop, ParamDimension** dim);
01850 extern void deselect_if_motion_panel_open();
01851
01852
01853
01854
01855
01856
01857
01858
01859
01860 class AssignControllerRestore : public RestoreObj {
01861 BOOL parity;
01862 public:
01863 ScripterExport AssignControllerRestore(BOOL p);
01864 void Restore(int isUndo);
01865 void Redo();
01866 MSTR Description();
01867 };
01868
01869 class NodeTab : public INodeTab
01870 {
01871 public:
01872 INodeTab* AsINodeTabPtr()
01873 {
01874 return reinterpret_cast<INodeTab*>(this);
01875 }
01876 INodeTab& AsINodeTabRef()
01877 {
01878 return reinterpret_cast<INodeTab&>(*this);
01879 }
01880 };
01881
01882
01883
01884 extern ScripterExport Value* collect_nodes(Value** arg_list, int count);
01885
01886 visible_class (MAXSceneXRef)
01887 class MAXSceneXRef : public MAXWrapper
01888 {
01889 public:
01890 int index;
01891 MSTR name;
01892 MSTR full_name;
01893 INode *root;
01894 ULONG nodeHandle;
01895
01896 ScripterExport MAXSceneXRef (INode* root, int i);
01897 static ScripterExport Value* intern(INode* root, int i);
01898 MCHAR* class_name() { return _M("XRefScene"); }
01899 classof_methods (MAXSceneXRef, MAXWrapper);
01900 void collect() { delete this; }
01901 ScripterExport void sprin1(CharStream* s);
01902 void check_for_xref_deletion();
01903
01904 #include "..\macros\define_implementations.h"
01905 # include "..\protocols\xrefs.inl"
01906
01907
01908 def_property( tree );
01909 def_property( parent );
01910 def_property( fileName );
01911
01912 def_property( autoUpdate );
01913 def_property( boxDisp );
01914 def_property( hidden );
01915 def_property( disabled );
01916 def_property( ignoreLights );
01917 def_property( ignoreCameras );
01918 def_property( ignoreShapes );
01919 def_property( ignoreHelpers );
01920 def_property( ignoreAnimation );
01921
01922 Value* get_property(Value** arg_list, int count);
01923 Value* set_property(Value** arg_list, int count);
01924 };
01925
01926
01927
01928
01929
01930
01931 visible_class (MAXRootScene)
01932
01933 class MAXRootScene : public MAXRefTarg
01934 {
01935 public:
01936 ScripterExport MAXRootScene(ReferenceTarget* ref);
01937 static ScripterExport Value* intern(ReferenceTarget* ref);
01938 ScripterExport void sprin1(CharStream* s);
01939 MCHAR* class_name() { return _M("<rootScene>"); }
01940 };