XSIApplication.UnloadPlugin

説明

自己インストール可能なプラグインを Softimage からアンロードします。プラグインをアンロードすると登録されているすべてのプラグイン項目が登録解除され、プラグインをリロードしなければそれらの項目は使用できなくなります。

アンロードされたプラグインは、XSIApplication.Pluginsコレクション内には残ります。Plugin.Loaded プロパティを使用することで、その他のプラグインと区別することができます。アンロードされたプラグインは、Plugin.Items コレクション内のエントリ数はゼロになります。

C#構文

XSIApplication.UnloadPlugin( String in_pluginFileName, Boolean in_bRemove );

スクリプト構文

XSIApplication.UnloadPlugin( Plugin, bRemove );

パラメータ

パラメータ タイプ 説明
Plugin String フルパスを含むプラグインファイル名
bRemove Boolean Softimage で保持されるプラグインのリストからプラグインファイルを完全に削除するオプション。このオプションではディスクからプラグインが削除されるわけではないため、Softimage の次回再起動時にプラグインをリロードできます。

JScript の例

//--------------------------------------------------------------------

//	This example shows how to define and load a plug-in in Softimage

//

// README: Copy and paste the example into the script editor 

// and run (F5).

//--------------------------------------------------------------------

function ExUnLoadPluginDemo()

{

	// lookup installed plugin

	var oPlugin = Application.Plugins( "XSIApplication.UnLoadPlugin Example" );

	// manually unload plugin

	Application.UnloadPlugin( oPlugin.FileName );

	// The above script logs the following results:

	//INFO : XSIUnloadPlugin called"

	//INFO :  	Name: XSIApplication.UnLoadPlugin Example"

	//INFO : 	Author: Softimage Co.

	//INFO : 	Major: 1

	//INFO : 	Minor: 0

	//INFO : 	Language: JScript

	//INFO : 	Filename: [userpath]\Addons\XSISDKDocExamples\Application\Plugins\ExXSIApplicationUnLoadPlugin.js

	//INFO : 	URL: www.softimage.com

	//INFO : 	Email: xsi@softimage.com

	//INFO : 	Help: 

	//INFO : 	OriginPath: [userpath]\Addons\XSISDKDocExamples\Application\Plugins\

	//INFO : 	Categories: Doc Example

	//INFO : Loaded: True

}

function  XSILoadPlugin( in_reg )

{

	in_reg.Name = "XSIApplication.UnLoadPlugin Example";

	in_reg.Author = "Softimage Co."; 

	in_reg.Major = 1;

	in_reg.Minor = 0;

	in_reg.URL = "www.softimage.com"; 

	in_reg.Email = "xsi@softimage.com"; 

	in_reg.Categories = "Doc Example"; 

	return true;

} 

function  XSIUnloadPlugin( in_reg )

{

	Application.LogMessage( "XSIUnloadPlugin called" );

	Application.LogMessage( "\tName: " + in_reg.Name );

	Application.LogMessage( "\tAuthor: " + in_reg.Author);

	Application.LogMessage( "\tMajor: " + in_reg.Major);

	Application.LogMessage( "\tMinor: " + in_reg.Minor);

	Application.LogMessage( "\tLanguage: " + in_reg.Language);

	Application.LogMessage( "\tURL: " + in_reg.URL);

	Application.LogMessage( "\tEmail: " + in_reg.Email);

	Application.LogMessage( "\tHelp: " + in_reg.Help);

	Application.LogMessage( "\tOriginPath: " + in_reg.OriginPath);

	Application.LogMessage( "\tCategories: " + in_reg.Categories);

}

//--------------------------------------------------------------------

// Code to bootstrap example into system

//--------------------------------------------------------------------

function ExampleSourceCode()

{

	return "// XSISDK Doc Example\n" +

		XSIUnloadPlugin.toString() + "\n" +

		XSILoadPlugin.toString();

}

// if we are running from script editor save code to 

// examples addon folder in the user's directory.

if (GetUserPref("ScriptingSessionActive"))

{

	var ex_name 		= "ExXSIApplicationUnLoadPlugin";

	var ex_subfolder 	= "Plugins";

	var ex_folder 		= "XSISDKDocExamples";

	var ex_langsuffix	= ".js";

	CreateAddonDirectories( InstallationPath(siUserPath), ex_folder );

	var fso = XSIFactory.CreateActiveXObject("Scripting.FileSystemObject");

	var filename = XSIUtils.BuildPath( 

		InstallationPath(siUserAddonPath), 

		ex_folder,

		"Application",

		ex_subfolder,

		ex_name+ex_langsuffix );

	if (!fso.FileExists(filename))

	{

		var f = fso.CreateTextFile ( filename );

		f.write( ExampleSourceCode() );

		f.close();

		Application.LoadPlugin(filename);

	}

	ExUnLoadPluginDemo();

}

関連項目

XSIApplication.LoadPlugin XSIApplication.Plugins Plugin Plugin.Loaded