インタフェース > コア インタフェース > assemblyMgr |
アセンブリ マネージャへのインタフェースを表します。オブジェクトを結合してアセンブリを作成するとき、およびアセンブリをテストおよび操作するときに使用します。
メソッド:
<node>assemblyMgr.Assemble <node array>nodes [ name:<string> ][ classDesc:<class> ] [ select:<bool> ] name default value: undefined classDesc default value: undefined select default value: true
<node array> のノードを使用して新しいアセンブリを作成します。
name または classDesc を指定しない場合は、[アセンブリを作成](Create Assembly)ダイアログ ボックスが表示されます。classDesc は MAXClass に渡されます。MAXClass のインスタンスは、アセンブリ ヘッドとして使用されます。この MAXClass はヘルパー オブジェクトのクラスでなければなりません。アセンブリ ヘッドとして使用するヘルパーを拡張するために、スクリプト化されたプラグインを作成すれば、アセンブリ ヘッドに必要なプロパティを公開することができます。
例 |
object1 = Cylinder()--create a cylinder --> $Cylinder:Cylinder001 @ [0.000000,0.000000,0.000000] object2 = Box()--create a box --> $Box:Box001 @ [0.000000,0.000000,0.000000] object3 = OmniLight() --> $Omni_Light:Omni001 @ [0.000000,0.000000,0.000000] obj_array = #(object1, object2, object3) --> #($Cylinder:Cylinder001 @ [0.000000,0.000000,0.000000], $Box:Box001 @ [0.000000,0.000000,0.000000], $Omni_Light:Omni001 @ [0.000000,0.000000,0.000000]) --Create a new Assembly out of the objects, name it Test001 and use --a Dummy as the head. new_ass will contain the assembly head. new_ass = assemblyMgr.assemble obj_array name:"Test001" classDesc:Dummy --> $Dummy:Test001 @ [0.000000,0.000000,-8.000000] |
<bool>assemblyMgr.Disassemble <node array>nodes
指定されたノードを非アセンブリします。正常に終了した場合は true を返します。
例 |
--Continuing with the assembly from the above example... obj_array --> #($Cylinder:Cylinder001 @ [0.000000,0.000000,0.000000], $Box:Box001 @ [0.000000,0.000000,0.000000], $Omni_Light:Omni001 @ [0.000000,0.000000,0.000000]) --We cannot disassemble the original array because it does not --contain the head object! assemblyMgr.Disassemble obj_array --> false --Let’s append the head to the array and try again... append obj_array $Test001 --> #($Cylinder:Cylinder001 @ [0.000000,0.000000,0.000000], $Box:Box001 @ [0.000000,0.000000,0.000000], $Omni_Light:Omni001 @ [0.000000,0.000000,0.000000], $Dummy:Test01 @ [0.000000,0.000000,-8.000000]) --Now that we supplied all objects of the assembly, --the Disassemble method worked. assemblyMgr.Disassemble obj_array --> true |
<bool>assemblyMgr.Open <node array>nodes [clearSelection:<bool>] clearSelection default value: true
指定されたノードを開きます。正常に終了した場合、 true を返します。 clearSelection: が false として指定される場合は、選択内容はクリアされません。
<bool>assemblyMgr.Close <node array>nodes[select:<bool>] select default value: true
指定されたノードを閉じます。正常に終了した場合は true を返します。
<bool>assemblyMgr.Explode <node array>nodes
指定されたノードを分解します。正常に終了した場合、 true を返します。
<bool>assemblyMgr.Attach <node array>nodes[assembly:<node>] assembly default value: undefined
指定されたノードをアセンブリにアタッチします。正常に終了した場合は true を返します。
<bool>assemblyMgr.Detach <node array>nodes
指定されたノードをアセンブリにデタッチします。正常に終了した場合、 true を返します。
<bool>assemblyMgr.CanAssemble <node array>nodes
<node array> にアセンブリ可能なノードがある場合は、 true を返します。
<bool>assemblyMgr.CanDisassemble <node array>nodes
<node array> に非アセンブリ可能なノードがある場合は、 true を返します。
<bool>assemblyMgr.CanExplode <node array>nodes
<node array> に分解可能なノードがある場合は、 true を返します。
<bool>assemblyMgr.CanOpen <node array>nodes
<node array> に開くことができるノードがある場合は、 true を返します。
<bool>assemblyMgr.CanClose <node array>nodes
<node array> に閉じることができるノードがある場合は、 true を返します。
<bool>assemblyMgr.CanAttach <node array>nodes assembly:<node> assembly default value: undefined
<node array> のノードがアセンブリにアタッチ可能な場合は、 true を返します。
<bool>assemblyMgr.CanDetach <node array>nodes
<node array> のノードがデタッチ可能な場合は、 true を返します。
<node>assemblyMgr.IsAssembly <node array>nodes
<node array> に指定されたノードで構成されるアセンブリのヘッド ノードを返すか、またはノードがアセンブリを形成していない場合は undefined を返します。
<bool>assemblyMgr.FilterAssembly <node>assemblyHead <value>filterSClassID <&node array>filteredNodes filteredNodes is Out parameter
スーパークラスのノードのうち、指定されたヘッドを使ってアセンブリに追加するものをすべて抽出し、指定された filterNodes 配列に渡します。正常に終了した場合は true を返します。
例: |
--Assembly contains a Cylinder,a Box and a Dummy Helper as head: test_array = #($Box001, $Cylinder001) --> #($Box:Box001 @ [0.000000,0.000000,0.000000], $Cylinder:Cylinder001 @ [0.000000,0.000000,0.000000]) --Check for assembly with the lights only assemblyMgr.IsAssembly test_array --> undefined --Now check with all assembly nodes including the Head test_array = #($Box001, $Cylinder001, $Omni001, $Test001) --> #($Box:Box001 @ [0.000000,0.000000,0.000000], $Cylinder:Cylinder001 @ [0.000000,0.000000,0.000000], $Omni_Light:Omni001 @ [0.000000,0.000000,0.000000], $Dummy:Test001 @ [0.000000,0.000000,-8.000000]) a_head = assemblyMgr.IsAssembly test_array --> $Dummy:Test001 @ [0.000000,0.000000,-8.000000] --a_head now contains the Head of the Assembly containing the above objects! --Find all light objects in assembly a_head AssemblyMgr.FilterAssembly a_head Light &lightnodes --> true -- lightnodes now contains all nodes corresponding to objects of superclass Light lightnodes --> #($Omni_Light:Omni001 @ [0.000000,0.000000,0.000000]) --Find all camera objects in assembly a_head AssemblyMgr.FilterAssembly a_head Camera &camnodes --> true --There are no cameras in the assembly! camnodes --> #() |