SIGetModel

Description

Gets the model that is a common parent of a list of given objects.

Scripting Syntax

    SIGetModel( InputObjs )

Parameters

Parameter | Type | Description
InputObjs | String | List of objects Default Value: Selected objects

Return Value

Returns the Model that contains the given objects. If InputObj contains objects that are in different models, the returned model is the model in the model hierarchy that contains all the different models (for example, Scene_Root).

Examples

VBScript Example

    '---------------------------------------------------------
    ' VBScript example : Getting model parents. This script
    ' demonstrates how to use the SIGetModel to find the common parent
    ' model of a given group of models.
    '---------------------------------------------------------

    ' First, create some models in a heirarcy.
    SICreateModel , "Sub1"
    SICreateModel , "Sub2"
    SICreateModel , "Sub2_2"
    SICreateModel "Sub1", "Root1"
    SICreateModel "Sub2, Sub2_2", "Root2"

    ' Now try to get the parent models of some models of models.
    Contains_Sub1 = SIGetModel("Sub1")
    logmessage Contains_Sub1 & " contains Sub1."
    Contains_Sub2 = SIGetModel("Sub2")
    logmessage Contains_Sub2 & " contains Sub2."
    Contains_Root1 = SIGetModel("Root1")
    logmessage Contains_Root1 & " contains Root1."

    ' Now try some with groups of models.
    Contains_Sub2_Sub2_2 = SIGetModel("Sub2, Sub2_2")
    logmessage Contains_Sub2_Sub2_2 & " contains Sub2 and Sub2_2."
    Contains_Sub1_Sub2 = SIGetModel("Sub1, Sub2")
    logmessage Contains_Sub1_Sub2 & " contains Sub1 and Sub2"
    Contains_Root1_Root2 = SIGetModel("Root1, Root2")
    logmessage Contains_Root1_Root2 & " contains Root1 and Root2"

    '---------------------------------------------------------
    ' Output from the script:
    ' Object : "Root1"
    ' Object : "Root1.Sub1"
    ' Object : "Root2"
    ' Object : "Root2.Sub2"
    ' Object : "Root2.Sub2_2"
    'INFO : "Root1 contains Sub1."
    'INFO : "Root2 contains Sub2."
    'INFO : "Scene_Root contains Root1."
    'INFO : "Root2 contains Sub2 and Sub2_2."
    'INFO : "Scene_Root contains Sub1 and Sub2"
    'INFO : "Scene_Root contains Root1 and Root2"
    '---------------------------------------------------------

See Also

CreateModel | SICreateModel | ImportModel | ExportModel

Autodesk Softimage v7.5