XSI 5.1 Custom Events
The reference page for the OnEvent callback has an incorrect list of supported events, and is missing some of the context attributes for the new events.
The OnEvent reference page is found here: SDK Customization Guide > Self-Installing Plug-ins > Callbacks for Self-Installing Plug-ins > OnEvent.
Supported Events
The list of supported events should not include the following:
- siOnObjectAdded
- siOnObjectRemoved
These events are supported only by the custom display host
Here is the complete list of supported custom events:
- siOnActivate
- siOnBeginFileExport
- siOnBeginFileImport
- siOnBeginFrame
- siOnBeginNewScene
- siOnBeginSceneOpen
- siOnBeginSceneSave
- siOnBeginSceneSave2
- siOnBeginSceneSaveAs
- siOnBeginSequence
- siOnChangeProject
- siOnCloseScene
- siOnEndFileExport
- siOnEndFileImport
- siOnEndFrame
- siOnEndNewScene
- siOnEndSceneOpen
- siOnEndSceneSave
- siOnEndSceneSave2
- siOnEndSceneSaveAs
- siOnEndSequence
- siOnKeyDown
- siOnKeyUp
- siOnMaximize
- siOnMinimize
- siOnSelectionChange
- siOnSourcePathChange
- siOnStartup
- siOnTerminate
- siOnTimeChange
- siOnTimer
Event Context Attributes
Note that these events do not have context attributes:
- siOnBeginNewScene
- siOnBeginSceneSave
- siOnCloseScene
- siOnEndNewScene
- siOnStartup
- siOnTerminate
- siOnTimerEvent
- siOnMaximizeEvent
- siOnMinimizeEvent
Event |
Attribute |
Description |
siOnSourcePathChange |
FileName |
Full path name of the source file. The event can change this path using SetAttribute (OM) or PutAttribute (C++ API) on the event's context. If you change the path, the source uses that path instead of the original path. All path validation proceeds as usual though. |
SourceType |
A siSourcePathType value that specifies the type of source:
|
|
siOnChangeProject |
NewProjectPath |
Full path to the new project. |
OldProjectPath |
Full path to the previous project. | |
siOnBeginSceneOpen siOnEndSceneOpen siOnBeginSceneSaveAs siOnEndSceneSaveAs siOnBeginSceneSave2 siOnEndSceneSave2 |
FileName |
Full path name of the scene. |
siOnSelectionChange |
ChangeType |
A siSelectionChangeType value that specifies how the selection list changed:
|
siOnBeginFrame siOnEndFrame siOnBeginSequence siOnEndSequence |
RenderType |
A siRenderType value that specifies the type of render operation being performed:
|
FileName |
Name of the output file for the current frame. The file name format looks like "filename.frame.imageformat", and is specified in the Render > Options dialog box. |
|
Frame |
The frame number of the frame being rendered. |
|
Sequence |
Frame sequence number. The sequence number represents the number of frames rendered so far. For example, if frames 20 to 30 are being rendered, then the sequence number for frame 20 is 1, and the sequence number for frame 30 is 11. |
|
RenderField |
A siRenderFieldType value that specifies whether field rendering is enabled: |
|
siOnKeyUp siOnKeyDown |
KeyCode |
The virtual key code (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/VirtualKeyCodes.asp) (in decimal) of the key that caused the event. |
ShiftMask |
Specifies the state of the Shift, Alt, and Ctrl modifier keys when the key was pressed. ShiftMask is an integer value that is the sum of the siKeyboardState values for the modifier keys pressed. For example, if Shift+Ctrl+Alt is pressed, ShiftMask is equal to siShiftMask + siCtrlMask + siAltMask. |
|
Consumed (for siOnKeyUp only) |
Specifies whether the event propagates up to XSI. If an handler consumes the event, the event is not passed on to XSI. By default, events are not consumed. Set this attribute to true with Context.SetAttribute if you don't want XSI to process the key. |
|
siOnBeginFileExport siOnEndFileExport |
Input |
The objects being exported: |
FileName |
The full path name of the exported file. |
|
FileType |
An siFileType value that specifies the type of file being exported. Possible values are:
|
|
siOnBeginFileImport siOnEndFileImport |
FileName |
The full path name of the file to import. |
FileType |
An siFileType value that specifies the of file being imported. Possible values are:
|
|
Parent |
The parent of the model created during import, empty if not specified. |
|
Reference |
Specifies whether a reference model is being imported. Applies only when importing .emdl (siFileTypeModel) and .xsi (siFileTypedotXSI) files. |
|
Name |
The name of the reference model created during the import. |
|
siOnActivate |
State |
Boolean value which indicates whether the application has been activated (true) or de-activated (false). |
siOnChangeProject |
NewProjectPath |
The newly activated project path. |
OldProjectPath |
The path of the previous active project. |
|
siOnTimeChange |
Frame |
Current frame in seconds. |

