maxscript/mxsplugin/mxsPlugin.h File Reference
 
 
 
maxscript/mxsplugin/mxsPlugin.h File Reference

This reference page is linked to from the following overview topics: SDK Change Details.


#include "../kernel/value.h"
#include "../maxwrapper/mxsobjects.h"
#include "../../ref.h"
#include "../../iparamm2.h"
#include "../../iparamb2.h"
#include "../../iparamb2Typedefs.h"
#include "../../IMtlRender_Compatibility.h"
#include "../../genlight.h"
#include "../../gencam.h"
#include "../../simpobj.h"
#include "../../manipulator.h"
#include "../../simpmod.h"
#include "../../tvutil.h"
#include "../macros/define_implementations.h"

Classes

class   ParamRef
class   MSPluginDesc
class   MSPluginPBAccessor
class   MSPlugin
class   MSPluginValueMigrator
class   MSPluginObject< TYPE >
class   MSObjectXtnd< TYPE, MS_SUPER >
class   MSPluginGeomObject
class   MSGeomObjectXtnd
class   MSPluginHelper
class   MSHelperXtnd
class   MSPluginLight
class   MSLightXtnd
class   MSPluginCamera
class   MSCameraXtnd
class   MSPluginShape
class   MSShapeXtnd
class   MSPluginSimpleObject
class   MSSimpleObjectXtnd
class   MSPluginSimpleManipulator
class   MSSimpleManipulatorXtnd
class   MSPluginModifier
class   MSModifierXtnd
class   MSPluginSimpleMod
class   MSSimpleModXtnd
class   MSPluginTexmap
class   MSTexmapXtnd
class   MSPluginMtl
class   MSMtlXtnd
class   MSAutoMParamDlg
class   MSPluginSpecialFX< TYPE >
class   MSSpecialFXXtnd< TYPE, MS_SUPER >
class   MSPluginEffect
class   MSEffectXtnd
class   MSAutoEParamDlg
class   MSPluginAtmos
class   MSAtmosXtnd
class   MSPluginTrackViewUtility
class   PluginClassDefPLCB1
class   PluginClassDefPLCB2

Defines

#define  is_msplugin_class(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MSPluginClass))
#define  MPC_TEMPORARY   (1<<0)
#define  MPC_REDEFINITION   (1<<1)
#define  MPC_MS_CREATING   (1<<2)
#define  MPC_MS_WAS_CREATING   (1<<3)
#define  MPC_EDITING_IN_CP   (1<<4)
#define  MPC_EDITING_IN_MTLEDT   (1<<5)
#define  MPC_EDITING_IN_EFX   (1<<6)
#define  MPC_REPLACE_UI   (1<<7)
#define  MPC_INVISIBLE   (1<<8)
#define  MPC_SILENTERRORS   (1<<9)
#define  MPC_MAX_CREATING   (1<<10)
#define  MPC_ABORT_CREATE   (1<<11)
#define  MPC_LEVEL_6   (1<<12)
#define  MPC_IS_MANIP   (1<<13)
#define  MPC_ALTERNATE   (1<<14)
#define  MPC_CAD_FILESAVE   (1<<15)
#define  MPC_PROMOTE_DEL_PROPS   (1<<16)
#define  MPC_USE_PB_VALIDITY   (1<<17)
#define  MPC_CAD_FILELOAD_LOADDEFDATA   (1<<18)
#define  key_parm(_key)   _get_key_param(keys, n_##_key)
#define  MSP_LOADING   0x0001
#define  MSP_DISABLED   0x0002
#define  MSP_DELETED   0x0004
#define  MSPLUGIN_CHUNK   0x0010

Typedefs

typedef RefTargetHandle(*  creator_fn )(MSPluginClass *pic, BOOL loading)

Enumerations

enum   { pl_this, pl_version, pl_loading, pl_delegate }
enum   { pl_extent = pl_delegate + 1, pl_min, pl_max, pl_center }
enum   { pl_mesh = pl_delegate + 1 }
enum   {
  pl_target = pl_delegate + 1, pl_node, pl_gizmoDontDisplay, pl_gizmoDontHitTest,
  pl_gizmoScaleToViewport, pl_gizmoUseScreenSpace, pl_gizmoActiveViewportOnly, pl_gizmoUseRelativeScreenSpace
}

Functions

  visible_class (MSPluginClass) class MSPluginClass
Value _get_key_param (Array *keys, Value *key_name)

Variables

PluginClassDefPLCB1  thePluginClassDefPLCB1
PluginClassDefPLCB2  thePluginClassDefPLCB2

Define Documentation

#define is_msplugin_class (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MSPluginClass))
#define MPC_TEMPORARY   (1<<0)
#define MPC_REDEFINITION   (1<<1)
#define MPC_MS_CREATING   (1<<2)
#define MPC_MS_WAS_CREATING   (1<<3)
#define MPC_EDITING_IN_CP   (1<<4)
#define MPC_EDITING_IN_MTLEDT   (1<<5)
#define MPC_EDITING_IN_EFX   (1<<6)
#define MPC_REPLACE_UI   (1<<7)
#define MPC_INVISIBLE   (1<<8)
#define MPC_SILENTERRORS   (1<<9)
#define MPC_MAX_CREATING   (1<<10)
#define MPC_ABORT_CREATE   (1<<11)
#define MPC_LEVEL_6   (1<<12)
#define MPC_IS_MANIP   (1<<13)
#define MPC_ALTERNATE   (1<<14)
#define MPC_CAD_FILESAVE   (1<<15)
#define MPC_PROMOTE_DEL_PROPS   (1<<16)
#define MPC_USE_PB_VALIDITY   (1<<17)
#define MPC_CAD_FILELOAD_LOADDEFDATA   (1<<18)
#define key_parm (   _key )    _get_key_param(keys, n_##_key)
#define MSP_LOADING   0x0001
#define MSP_DISABLED   0x0002
#define MSP_DELETED   0x0004
#define MSPLUGIN_CHUNK   0x0010

