Basic Plugin Information

Plugin Types

Here are the different custom items you can add to RAYZ:
Nodes
Image Operations
Command line options
Overlays
Display Converters
Image File Formats
File Importers (such as the Photoshop file importer)
File Managers (such as ftp, unix, etc)
Custom Devices
Functions for Expressions
Curve Importer/Exporters
Preferences

Registering Plugins

All plugins are defined via a "C" structure, which then must be registered with RAYZ upon startup (except Preferences, which are simply handled via function calls from any of the other plugin types). This defines for RAYZ the name, type, and implementation of the specific plugin. All plugin source files will contain the two functions
CPIDSOEXPORT CPI_Bool
rpiPluginInit( void ) {}

CPIDSOEXPORT void
upiPluginCleanup( void ) {}
which are used to initialize and cleanup the plugin, respectively. These functions are called only once each, Init() at startup time and Cleanup() when RAYZ exits. The register and unregister calls are put here. For example, a node would have the following (taken from Simple.C):
/////////////////////////////////////////////
// register node and image op

CPIDSOEXPORT CPI_Bool
rpiPluginInit( void )
{
    CPI_Bool retval = CPI_TRUE;

    retval =  cpiRegisterImageOp( &opinfo );

    if ( retval )    // if success, register the node
        retval = cpiRegisterNode( &ninfo );

    return retval;
}


//////////////////////////////////////////////
// unregister node and image op

CPIDSOEXPORT void
upiPluginCleanup( void )
{
    cpiUnregisterImageOp( "opname" );
    cpiUnregisterNode( "nodename" );
}
The declaration "CPIDSOEXPORT" is there to make sure that things work properly under Windows, and should be present for portability reasons.

Notice that plugin types are registered using the address of the structure, but unregistered by their name (which RAYZ knows from the registration call). Each plugin type has its own register/unregister calls, as shown in this table (this information is also in CPI_Register.h):
Plugin Type Register Call Unregister Call Structure Type
Device cpiRegisterDevice() cpiUnregisterDevice() RPI_DeviceInfo
File Importer cpiRegisterFileImporter() cpiUnregisterFileImporter() RPI_FileImportInfo
File Manager cpiRegisterFileManager() cpiUnregisterFileManager() RPI_FMInfo
Node cpiRegisterNode() cpiUnregisterNode() RPI_NodeInfo
Image Format cpiRegisterImageReader() cpiUnregisterImageReader() RPI_ImageInfo
Image Op cpiRegisterImageOp() cpiUnregisterImageOp() RPI_ImageOpInfo
LUT cpiRegisterLUT() cpiUnregisterLUT() RPI_LUTInfo
Overlay cpiRegisterOverlay() cpiUnregisterOverlay() RPI_OverlayInfo
Expression cpiRegisterExpression() cpiUnregisterExpression() RPI_ExpressionInfo
Curve Read/Write cpiRegisterCurveIO() cpiUnregisterCurveIO() RPI_CurveIOInfo
ScriptOption cpiRegisterScriptOption() cpiUnregisterScriptOption() RPI_ScriptInfo


[Previous Page] [Next Page]
[Table of Contents] [Index]

Copyright © 2002 Silicon Grail Inc.
736 Seward Street, Hollywood, CA 90038