Public Member Functions
Plugin Class Reference

Detailed Description

A Plugin object holds read-only information on a particular plug-in file registered in Softimage.

Plug-in objects are filled in with the PluginRegistrar object at startup and can be accessed with the Application::GetPlugins property.

Shows how to access information about the plug-ins that are currently registered in Softimage
        using namespace XSI;

        Application app;

        CRefArray pluginArray = app.GetPlugins();

        for (LONG i=0; i<pluginArray.GetCount(); i++)
            Plugin plugin(pluginArray[i]);

            app.LogMessage( L"***" + plugin.GetName() + L"***" );

            LONG minor, major;
            plugin.GetVersion( major, minor );

            app.LogMessage( L"version: " +
                CValue((LONG)major).GetAsText() + L":" +
                CValue((LONG)minor).GetAsText() );

            app.LogMessage( L"author: " + plugin.GetAuthor() );
            app.LogMessage( L"language: " + plugin.GetLanguage() );
            app.LogMessage( L"file name: " + plugin.GetFilename() );
            app.LogMessage( L"url: " + plugin.GetURL() );
            app.LogMessage( L"email: " + plugin.GetEmail() );
            app.LogMessage( L"help: " + plugin.GetHelp() );
            app.LogMessage( L"origin: " + CValue((LONG)plugin.GetOrigin()).GetAsText() );
            app.LogMessage( L"origin path: " + plugin.GetOriginPath() );
            app.LogMessage( L"loaded: " + CValue(plugin.IsLoaded()).GetAsText() );

            CString strCat;
            CStringArray strArray = plugin.GetCategories();
            for (LONG j=0; j<strArray.GetCount(); j++)
                strCat += strArray[j]; strCat += L",";
            app.LogMessage( L"category: " + strCat );

            CRefArray itemArray = plugin.GetItems();
            for (j=0; j<itemArray.GetCount(); j++)
                PluginItem pluginItem(itemArray[j]);
                app.LogMessage( L"*** item name: " + pluginItem.GetName() );
                app.LogMessage( L"    item type: " + pluginItem.GetType() );
                app.LogMessage( L"    item help: " + pluginItem.GetHelp() );
                app.LogMessage( L"    item origin: " + CValue((LONG)pluginItem.GetOrigin()).GetAsText() );
                app.LogMessage( L"    item origin path: " + pluginItem.GetOriginPath() );

                CStringArray strArray = pluginItem.GetCategories();
                for (LONG j=0; j<strArray.GetCount(); j++)
                    strCat += strArray[j]; strCat += L",";
                app.LogMessage( L"    item category: " + strCat );

#include <xsi_pluginitem.h>

Inheritance diagram for Plugin:
Inheritance graph

List of all members.

Public Member Functions

 Plugin ()
 ~Plugin ()
 Plugin (const CRef &in_ref)
 Plugin (const Plugin &in_obj)
bool IsA (siClassID in_ClassID) const
siClassID GetClassID () const
Pluginoperator= (const Plugin &in_obj)
Pluginoperator= (const CRef &in_ref)
CString GetAuthor () const
CString GetURL () const
CString GetEmail () const
CStatus GetVersion (LONG &out_major, LONG &out_minor) const
CString GetLanguage () const
CString GetFilename () const
bool IsLoaded () const
CRefArray GetItems () const
CStatus PutUserData (const CValue &in_val)
CValue GetUserData () const

Constructor & Destructor Documentation

Plugin ( )

Default constructor.

~Plugin ( )

Default destructor.

Plugin ( const CRef in_ref)


in_refconstant reference object.
Plugin ( const Plugin in_obj)

Copy constructor.

in_objconstant class object.

Member Function Documentation

bool IsA ( siClassID  in_ClassID) const [virtual]

Returns true if a given class type is compatible with this API class.

in_ClassIDclass type.
true if the class is compatible, false otherwise.

Reimplemented from SIObject.

siClassID GetClassID ( ) const [virtual]

Returns the type of the API class.

The class type.

Reimplemented from SIObject.

Plugin& operator= ( const Plugin in_obj)

Creates an object from another object. The new object is set to empty if the input object is not compatible.

in_objconstant class object.
The new Plugin object.
Plugin& operator= ( const CRef in_ref)

Creates an object from a reference object. The new object is set to empty if the input reference object is not compatible.

in_refconstant class object.
The new Plugin object.

Reimplemented from SIObject.

CString GetAuthor ( ) const

Returns the name of the plug-in's author.

The name of the plug-in's author
CString GetURL ( ) const

Returns the URL path that can be used to link to a help page for the plug-in (for example, the web site of the plug-in's author).

The URL path.
CString GetEmail ( ) const

Returns the email address of the plug-in (for example, the email address of the plug-in's author).

The email address.
CStatus GetVersion ( LONG &  out_major,
LONG &  out_minor 
) const

Returns the plug-in version.

Return values:
out_majorMajor version number.
out_minorMinor version number.
CStatus OK if successful.
CString GetLanguage ( ) const

Returns the name of the language used to implement the plug-in. VBScript, JScript, Python, C#, and C++ are all valid languages.

The name of the implementation language.
CString GetFilename ( ) const

Returns the filename of the plug-in.

The filename of the plug-in.
bool IsLoaded ( ) const

Returns true if the plug-in is currently loaded in the application.

true if the plug-in is currently loaded
CRefArray GetItems ( ) const

Returns a CRefArray object containing the plug-in items (PluginItem) registered by this plug-in. A single Plugin object can contain multiple customizable items, such as custom menus, operators and filters.

Array of PluginItem objects.
CStatus PutUserData ( const CValue in_val)

Stores a CValue inside the plug-in object. Softimage does not care about the content or meaning of the data. Once created, the data remains active as long as Softimage is running or until you manually unload the plug-in.

You can use this to store a value to be accessed locally in the plug-in implementation or accessed globally by other plug-ins. The user data is not persisted.

In the case where a pointer is stored, the object should be destroyed during the cb_Plugin_Unload UnloadPlugin callback.
in_valUser data to set.
CStatus::OK success
CStatus::Fail failure.
See also:
CValue GetUserData ( ) const

Returns the user data stored in the plug-in.

The user data value.

The documentation for this class was generated from the following file: