3ds Max C++ API Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
functions.h File Reference
#include "arrays.h"
#include "../../ifnpub.h"
#include "../../GetCOREInterface.h"

Classes

struct  DumpValueData
 
class  Function
 
class  CallContext
 
class  ScopedPushCallContext
 Class that uses the RAII idiom to push/pop a CallContext. More...
 
class  Generic
 
class  MappedGeneric
 
class  NodeGeneric
 
class  Primitive
 
class  MappedPrimitive
 
class  MAXScriptFunction
 
class  StructMethod
 
class  SMCallContext
 
class  PluginMethod
 
class  UserProp
 
class  UserGeneric
 
class  UserGenericValue
 
class  InterfaceFunction
 
class  ValueConverter
 
class  InterfaceMethod
 
class  IObjectValue
 
class  FPInterfaceValue
 
class  FPMixinInterfaceValue
 
class  FPStaticMethodInterfaceValue
 
class  StaticInterfaceMethod
 

Macros

#define def_generic(fn, name)    ScripterExport Value* fn##_vf(Value** arglist, int arg_count)
 
#define FPS_CACHE_SIZE   512
 
#define is_function(v)   ((v)->_is_function())
 
#define is_maxscriptfunction(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXScriptFunction))
 
#define FN_MAPPED_FN   0x0001
 
#define FN_BODY_FN   0x0002
 
#define FN_HAS_REFARGS   0x0004
 
#define FN_MAPPED_EVAL   0x0008
 
#define is_structMethod(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_STRUCT_METHOD_TAG)
 
#define is_pluginMethod(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_MSPLUGIN_METHOD_TAG)
 
#define def_user_prop(_prop, _cls, _getter, _setter)    _cls##_class.add_user_prop(_M(#_prop), _getter, _setter)
 
#define def_user_generic(_fn, _cls, _name)    _cls##_class.add_user_generic(_T(#_name), _fn)
 
#define VALUECONVERTER_INTERFACE_ID   Interface_ID(0x19f37b9f, 0x39ed5680)
 
#define is_iobject(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(IObjectValue))
 
#define is_fpstaticinterface(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(FPInterfaceValue))
 
#define is_fpmixininterface(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(FPMixinInterfaceValue))
 
#define is_fpstaticmethodinterface(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(FPStaticMethodInterfaceValue))
 

Enumerations

enum  primitive_flag { LAZY_PRIMITIVE = 0x0001 , DEBUGGER_SAFE = 0x0002 }
 

Functions

ScripterExport void print_FP_interface (CharStream *out, FPInterface *fpi, bool getPropNames=true, bool getMethodNames=true, bool getInterfaceNames=true, bool getActionTables=true)
 
ScripterExport ValueCreateWrappedMAXScriptFunction (Value *val, MAXScript_TLS *_tls=nullptr)
 
ScripterExport bool GetMAXScriptFunctionParameterCount (Value *val, int &parameterCount)
 
ScripterExport bool IsSameMAXScriptFunction (Value *fn1, Value *fn2, MAXScript_TLS *_tls=nullptr)
 
ScripterExport ValueGetWrappedMAXScriptFunction (Value *val)
 

Macro Definition Documentation

◆ def_generic

#define def_generic (   fn,
  name 
)     ScripterExport Value* fn##_vf(Value** arglist, int arg_count)

◆ FPS_CACHE_SIZE

#define FPS_CACHE_SIZE   512

◆ is_function

#define is_function (   v)    ((v)->_is_function())

◆ is_maxscriptfunction

#define is_maxscriptfunction (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXScriptFunction))

◆ FN_MAPPED_FN

#define FN_MAPPED_FN   0x0001

◆ FN_BODY_FN

#define FN_BODY_FN   0x0002

◆ FN_HAS_REFARGS

#define FN_HAS_REFARGS   0x0004

◆ FN_MAPPED_EVAL

#define FN_MAPPED_EVAL   0x0008

◆ is_structMethod

#define is_structMethod (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_STRUCT_METHOD_TAG)

◆ is_pluginMethod

#define is_pluginMethod (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_MSPLUGIN_METHOD_TAG)

◆ def_user_prop

#define def_user_prop (   _prop,
  _cls,
  _getter,
  _setter 
)     _cls##_class.add_user_prop(_M(#_prop), _getter, _setter)

