3ds Max C++ API Reference
Loading...
Searching...
No Matches
IAutoBackup Class Referenceabstract

Interface class for Autobackup. More...

#include <iAutobackup.h>

+ Inheritance diagram for IAutoBackup:

Public Member Functions

virtual void SetEnable (bool enable)=0
 Enables or disables AutoBackup.
 
virtual bool GetEnable () const =0
 
virtual void SetTempDisable (bool disable)=0
 Temporarily disables Autobackup Use this during operations where Autobackup should not occur (ex: Computations on separate threads, heavy scene manipulations) Pass true to this function before operation and false when operation is done.
 
virtual bool GetTempDisable () const =0
 
virtual void SetNumFiles (int n)=0
 Sets the number of Autobackup files.
 
virtual int GetNumFiles () const =0
 
virtual void SetInterval (float minutes)=0
 Sets the time interval before backup, in minutes.
 
virtual float GetInterval () const =0
 
virtual void SetFinalCountdownInterval (float minutes)=0
 Sets period of time at the end of autobackup interval during which timer can pause if there is user activity.
 
virtual float GetFinalCountdownInterval () const =0
 
virtual void SetFileName (const TCHAR *fileName)=0
 Sets the filename portion of Autobackup file, excluding path and extension.
 
virtual const MSTRGetFileName () const =0
 
virtual void SetPrependSceneName (bool prepend)=0
 When set to true, current scene name is prepended to autobackup file name.
 
virtual bool GetPrependSceneName () const =0
 
virtual void SetBailoutEnable (bool b)=0
 Turns on and off Bailout during Autobackup.
 
virtual bool GetBailoutEnable () const =0
 
virtual void SetCompressOnAutobackup (bool b)=0
 Sets whether Autobackup files should be compressed or not.
 
virtual bool GetCompressOnAutobackup () const =0
 
virtual void AutoBackupNow ()=0
 Performs the actual Autobackup operation.
 
virtual bool IsCurrentlySaving () const =0
 Tells whether an Autobackup operation is currently happening.
 
 __declspec (deprecated) virtual bool GetActive() const final
 
virtual void ResetTimer ()=0
 Resets timer to interval.
 
virtual void ResetTimer (float minutes)=0
 Resets timer to minutes.
 
virtual bool IsTimerStarted () const =0
 Returns true if Autobackup timer is started.
 
virtual int GetSecondsUntilNextAttempt () const =0
 Returns the number of seconds until the next Autobackup attempt.
 
virtual bool CanProceed () const =0
 Returns true if all conditions are satisfied for next Autobackup attempt to proceed, based on current state.
 
- 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.
 
CoreExport void AppendProperty (int id,...)
 Add a new property to this interface descriptor.
 
CoreExport void AppendEnum (int id,...)
 Add a new enum to this interface descriptor.
 
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 BaseInterfaceGetInterface (Interface_ID id)
 
virtual FPInterfaceDescGetDesc ()=0
 
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)
 
virtual ActionTableGetActionTable ()
 
virtual void EnableActions (BOOL onOff)
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor.
 
UtilExport BaseInterfaceGetInterface (Interface_ID id) override
 
virtual UtilExport Interface_ID GetID ()
 
virtual LifetimeType LifetimeControl ()
 
virtual bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=nullptr)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor.
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Static Public Attributes

static constexpr Interface_ID ID = AutoBackup_INTERFACE
 
- Static Public Attributes inherited from FPInterface
static CoreExport FPInterfaceDesc nullInterface
 

Additional Inherited Members

- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled }
 
- 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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 
- 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
 
- 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 Autobackup.

Interface for AutoBackup class. This class has only one instance and is responsible for automatically saving the max scene at periodic time intervals.

Member Function Documentation

◆ SetEnable()

virtual void SetEnable ( bool  enable)
pure virtual

Enables or disables AutoBackup.

This change is reflected in preference settings. Changing this can cause UI redraws. To temporarily disable Autobackup during an operation, use SetTempDisable

See also
IAutoBackup::SetTempDisable

◆ GetEnable()

virtual bool GetEnable ( ) const
pure virtual
Returns
true when Autobackup feature is enabled

◆ SetTempDisable()

virtual void SetTempDisable ( bool  disable)
pure virtual

Temporarily disables Autobackup Use this during operations where Autobackup should not occur (ex: Computations on separate threads, heavy scene manipulations) Pass true to this function before operation and false when operation is done.

This can be called many times with 'true'. Autobackup is re-enabled when the same number of 'false' are passed

See also
AutoBackupDisableHelper

◆ GetTempDisable()

virtual bool GetTempDisable ( ) const
pure virtual
Returns
true when Autobackup is temporarily disabled

◆ SetNumFiles()

virtual void SetNumFiles ( int  n)
pure virtual

Sets the number of Autobackup files.

When that number is reached, Autobackup will overwrite older backup files

◆ GetNumFiles()

virtual int GetNumFiles ( ) const
pure virtual
Returns
Number of Autobackup files

◆ SetInterval()

virtual void SetInterval ( float  minutes)
pure virtual

Sets the time interval before backup, in minutes.

◆ GetInterval()

virtual float GetInterval ( ) const
pure virtual
Returns
Autobackup interval in minutes

◆ SetFinalCountdownInterval()