Typedef Documentation

typedef RefTargetHandle(* creator_fn)(MSPluginClass *pic, BOOL loading)

Enumeration Type Documentation

anonymous enum
Enumerator:
pl_mesh 
     { 
        pl_mesh = pl_delegate + 1                                                               // for SimpleObjects 
};

Function Documentation

visible_class ( MSPluginClass  )

Define an equal operator (i.e. '==') for maxscript visible values.

Define a NOT equal operator (i.e. '!=') for maxscript visible values.

                    : public MAXClass
{
protected:
                                        MSPluginClass() { }
public:
        Value*                  class_name;             // UI-visible class name - Localized 
        HINSTANCE               hInstance;              // owning module
        ClassDesc*              extend_cd;              // if extending, ClassDesc of class to extend
        creator_fn              obj_creator;    // obj maker for the appropriate MSPlugin subclass      
        HashTable*              local_scope;    // local name space     
        Value**                 local_inits;    // local var init vals  
        int                             local_count;    //   "    "  count      
        HashTable*              handlers;               // handler tables       
        Array*                  rollouts;               // UI rollouts
        MouseTool*              create_tool;    // scripted creation tool if non-NULL
        Array*                  pblock_defs;    // parameter block definition data from compiler (used to build the PB2 descs)
        Array*                  remap_param_names;      // defines the mapping of old param names to new param names
        Array*                  loading_pblock_defs; // parameter block definition data for currently loading scene file (to permit old version schema migration)
        Tab<ParamBlockDesc2*> pbds;             // parameter block descriptors
        ReferenceTarget* alternate;             // any alternate UI object system-style during create mode
        Tab<ParamRef>   sub_texmaps;    // param references to any texmaps in pblocks in instances of this class in subobjno order
        Tab<ParamRef>   sub_mtls;               // param references to any mtls in pblocks in instances of this class in subobjno order
        int                             version;                // plugin version (from version: param on def header)
        DWORD                   mpc_flags;              // flags        
        DWORD                   rollup_state;   // initial rollup state

        static HashTable* msp_classes;  // table of existing scripted plugin classes to enable redefinition
        static MSPlugin* creating;              // object currently being created if non-NULL
        static bool              loading;               // currently loading defs from a scene file, delay TV & other updates

                                        MSPluginClass(Value* name, MAXSuperClass* supcls, creator_fn cfn);
                                   ~MSPluginClass();

        // definition and redefinition
        static MSPluginClass* intern(Value* name, MAXSuperClass* supcls, creator_fn cfn);
        void                    init(int local_count, Value** inits, HashTable* local_scope, HashTable* handlers, Array* pblock_defs, Array* iremap_param_names, Array* rollouts, MouseTool* create_tool);

        // MAXScript required
//      BOOL                    is_kind_of(ValueMetaClass* c) { return (c == class_tag(MSPluginClass)) ? 1 : Value::is_kind_of(c); } // LAM: 2/23/01
        BOOL                    is_kind_of(ValueMetaClass* c) { return (c == class_tag(MSPluginClass)) ? 1 : MAXClass::is_kind_of(c); }
#       define                  is_msplugin_class(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MSPluginClass))
        void                    gc_trace();
        void                    collect();

        // from Value 
        Value*                  apply(Value** arglist, int count, CallContext* cc=NULL);                // object creation by applying class object

        // local
        void                    SetClassID(Value* cidv);
        void                    SetExtension(Value* cls);
        void                    SetVersion(Value* ver) { version = ver->to_int(); }
        void                    StopEditing(int stop_flags = 0);
        void                    RestartEditing();
        static int                      lookup_assetType(Value* name);
        static ParamType2       lookup_type(Value* name);
        void                    call_handler(Value* handler, Value** arg_list, int count, TimeValue t, BOOL disable_on_error=FALSE);
        // low level handler call, returns result from handler, but needs init_thread_locals() & push/pop_alloc_frame around it
        Value*                  _call_handler(Value* handler, Value** arg_list, int count, TimeValue t, BOOL disable_on_error=FALSE);

        virtual bool    is_custAttribDef() { return false; }

        // alternate UI
        void                    install_alternate(ReferenceTarget* ref);
        // schema migration
        void                    build_paramblk_descs();
        void                    redefine(MSPlugin* val, HashTable* old_locals, Array* old_pblock_defs);
        Array*                  find_pblock_def(Value* name, Array* pblock_defs);
        // scene I/O
        static void             save_class_defs(ISave* isave);
        static IOResult load_class_def(ILoad* iload);
        static void             post_load(ILoad *iload, int which);

        // ClassDesc delegates
        virtual RefTargetHandle Create(BOOL loading);
        const MCHAR*    ClassName() { return class_name->to_string(); }
        SClass_ID               SuperClassID() { return sclass_id; }
        Class_ID                ClassID() { return class_id; }
        const MCHAR*    Category() { return category ? category->to_string() : _M(""); }
        const MCHAR*    InternalName() { return name->to_string(); }
        HINSTANCE               HInstance() { return hInstance; }
    BOOL                        IsManipulator();
    BOOL            CanManipulate(ReferenceTarget* hTarget);
    BOOL                        CanManipulateNode(INode* pNode);
    Manipulator*        CreateManipulator(ReferenceTarget* hTarget, INode* pNode);
    Manipulator*        CreateManipulator(INode* pNode);

#include "../macros/define_implementations.h"
        // props
        def_prop_getter(name);
};
Value* _get_key_param ( Array *  keys,
Value key_name 
)

Variable Documentation