ToggleReferencedModel

Introduced

v6.0

Categories

RefModel

Description

Toggles a model between local and referenced.

If the model is a referenced model it is made local. If the model is a local model, it is converted to referenced.

Scripting Syntax

oReturn = ToggleReferencedModel( Model, [ShowWarnings] );

Return Value

Nothing

Parameters

Parameter Type Description
Model String Which model to toggle
ShowWarnings Boolean Whether or not to show warnings

Default Value: True

Examples

JScript Example

/*
        This example demonstrates how to make structural changes to a referenced model using ToggleReferencedModel
*/
// Create a referenced model
NewScene( null, false );
var obj = CreatePrim( "Cube", "MeshSurface" );
var mdl = CreateModel()(0);
ConvertToRefModel( mdl, XSIUtils.BuildPath( ActiveProject.Path, "Models", "Model.emdl") );
// Make it local
ToggleReferencedModel(mdl);
// Make some changes
SetValue(mdl+".cube.name","newNameOfCube");
// toggle back to referenced.
ToggleReferencedModel(mdl);

See Also

ConvertToRefModel MakeModelLocal