3ds Max C++ API Reference
ISceneScriptSecurityManager Class Referenceabstract

Interface class for the Scene Script Security Manager. More...

#include <ISceneScriptSecurityManager.h>

+ Inheritance diagram for ISceneScriptSecurityManager:

Public Types

enum  SettingType { Current , Pending , SettingTypeNum }
 
enum  ScriptingFeature { Python , DotNet , MAXScriptSystemCommands }
 The features that can be enabled/disabled when executing scene embedded scripts in safe scene script execution mode. More...
 
- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled }
 

Public Member Functions

virtual bool AreSettingsLocked () const =0
 Gets whether the safe scene settings are locked for this 3ds Max session. More...
 
virtual bool IsSafeSceneScriptExecutionEnabled (SettingType type=SettingType::Current) const =0
 Gets whether safe scene script execution is enabled. More...
 
virtual bool IsSceneScriptExecutionBlocked (ScriptingFeature feature, SettingType type=SettingType::Current) const =0
 Gets whether execution is blocked for a particular scripting language/technology when safe scene script execution is enabled. More...
 
virtual bool IsShowSecurityMessagesWindowOnBlockedCommandsEnabled (SettingType type=SettingType::Current) const =0
 Gets whether the Security Messages window will be automatically opened when a scene script is blocked. More...
 
virtual bool IsShowScriptEditorOnBlockedCommandsEnabled (SettingType type=SettingType::Current) const =0
 Gets whether a script editor will be automatically opened when a scene script is blocked. More...
 
virtual void LogBlockedCommand (const MSTR &nameOfBlockedCommand, ScriptingFeature feature)=0
 Logs a message in the Security Messages window that notifies the user when a command from a scene script has been blocked. More...
 
virtual bool IsProtectedINIFile (const MCHAR *filename) const =0
 Gets whether the specified file name is a protected .ini file When safe scene script execution is enabled, certain .ini files are to be protected from modification via MAXScript methods. More...
 
virtual bool IsProtectedFileBasedOnExtension (const MCHAR *filename) const =0
 Gets whether the extension of the specified file name is a protected extension When safe scene script execution is enabled, files with certain extensions are to be protected from modification via MAXScript methods. More...
 
virtual ISecurityMessageManager * GetSecurityMessageManager ()=0
 
- Public Member Functions inherited from FPInterfaceDesc
CoreExport FPInterfaceDesc ()
 
CoreExport FPInterfaceDesc (Interface_ID id, const MCHAR *int_name, StringResID descr, ClassDesc *cd, ULONG flag,...)
 
CoreExport ~FPInterfaceDesc ()
 
virtual void Init ()
 
LifetimeType LifetimeControl ()
 
virtual BaseInterfaceGetInterface (Interface_ID id)
 
CoreExport void LoadDescriptor (Interface_ID id, const MCHAR *int_name, StringResID descr, ClassDesc *pCD, ULONG flag,...)
 
CoreExport void AppendFunction (int id,...)
 Add a new function to this interface descriptor. More...
 
CoreExport void AppendProperty (int id,...)
 Add a new property to this interface descriptor. More...
 
CoreExport void AppendEnum (int id,...)
 Add a new enum to this interface descriptor. More...
 
CoreExport void SetClassDesc (ClassDesc *i_cd)
 
CoreExport va_list check_fn (va_list ap, int id)
 
CoreExport va_list scan_fn (va_list ap, int id, int index)
 
CoreExport va_list check_prop (va_list ap, int id)
 
CoreExport va_list scan_prop (va_list ap, int id, int index)
 
CoreExport va_list check_enum (va_list ap, EnumID id)
 
CoreExport va_list scan_enum (va_list ap, EnumID id, int index)
 
FPInterfaceDescGetDesc ()
 
Interface_ID GetID ()
 
CoreExport FPFunctionDefGetFnDef (FunctionID fid)
 
ActionTableGetActionTable ()
 
CoreExport void EnableActions (BOOL onOff)
 
virtual CoreExport HINSTANCE HInstance ()
 
virtual CoreExport const MCHARGetRsrcString (StringResID id)
 
- Public Member Functions inherited from FPInterface
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t=0, FPParams *params=NULL)
 
virtual FPStatus Invoke (FunctionID fid, FPParams *params)
 
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t, FPValue &result, FPParams *params=NULL)
 
virtual FPStatus Invoke (FunctionID fid, FPValue &result, FPParams *params=NULL)
 
virtual CoreExport FunctionID FindFn (const MCHAR *name)
 
virtual CoreExport BOOL IsEnabled (FunctionID actionID)
 
virtual CoreExport BOOL IsChecked (FunctionID actionID)
 
