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:

  • siSourcePathImageSource
  • siSourcePathWritableImageSource
  • siSourcePathModelSource

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:

  • siAddedToSelection if one or more objects were added to the selection
  • siRemovedFromSelection if one or more objects were removed from the selection

siOnBeginFrame

siOnEndFrame

siOnBeginSequence

siOnEndSequence

RenderType

A siRenderType value that specifies the type of render operation being performed:

  • siRenderSequence
  • siRenderFramePreview
  • siRenderEchoToMi

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:

  • siRenderFieldNone</p>
  • siRenderFieldOdd</p>
  • siRenderFieldEven</p>
  • 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:

  • Model for siFileTypeModel</p>
  • XSICollection for siFileTypedotXSI and siFileTypeIGES file types</p>
  • Library for siFileTypeMatLib</p>
  • Mixer for siFileTypeMixer</p>
  • FileName

    The full path name of the exported file.

    FileType

    An siFileType value that specifies the type of file being exported. Possible values are:

    • siFileTypeModel
    • siFileTypedotXSI
    • siFileTypeIGES
    • siFileTypeMatLib
    • siFileTypeMixer

    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:

    • siFileTypeModel
    • siFileTypedotXSI
    • siFileTypeIGES
    • siFileTypeMatLib
    • siFileTypeMixer

    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.

    This page was last modified 04:36, 2 Oct 2010.
    This page has been accessed 8076 times.

    © Copyright 2009 Autodesk Inc. All Rights Reserved. Privacy Policy | Legal Notices and Trademarks | Report Piracy