RegisterConverterEvent (PluginRegistrar)

Introduced

6.0

Description

Registers a Converter Event. The event's callback is invoked whenever a file using a custom-defined file type has to be imported or exported.

Scripting Syntax

PluginRegistrar.RegisterConverterEvent( Name, Type, Extension )

C# Syntax

PluginItem PluginRegistrar.RegisterConverterEvent( String in_eventName, siEventID in_eventID, String in_eventExtension );

Parameters

Parameter

Type

Description

Name

String

The name of the custom converter event to register. It should begin with a letter and contain only letters, numbers and the underscore character.

If a converter event name contains spaces (for example, "My Converter"), the callback function names must omit the spaces (for example, "MyConverter_Init").

XSI expects the handler function associated to the registered event to be formatted as follows: {event name}_OnEvent.

Type

siEventID

Type of event to register.

Note: The following identifiers are supported: siOnCustomFileImport and siOnCustomFileExport

Extension

String

The file Extension to register the converter event for. The Extension should not contain any delimiters and be uppercase, so "TXT" for example is the extension for a file like "myfile.txt".

Return Value

PluginItem

Examples

JScript Example

function XSILoadPlugin( in_reg )
{
   in_reg.Author = "ABC" ;
   in_reg.Name = "ABC Text Converter plugin" ;
   in_reg.Major = 1;
   in_reg.Minor = 0;
   in_reg.URL = "www.abc.com"

   // Let XSI know that this plugin implements a custom import and export event for txt files
   in_reg.RegisterConverterEvent("ABCTextImport",siOnCustomFileImport,"TXT");
   in_reg.RegisterConverterEvent("ABCTextExport",siOnCustomFileExport,"TXT");

   return true ;
}

See Also

Plugin.Items

Definition Callbacks for Events



SOFTIMAGE|XSI v6.01     

Return to Softimage XSI Index