OnBeginSceneSave (XSIApplication)

Description

Fired before a scene save operation is performed, such as a SaveScene command

This event is installed using the XSIApplication.Advise method and can be removed using the XSIApplication.Unadvise method, please see these methods for a detailed example of installing and uninstalling events.

The event may be temporarily muted via the EventInfo.Mute property. All installed events can be viewed in the plugin manager dialog's event tab.

NOTE: The prefered and alternative method of installing this is event is as a self-installing plugin. See PluginRegistrar.RegisterEvent method for more details.

Scripting Syntax

    XSIApplication.OnBeginSceneSave ([CustomData], [Abort])

Parameters

Parameter | Type | Description
CustomData | Variant | Custom data passed to the event handler. This argument is optional; you can specify one when binding an event with XSIApplication.Advise. The data is passed to the event handler whenever the event is fired, an empty value is passed if no custom data is specified.
Abort [out] | Boolean | The handler can set this argument to true for aborting this operation. PythonScript, PerlScript and JScript do not support output arguments. Use the return value to pass the abort status. PythonScript and PerlScript do not define a Boolean type so pass 1 for True and 0 for False.

Return Value

Boolean (true to abort operation).

Examples

1. VBScript Example

    function XSIApplication_OnBeginSceneSave( CustomData, abort )
       call Application.LogMessage( "*** VBScript Event - XSIApplication_OnBeginSceneSave ***")
       abort=False
    end Function

2. JScript Example

    function XSIApplication::OnBeginSceneSave( CustomData, Unused )
    {
       Application.LogMessage( "*** JScript Event - XSIApplication::OnBeginSceneSave ***");
       var abort=false;
       return abort;
    }

3. PerlScript Example

    sub XSIApplication_OnBeginSceneSave
    {
       my ($CustomData, $Unused) = @_;
       $Application->LogMessage( "*** PerlScript Event - XSIApplication_OnBeginSceneSave ***");
       # your code here
    my $abort = 0;
       return $abort;
    }

4. Python Example

    def XSIApplication_OnBeginSceneSave( data, abort ):
       Application.LogMessage( '*** PythonScript Event - XSIApplication_OnBeginSceneSave ***')
       # your code here
    abort=0
       return abort

5. C++ Example

    //
    // This example illustrates how to implement an event handler for the
    // OnBeginSceneSave event in C++/COM.
    //
    HRESULT WINAPI XSIOnEvent
    (
       LONG        in_lEventID,
       LPVARIANT   in_pVar,
       LONG        in_lNum
    )
    {
       switch (in_lEventID)
       {
           case siOnBeginSceneSave:
           {
              if (!CanSaveMyCurrentScene())
              {
                  // abort the operation using the predefined abort argument
                  LPVARIANT pVar = V_VARIANTREF(&in_pVar[1]);
                  V_BOOL(pVar) = VARIANT_TRUE;
              }
           }
           break;
       };
       return S_OK;
    }

See Also

XSIApplication.OnEndSceneSave | PluginRegistrar.RegisterEvent | XSIApplication.Advise | XSIApplication.Unadvise
XSIApplication.EventInfos |  |  |