◆ def_user_generic

#define def_user_generic (   _fn,
  _cls,
  _name 
)     _cls##_class.add_user_generic(_T(#_name), _fn)

◆ VALUECONVERTER_INTERFACE_ID

#define VALUECONVERTER_INTERFACE_ID   Interface_ID(0x19f37b9f, 0x39ed5680)

◆ is_iobject

#define is_iobject (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(IObjectValue))

◆ is_fpstaticinterface

#define is_fpstaticinterface (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(FPInterfaceValue))

◆ is_fpmixininterface

#define is_fpmixininterface (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(FPMixinInterfaceValue))

◆ is_fpstaticmethodinterface

#define is_fpstaticmethodinterface (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(FPStaticMethodInterfaceValue))

Enumeration Type Documentation

◆ primitive_flag

Enumerator
LAZY_PRIMITIVE 
DEBUGGER_SAFE 
138{
139 LAZY_PRIMITIVE = 0x0001, // don't pre-evaluate args for lazy primitives
140 DEBUGGER_SAFE = 0x0002, // safe to call from debugger
141};
@ LAZY_PRIMITIVE
Definition: functions.h:139
@ DEBUGGER_SAFE
Definition: functions.h:140

Function Documentation

◆ print_FP_interface()

ScripterExport void print_FP_interface ( CharStream out,
FPInterface fpi,
bool  getPropNames = true,
bool  getMethodNames = true,
bool  getInterfaceNames = true,
bool  getActionTables = true 
)

◆ CreateWrappedMAXScriptFunction()

ScripterExport Value * CreateWrappedMAXScriptFunction ( Value val,
MAXScript_TLS _tls = nullptr 
)
Remarks
This function will wrap a Value in a StructMethod and/or a PluginMethod if the value is a MAXScriptFunction, the code is currently in a structure or plugin context, and the MAXScriptFunction's owner is the StructDef associated with the structure or the MSPluginClass associated with the plugin.
Parameters:
Value* val

The Value to potentially wrap.

MAXScript_TLS* _tls

The current MAXScript thread local storage pointer if known.
Returns
If val is a MAXScriptFunction, either a wrapper for the MAXScriptFunction, the MAXScriptFunction, or if not a MAXScriptFunction, the val.
Description:
This function is used when storing a MAXScriptFunction for later use in a callback. The MAXScriptFunction needs to be wrapped in a StructMethod and/or a PluginMethod if the MAXScriptFunction is defined by a StructDef and/or MSPluginClass so that the proper context is set when later calling the MAXScriptFunction. This context allows plugin and structure locals to be properly resolved to the instance of the plugin and/or structure the MAXScriptFunction was acquired from.

◆ GetMAXScriptFunctionParameterCount()

ScripterExport bool GetMAXScriptFunctionParameterCount ( Value val,
int parameterCount 
)
Remarks
Determines the number of parameters defined by a MAXScriptFunction.
Parameters:
Value* val

A potentially wrapped MAXScriptFunction.

int& parameterCount

The number of parameters defined by a MAXScriptFunction.
Returns
True if val is a MAXScriptFunction or a wrapped MAXScriptFunction, and the parameterCount arg was set. Otherwise, false.

◆ IsSameMAXScriptFunction()

ScripterExport bool IsSameMAXScriptFunction ( Value fn1,
Value fn2,
MAXScript_TLS _tls = nullptr 
)
Remarks
Determines if 2 values point to the same MAXScriptFunction in the same context.
Parameters:
Value* fn1

The first potentially wrapped MAXScriptFunction.

Value* fn2

The second potentially wrapped MAXScriptFunction.

Returns
True if both vals point to the same MAXScriptFunction, and if they are wrapped MAXScriptFunctions, whether there contexts are the same. Otherwise, false.

◆ GetWrappedMAXScriptFunction()

ScripterExport Value * GetWrappedMAXScriptFunction ( Value val)
Remarks
Return the wrapped MAXScriptFunction. MAXScriptFunction may be wrapped in a StructMethod and/or a PluginMethod
Parameters:
Value* val

A potentially wrapped MAXScriptFunction.

Returns
The wrapped MAXScriptFunction. If val is not a MAXScriptFunction, StructMethod, or PluginMethod, val is returned