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.

Since:
  4.0

Example:
  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:
[legend]

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
Plugin & | operator= (const Plugin &in_obj)
Plugin & | operator= (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 | ) |

Constructor.

Parameters:

  in_ref | constant reference object.

Plugin | ( | const Plugin & | in_obj | ) |

Copy constructor.

Parameters:

  in_obj | constant 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.

Parameters:

  in_ClassID | class type.

Returns:
  true if the class is compatible, false otherwise.

Reimplemented from SIObject.

siClassID GetClassID | ( |  | ) | const`[virtual]`

Returns the type of the API class.

Returns:
  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.

Parameters:

  in_obj | constant class object.

Returns:
  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.

Parameters:

  in_ref | constant class object.

Returns:
  The new Plugin object.

Reimplemented from SIObject.

CString GetAuthor | ( |  | ) | const

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

Returns:
  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).

Returns:
  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).

Returns:
  The email address.

CStatus GetVersion | ( | LONG & | out_major,
|  | LONG & | out_minor
| ) |  | const

Returns the plug-in version.

Return values:

  out_major | Major version number.
  out_minor | Minor version number.

Returns:
  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.

Returns:
  The name of the implementation language.

CString GetFilename | ( |  | ) | const

Returns the filename of the plug-in.

Returns:
  The filename of the plug-in.

bool IsLoaded | ( |  | ) | const

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

Returns:
  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.

Returns:
  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.

Warning:
  In the case where a pointer is stored, the object should be destroyed during the cb_Plugin_Unload UnloadPlugin callback.

Parameters:

  in_val | User data to set.

Returns:
  CStatus::OK success
  CStatus::Fail failure.

See also:
  Application::UnloadPlugin

Since:
  6.01

CValue GetUserData | ( |  | ) | const

Returns the user data stored in the plug-in.

Returns:
  The user data value.

Since:
  6.01

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

- xsi_plugin.h