MergeScene
 
 
 

MergeScene

Introduced

v1.0

Description

Merges a Softimage scene into the current scene. Creates a new model to hold the merged scene. The new model is selected and inspected.

This command is accessed through the main menu under File->Merge.

Scripting Syntax

oReturn = MergeScene( [FileName], [Name], [Parent], [ShareOptions] );

Return Value

Returns the new Model object containing all the elements of the merged scene.

Parameters

Parameter Type Description
FileName String File name of the scene file to load

Default Value: File browser pops up

Name String Name of the new model created

Default Value: Scene file name

Parent String Parent of the model created

Default Value: Scene root

ShareOptions siImportShareOptions Bit field values of type Integer that specify the different options for sharing objects when merging a scene.

Share the image clips when importing the model. Image clips are identical if they refer to the same image source and all their parameters are equal, therefore FCurves on the parameters are ignored for the comparaison.

Referenced models share only image clips that are locked by referenced models, or if the image clip is unused. Standard models share only imageclips that are not locked at all.

Note that the image sources are always shared when importing a model.

Default Value: siImportShareOptionsAll

Examples

VBScript Example

'
' Demonstrates how to use the MergeScene command to merge the current
' scene with another scene file. 
'
NewScene , False
' First create an object in the new scene.
SICreateModel , "MyModel"
SICreateModel , "MergeRoot", ""
CreatePrim "Torus", "MeshSurface", "MyTorus", "MyModel"
' Now merge the scene with a sample scene.
scene_file = XSIUtils.BuildPath( _
        Application.InstallationPath(siFactoryPath), _
        "Data", "XSI_SAMPLES", "Scenes", "Rendering", "Rendertree_Light_Rainbow.scn" _
)
MergeScene scene_file, "Rainbow", "MergeRoot"
RecursiveCheck Application.ActiveSceneRoot, ""
'---------------------------------------------------------
' Output from this script:
' INFO : Scene_Root
' INFO : ...MyModel
' INFO : ...MergeRoot
' INFO : ......Rainbow
'---------------------------------------------------------
' Convenience to write model hierarchy using visual cues 
sub RecursiveCheck( in_root, in_indent ) 
        Application.LogMessage in_indent & in_root.Name
        for each mdl in in_root.Models(False)
                RecursiveCheck mdl, in_indent & "..."
        next
end sub

See Also

OpenScene NewScene