ReconnectModel

導入

v3.5

カテゴリ

一般

詳細

モデル外部への接続を持ち、かつ接続が完了していないモデル内のすべてのオペレータを接続し直します。

モデルを書き出しすると、通常はモデル外への接続を持つオブジェクトはすべてその接続を失います。 しかし、オペレータの中には接続とは無関係に書き出されるものがあります(エンベロープ オペレータなど)。 モデルを読み込みする際には、そのモデルの外部オブジェクトへの接続が確立されません。これは、接続先に関する情報が不足していることによります。 しかし、参照元のモデルを読み込みすると接続が自動的に確立されます。

v6.5 の時点のこのコマンドには、重複したオブジェクトが許可されるかどうかを指定する追加のオプション パラメータ ConnectDuplicateObjects がありました。 以前の動作では重複したオブジェクトが常に許可されていましたが、現在のバージョンでは、このパラメータが値 True で渡された場合のみオブジェクトが複製されます。

スクリプト構文

ReconnectModel( Model, ExternalCnxMappingTemplate, [DeleteUnconnectedObjects], [AllowDuplicateObjects] );

パラメータ

パラメータ タイプ 詳細
Model 文字列 再接続するモデルの名前。
ExternalCnxMappingTemplate 文字列 このパラメータには、再接続対象オブジェクトを決定するために使用するカンマ区切りのモデル リストが含まれています。
DeleteUnconnectedObjects ブール ターゲットが見つからないことにより接続できなかったオペレータを削除する場合は True。

デフォルト値: True

AllowDuplicateObjects ブール 重複したオブジェクトの接続を許可する場合は True。

デフォルト値: False

VBScript の例

'
' This example demonstrates exporting a model, importing it back without the envelope 
' being connected and then using the ReconnectModel command to reconnect the envelope
'
NewScene , false
' Create a sphere in a model
CreatePrim "Sphere", "MeshSurface"
CreateModel
' Create a chain 
Create2DSkeleton -1.17507494684892E-02, 4.06772293980565, 0, -3.52522484054694E-02, 2.35128493630388E-02, 0, 0, 0, 0, 4
AppendBone "eff", -1.17507494684892E-02, -3.99718439171653, 0
' Envelope the sphere on the chain.
SelectObj "Model.sphere"
ApplyFlexEnv "Model.sphere;root,bone,bone1,eff", False
' Export the model and delete it.
SelectObj "Model"
ExportModel "Model", Application.InstallationPath( siFactoryPath ) & "/Data/XSI_SAMPLES/Models/mymodel.emdl"
SelectObj "Model", "BRANCH"
DeleteObj "B:Model"
' Import the model back, the envelope will not be reconnected
ImportModel Application.InstallationPath( siFactoryPath ) + "/Data/XSI_SAMPLES/Models/mymodel.emdl"
SelectObj "eff", , True
Translate , 1.83679023666235, 4.14069033985075, -0.414069033985075, siRelative, siView, siObj, siXYZ
' Reconnect the envelope in the model on the chain on the scene root.
ReconnectModel "eff", "Scene_Root"

関連項目

ImportModel