virtual void SetFinalCountdownInterval ( float  minutes)
pure virtual

Sets period of time at the end of autobackup interval during which timer can pause if there is user activity.

If set to 0, activity detection is disabled and backup will always proceed when GetSecondsUntilNextAttempt goes down to 0.

See also
GetSecondsUntilNextAttempt

◆ GetFinalCountdownInterval()

virtual float GetFinalCountdownInterval ( ) const
pure virtual
Returns
Final countdown interval in minutes

◆ SetFileName()

virtual void SetFileName ( const TCHAR *  fileName)
pure virtual

Sets the filename portion of Autobackup file, excluding path and extension.

Pass empty string "" to reset to default file name The full path is determined by system paths, project paths and SetPrependSceneName

See also
IPathConfigMgr::GetDir, APP_AUTOBACK_DIR, SetPrependSceneName

◆ GetFileName()

virtual const MSTR & GetFileName ( ) const
pure virtual
Returns
File name of Autobackup file, excluding path and extension.

◆ SetPrependSceneName()

virtual void SetPrependSceneName ( bool  prepend)
pure virtual

When set to true, current scene name is prepended to autobackup file name.

ex: myScene_AutoBackup01.max In that case, the total number of Autobackup files as determined by SetNumFiles is counted per-scene

See also
SetFileName, SetNumFiles

◆ GetPrependSceneName()

virtual bool GetPrependSceneName ( ) const
pure virtual
Returns
true if scene name is prepended to autobackup file name

◆ SetBailoutEnable()

virtual void SetBailoutEnable ( bool  b)
pure virtual

Turns on and off Bailout during Autobackup.

Allows user to abort backup by pressing escape key

See also
Class MaxSDK::Util::IBailOutBusyProcessManager

◆ GetBailoutEnable()

virtual bool GetBailoutEnable ( ) const
pure virtual
Returns
true when Autobackup bailout is enabled

◆ SetCompressOnAutobackup()

virtual void SetCompressOnAutobackup ( bool  b)
pure virtual

Sets whether Autobackup files should be compressed or not.

◆ GetCompressOnAutobackup()

virtual bool GetCompressOnAutobackup ( ) const
pure virtual
Returns
true when Autobackup files will be compressed

◆ AutoBackupNow()

virtual void AutoBackupNow ( )
pure virtual

Performs the actual Autobackup operation.

◆ IsCurrentlySaving()

virtual bool IsCurrentlySaving ( ) const
pure virtual

Tells whether an Autobackup operation is currently happening.

◆ __declspec()

__declspec ( deprecated  ) const
inlinefinal
Deprecated:
This has been deprecated as of 3ds Max 2023, please use IsCurrentlySaving() instead
96{ return IsCurrentlySaving(); };
virtual bool IsCurrentlySaving() const =0
Tells whether an Autobackup operation is currently happening.

◆ ResetTimer() [1/2]

virtual void ResetTimer ( )
pure virtual

Resets timer to interval.

Does nothing when timer is not started

See also
GetInterval, IsTimerStarted

◆ ResetTimer() [2/2]

virtual void ResetTimer ( float  minutes)
pure virtual

Resets timer to minutes.

◆ IsTimerStarted()

virtual bool IsTimerStarted ( ) const
pure virtual

Returns true if Autobackup timer is started.

◆ GetSecondsUntilNextAttempt()

virtual int GetSecondsUntilNextAttempt ( ) const
pure virtual

Returns the number of seconds until the next Autobackup attempt.

Returns -1 if Autobackup is disabled or if Autobackup timer is not started

See also
IsTimerStarted, GetInterval

◆ CanProceed()

virtual bool CanProceed ( ) const
pure virtual

Returns true if all conditions are satisfied for next Autobackup attempt to proceed, based on current state.

If this is still true when GetSecondsUntilNextAttempt() goes down to 0, Autobackup kicks in. \ see GetSecondsUntilNextAttempt

// approximate implementation
{
return GetEnable() // Autobackup enabled
&& !GetTempDisable() // Autobackup not temporarily disabled
&& !IsCurrentlySaving() // Autobackup not in the middle of saving a backup
&& !GetCOREInterface8()->IsSavingToFile() // 3ds Max not in the middle of saving a scene
&& IsSaveRequired() // From custcont.h, scene "dirty" flag
&& IsAutoSaveRequired() // From custcont.h, scene "dirty" flag
&& GetCapture() == nullptr // from WinUser.h, no window is capturing mouse input
&& IsWindowEnabled(GetCOREInterface()->GetMAXHWnd()) // from WinUser.h, no modal dialog on top of main 3ds Max window
// Implementation defined using GetFocus() from WinUser.h. Keyboard focus is not in a text edit field
&& !IsKeyboardFocusInEditField()
}
virtual bool GetEnable() const =0
virtual bool GetTempDisable() const =0
virtual bool IsSavingToFile()=0
Returns whether a file save operation is currently in progress.
CoreExport BOOL IsAutoSaveRequired()
This tells if the current scene needs to be backed up.
CoreExport BOOL IsSaveRequired()
This tells if the scene needs to be saved.
CoreExport Interface * GetCOREInterface()
CoreExport Interface8 * GetCOREInterface8()

Member Data Documentation

◆ ID

constexpr Interface_ID ID = AutoBackup_INTERFACE
staticconstexpr