v4.0
このオブジェクト用に定義されているカテゴリを設定したり、戻したりします。カテゴリは、オブジェクトの分類を拡張するのに使用されます。SPDl
オブジェクトのカテゴリは、Keywordフィールドの値で初期化されますが、カスタムオブジェクト(Filter、Commandなど)のカテゴリは、プラグインをPluginRegistrarで登録するときにのみ設定できます。
カテゴリは、String の Array
として戻されます。カテゴリが指定されていない場合、空の配列が戻されます。
カテゴリはカンマ区切りの文字列で設定してください。プラグインに定義されているすべてのプラグイン項目のカテゴリを設定する場合はPluginRegistrar.Categories
を使用し、指定プラグイン項目のカテゴリを設定する場合はPluginItem.Categories
を使用します。その他のインターフェイスでは、このプロパティの「設定」コンポーネントはサポートされていません。
注:廃止された(v1.0 の)コマンドの作成スタイルでは、XSIApplication.CreateCommandメソッドの
Category パラメータでsiCommandCategory列挙型の値の 1
つを指定することでのみカテゴリを設定できました。
'
' This example shows how to get the categories of a SPDL object
'
set cone = ActiveSceneRoot.AddPrimitive( "cone" )
cat = cone.Categories
for i=LBound( cat, 1 ) to UBound( cat, 1 )
LogMessage "category: " & cat(i)
next
'the example above will output the following:
'INFO: category: General
'INFO: category: Primitive
'INFO: category: Modeling
|
'
' This example shows how to set the categories of a plug-in and specific plug-in items
'
Function XSILoadPlugin( in_reg )
' register plugin information
in_reg.Author = "Softimage Co."
in_reg.Name = "Mesh Filter plugin"
in_reg.URL = "http://www.softimage.com"
in_reg.Email = "webmaster@softimage.com"
in_reg.Categories = "Mesh component filter"
' set the version number of this plugin
in_reg.Major = 1
in_reg.Minor = 0
' register filter plugin items
set item = in_reg.RegisterFilter( "Border Edge", siFilterSubComponentEdge )
item.Categories = "Mesh,Edge"
set item = in_reg.RegisterFilter( "Triangle", siFilterSubComponentPolygon )
item.Categories = "Mesh"
set item = in_reg.RegisterFilter( "Quad", siFilterSubComponentPolygon )
item.Categories = "Mesh"
set item = in_reg.RegisterFilter( "N-gon", siFilterSubComponentPolygon )
item.Categories = "Mesh"
set item = in_reg.RegisterFilter( "Border Point", siFilterSubComponentPoint )
item.Categories = "Point"
set item = in_reg.RegisterFilter( "Polygon Island", siFilterSubComponentPolygon )
item.Categories = "Mesh,Polygon"
in_reg.RegisterFilter "Local Material", siFilterProperty
XSILoadPlugin = true
end Function
|
/*
This example shows how to get the plug-in items categories
*/
var items = Application.Plugins("Mesh Filter plugin").Items;
for (var i=0; i<items.Count; i++)
{
LogMessage( items(i).Name + " categories: " );
var vba = new VBArray(items(i).Categories);
var categories = vba.toArray();
for (var j=0; j<categories.length; j++)
{
LogMessage( categories[j] );
}
}
|