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.
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>
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 |
Plugin | ( | ) |
Default constructor.
~Plugin | ( | ) |
Default destructor.
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
in_ClassID | class type. |
Reimplemented from SIObject.
siClassID GetClassID | ( | ) | const [virtual] |
Creates an object from another object. The new object is set to empty if the input object is not compatible.
in_obj | constant class object. |
CString GetAuthor | ( | ) | const |
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).
CString GetEmail | ( | ) | const |
Returns the email address of the plug-in (for example, the email address of the plug-in's author).
CStatus GetVersion | ( | LONG & | out_major, |
LONG & | out_minor | ||
) | const |
Returns the plug-in version.
out_major | Major version number. |
out_minor | Minor version number. |
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.
CString GetFilename | ( | ) | const |
Returns the filename of the plug-in.
bool IsLoaded | ( | ) | const |
Returns true if the plug-in is currently loaded in the application.
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.
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_val | User data to set. |
CValue GetUserData | ( | ) | const |
Returns the user data stored in the plug-in.