PluginRegistrar.RegisterConverterEvent
 
 
 

PluginRegistrar.RegisterConverterEvent

Introduced

v6.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.

C# Syntax

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

Scripting Syntax

oReturn = PluginRegistrar.RegisterConverterEvent( Name, Type, Extension );

Return Value

PluginItem

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").

Softimage 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".

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 Softimage 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