MergeScene

Introduced

1.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

    MergeScene( [FileName], [Name], [Parent], [ShareOptions] )

Parameters

Parameter | Type | Description
FileName [in/out] | 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

Return Value

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

Examples

VBScript Example

    '----------------------------------------------------------------------
    ' Demonstrates how to use the MergeScene command to merge the current
    ' scene with another scene file.
    '
    ' Note: The current scene in Softimage will be lost by running this example.
    '----------------------------------------------------------------------

    ' First create a new scene, and create an object in it.
    NewScene , False
    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", "Rendertree_Light_Rainbow.scn" _
    )
    MergeScene scene_file, "Rainbow", "MergeRoot"
    RecursiveCheck Application.ActiveSceneRoot, ""

    ' 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

    '---------------------------------------------------------
    ' Output from this script:
    ' INFO : Scene_Root
    ' INFO : ...MyModel
    ' INFO : ...MergeRoot
    ' INFO : ......Rainbow
    '---------------------------------------------------------

See Also

OpenScene | NewScene

Autodesk Softimage v7.5