PluginCollection

Introduced

v4.0

Description

A collection of Plugin objects. Both the name and the full path of the Plugin can be used as the key to PluginCollection.Item.

Methods

Filter Find GetAsText  
       

Properties

Count operator Item operator    
       

Examples

1. VBScript Example

set plgs = Application.Plugins
for each p in plgs
	Application.LogMessage "Name: " & p.Name
	Application.LogMessage "Author: " & p.Author
	Application.LogMessage "Major: " & p.Major
	Application.LogMessage "Minor: " & p.Minor
	Application.LogMessage "Language: " & p.Language
	Application.LogMessage "Filename: " & p.Filename
	Application.LogMessage "URL: " & p.URL
	Application.LogMessage "Email: " & p.Email
	Application.LogMessage "Loaded: " & p.Loaded
next

2. JScript Example

/*
	This example provides UI for loading plug-ins that is similar to the "Load" button
	on the Plug-in Manager.
	A File Open dialog is shown to the user. The PluginCollection.Item method is used to 
	test if the plug-in has already been loaded. If it hasn't been loaded Softimage 
	attempts to load it.
*/
var initialDir = Application.InstallationPath( siUserPath ) ;
if ( Application.Platform == "Win32" )
{
	initialDir += "\\Application\\plugins" ;
}
else
{
	initialDir += "/Application/plugins" ;
}
var oUIToolkit = new ActiveXObject("XSI.UIToolKit") ;
var oFileBrowser = oUIToolkit.FileBrowser ;
oFileBrowser.DialogTitle = "Select a plug-in to load" ;
oFileBrowser.InitialDirectory = initialDir ;
oFileBrowser.Filter = "All Files (*.*)|*.*||" ;
oFileBrowser.ShowOpen() ; 
if ( oFileBrowser.FilePathName != "" )
{
	var oExistingPlugin = Application.Plugins( oFileBrowser.FilePathName ) ;
	if ( oExistingPlugin != null )
	{
		XSIUIToolkit.MsgBox( oExistingPlugin.Name + " is already loaded" ) ;
	}
	else
	{
		Application.LoadPlugin( oFileBrowser.FilePathName ) ;
	}
}

See Also

Plugin XSIApplication.Plugins