virtual CoreExport BOOL IsVisible (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsEnabled (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsChecked (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsVisible (FunctionID actionID)
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor. More...
 
virtual bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=NULL)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Static Public Member Functions

static DllExport ISceneScriptSecurityManagerGetInstance ()
 Returns the only instance of this manager. More...
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Additional Inherited Members

- Public Attributes inherited from FPInterfaceDesc
Interface_ID ID
 
MSTR internal_name
 
StringResID description
 
ClassDesccd
 
USHORT flags
 
Tab< FPFunctionDef * > functions
 
Tab< FPPropDef * > props
 
Tab< FPEnum * > enumerations
 
MSPluginClasspc
 
Rolloutrollout
 
ActionTableaction_table
 
- Static Public Attributes inherited from FPInterface
static CoreExport FPInterfaceDesc nullInterface
 
- Protected Member Functions inherited from FPInterfaceDesc
CoreExport void load_descriptor (Interface_ID id, const MCHAR *int_name, StringResID descr, ClassDesc *cd, USHORT flag, va_list ap)
 
- Protected Member Functions inherited from FPInterface
virtual FPStatus _dispatch_fn (FunctionID fid, TimeValue t, FPValue &result, FPParams *p)
 

Detailed Description

Interface class for the Scene Script Security Manager.

Interface for the Scene Script Security Manager class. This class has only one instance. This singleton allows access to the security settings related to safe scene script execution.

Member Enumeration Documentation

◆ SettingType

Enumerator
Current 

The settings of the current 3ds Max session.

Pending 

The settings that will be applied in the next 3ds Max session if they are changed in the current session.

SettingTypeNum 

The number of setting types.

29  {
30  Current,
31  Pending,
33  };
@ Current
The settings of the current 3ds Max session.
Definition: ISceneScriptSecurityManager.h:30
@ Pending
The settings that will be applied in the next 3ds Max session if they are changed in the current sess...
Definition: ISceneScriptSecurityManager.h:31
@ SettingTypeNum
The number of setting types.
Definition: ISceneScriptSecurityManager.h:32

◆ ScriptingFeature

The features that can be enabled/disabled when executing scene embedded scripts in safe scene script execution mode.

Enumerator
Python 

Python.

DotNet 

Construction of .NET classes / class instances by MAXScript that were not pre-approved for unsafe mode.

MAXScriptSystemCommands 

Potentially unsafe MAXScript system commands.

37  {
38  Python,
39  DotNet,
41  };
@ MAXScriptSystemCommands
Potentially unsafe MAXScript system commands.
Definition: ISceneScriptSecurityManager.h:40
@ DotNet
Construction of .NET classes / class instances by MAXScript that were not pre-approved for unsafe mod...
Definition: ISceneScriptSecurityManager.h:39
@ Python
Python.
Definition: ISceneScriptSecurityManager.h:38

Member Function Documentation

◆ AreSettingsLocked()

virtual bool AreSettingsLocked ( ) const
pure virtual

Gets whether the safe scene settings are locked for this 3ds Max session.

◆ IsSafeSceneScriptExecutionEnabled()

virtual bool IsSafeSceneScriptExecutionEnabled ( SettingType  type = SettingType::Current) const
pure virtual

Gets whether safe scene script execution is enabled.

◆ IsSceneScriptExecutionBlocked()

virtual bool IsSceneScriptExecutionBlocked ( ScriptingFeature  feature,
SettingType  type = SettingType::Current 
) const
pure virtual

Gets whether execution is blocked for a particular scripting language/technology when safe scene script execution is enabled.

◆ IsShowSecurityMessagesWindowOnBlockedCommandsEnabled()

virtual bool IsShowSecurityMessagesWindowOnBlockedCommandsEnabled ( SettingType  type = SettingType::Current) const
pure virtual

Gets whether the Security Messages window will be automatically opened when a scene script is blocked.

◆ IsShowScriptEditorOnBlockedCommandsEnabled()

virtual bool IsShowScriptEditorOnBlockedCommandsEnabled ( SettingType  type = SettingType::Current) const
pure virtual

Gets whether a script editor will be automatically opened when a scene script is blocked.

◆ LogBlockedCommand()

virtual void LogBlockedCommand ( const MSTR nameOfBlockedCommand,
ScriptingFeature  feature 
)
pure virtual

Logs a message in the Security Messages window that notifies the user when a command from a scene script has been blocked.

Parameters
[in]nameOfBlockedCommand- The name of the command that was blocked. For example: "HiddenDOSCommand", "python.Execute", "System.Windows.Forms.ListView", etc. This information is displayed by the Security Messages window.
[in]feature- The type of command that was blocked. For example, if the command that was blocked was a "ShellExecute" MAXScript command, then ScriptingFeature::MAXScriptSystemCommands should be passed. If it was a "python.ExecuteFile" MAXScript command, then ScriptingFeature::Python should be passed. If it was a "dotNetClass" MAXScript command, then ScriptingFeature::DotNet should be passed. This information is used to compose an appropriate message to be displayed by the Security Messages window.

◆ IsProtectedINIFile()

virtual bool IsProtectedINIFile ( const MCHAR filename) const
pure virtual

Gets whether the specified file name is a protected .ini file When safe scene script execution is enabled, certain .ini files are to be protected from modification via MAXScript methods.

This method returns true if the specified file name is one of these protected .ini files.

Parameters
[in]filename- The file name to be tested.
Returns
True if the file name corresponds to a protected .ini file, false otherwise.

◆ IsProtectedFileBasedOnExtension()

virtual bool IsProtectedFileBasedOnExtension ( const MCHAR filename) const
pure virtual

Gets whether the extension of the specified file name is a protected extension When safe scene script execution is enabled, files with certain extensions are to be protected from modification via MAXScript methods.

This method returns true if the extension of the specified file name is one of these protected extensions.

Parameters
[in]filename- The file name to be tested.
Returns
True if the extension of the specified file name is one of the protected extensions, false otherwise.

◆ GetSecurityMessageManager()

virtual ISecurityMessageManager* GetSecurityMessageManager ( )
pure virtual

◆ GetInstance()

static DllExport ISceneScriptSecurityManager* GetInstance ( )
static

Returns the only instance of this manager.