ReconnectModel

Introduced

3.5

Description

Usually, exporting a model strips all object that have connections outside the model. But there are some operators that are exported anyway (envelopping operators). When importing a model the connections to object outside the model are not established due to a lack of information concerning the targets. But when importing referenced models the connections are established automatically.

This command is used to reconnect all operators in a model that have connection outside the model and are not connected yet.

Scripting Syntax

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

Parameters

Parameter

Type

Description

Model

String

Name of the model to reconnect.

ExternalCnxMappingTemplate

String

This parameter contains a list of model separated by a comma, that is used to resolved the objects that we try to reconnect.

DeleteUnconnectedObjects

String

Delete operators that was unable to connect due to missing targets.

Default Value: True

Examples

VBScript Example

' 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 envlop 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"

See Also

ImportModel



SOFTIMAGE|XSI v6.01     

Return to Softimage XSI Index