3ds Max C++ API Reference
Loading...
Searching...
No Matches
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)
#define FPS_CACHE_SIZE   512
#define is_function(v)
#define is_maxscriptfunction(v)
#define FN_MAPPED_FN   0x0001
#define FN_BODY_FN   0x0002
#define FN_HAS_REFARGS   0x0004
#define FN_MAPPED_EVAL   0x0008
#define is_structMethod(v)
#define is_pluginMethod(v)
#define def_user_prop(_prop, _cls, _getter, _setter)
#define def_user_generic(_fn, _cls, _name)
#define VALUECONVERTER_INTERFACE_ID   Interface_ID(0x19f37b9f, 0x39ed5680)
#define is_iobject(v)
#define is_fpstaticinterface(v)
#define is_fpmixininterface(v)
#define is_fpstaticmethodinterface(v)

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 )
Value:
ScripterExport Value* fn##_vf(Value** arglist, int arg_count)
#define ScripterExport
Definition ScripterExport.h:7
Definition value.h:107
15#define def_generic(fn, name) \
16 ScripterExport Value* fn##_vf(Value** arglist, int arg_count)

◆ FPS_CACHE_SIZE

#define FPS_CACHE_SIZE   512

◆ is_function

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

◆ is_maxscriptfunction

#define is_maxscriptfunction ( v)
Value:
Definition functions.h:183
#define DbgVerify(expr)
Definition assert1.h:85
#define is_sourcepositionwrapper(v)
Definition value.h:645
#define class_tag(_cls)
Definition value.h:602

◆ 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)
Value:
#define INTERNAL_STRUCT_METHOD_TAG
Definition value.h:628

◆ is_pluginMethod

#define is_pluginMethod ( v)
Value:
#define INTERNAL_MSPLUGIN_METHOD_TAG
Definition value.h:629

◆ def_user_prop

#define def_user_prop ( _prop,
_cls,
_getter,
_setter )
Value:
_cls##_class.add_user_prop(_M(#_prop), _getter, _setter)
#define _M(x)
Used to wrap string literals.
Definition strbasic.h:67
347#define def_user_prop(_prop, _cls, _getter, _setter) \
348 _cls##_class.add_user_prop(_M(#_prop), _getter, _setter)

◆ def_user_generic

#define def_user_generic ( _fn,
_cls,
_name )
Value:
_cls##_class.add_user_generic(_T(#_name), _fn)
350#define def_user_generic(_fn, _cls, _name) \
351 _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)
Value:
Definition functions.h:455

◆ is_fpstaticinterface

#define is_fpstaticinterface ( v)
Value:
Definition functions.h:488

◆ is_fpmixininterface

#define is_fpmixininterface ( v)
Value:

◆ is_fpstaticmethodinterface

#define is_fpstaticmethodinterface ( v)

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