OnBeginSceneOpen (XSIApplication)
Description
Fired before a scene open operation is performed, such as a OpenScene 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.OnBeginSceneOpen ([CustomData], [FileName], [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. |
FileName |
String |
The name of the scene to open. |
Abort [out] |
Boolean |
The handler can set this argument to true for aborting this operation. Note: 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
'VBScript handler function for the new scene event function XSIApplication_OnBeginSceneOpen( data, FileName, abort ) call LogMessage( "*** VBScript Event - XSIApplication_OnBeginSceneOpen ***" ) ' Scene open can be aborted by setting the abort output argument ' abort = True end function
2. JScript Example
function XSIApplication::OnBeginSceneOpen( CustomData, FileName, Unused )
{
Application.LogMessage( "*** JScript Event - XSIApplication::OnBeginSceneOpen ***");
// your code here
// return abort status in return code
// var abort = true;
return abort;
}
3. PerlScript Example
sub XSIApplication_OnBeginSceneOpen
{
my ($CustomData, $FileName, $Unused) = @_;
$Application->LogMessage( "*** PerlScript Event - XSIApplication_OnBeginSceneOpen ***");
# your code here
# return abort status in return code
my $abort=0;
return $abort;
}
4. Python Example
def XSIApplication_OnBeginSceneOpen( CustomData, FileName, Unused ): Application.LogMessage( '*** PythonScript Event - XSIApplication_OnBeginSceneOpen ***') # your code here # return abort status in return code abort=0 return abort
5. C++ Example
//
// This example illustrates how to implement an event handler for the
// OnBeginSceneOpen event in C++/COM.
//
HRESULT WINAPI XSIOnEvent
(
LONG in_lEventID,
LPVARIANT in_pVar,
LONG in_lNum
)
{
switch (in_lEventID)
{
case siOnBeginSceneOpen:
{
if (!CanOpenScene( in_pVar[1] ) )
{
// abort the operation using the predefined abort argument
LPVARIANT pVar = V_VARIANTREF(&in_pVar[2]);
V_BOOL(pVar) = VARIANT_TRUE;
}
}
break;
};
return S_OK;
}
See Also
PluginRegistrar.RegisterEvent |
|||
XSIApplication.EventInfos |
|
|
|