## MakeModelLocal

### Introduced

v1.5

### Description

Makes a referenced model local.
Tip: To optimize this command, make sure the Default_Pass is activated and there are no overrides on partitions. When overrides are active, it runs much more slowly.

### Scripting Syntax

    MakeModelLocal( [Model], [IncludeNestedRefModels], [MaterialConflictAction] );

### Parameters

Parameter | Type | Description
--- | --- | ---
Model | String | The models to make local.
IncludeNestedRefModels | Boolean | True to include nested referenced models. Default Value: true
MaterialConflictAction | siMaterialConflictAction | Action to perform when the referenced materials to make local are detected in the target material library. Default Value: siDefaultAction In batch mode, the material will be copied in the target material library. In interactive mode, the user is prompted to select an action to perform.

### Examples

#### JScript Example

    /*

    	This example shows how to make a referenced model local.

    */

    NewScene(null, false);

    // First create a simple model containing a sphere

    var sph = CreatePrim("Sphere", "MeshSurface");

    var mdl = CreateModel(sph, "LocalModel")(0);

    var mymodelpath = XSIUtils.BuildPath(

    	Application.InstallationPath(siFactoryPath),

    	"Data", "XSI_SAMPLES", "Models", "mymodel.emdl"

    );

    Application.LogMessage(Application.ActiveSceneRoot.Models.GetAsText());

    // INFO : LocalModel

    // Export it and then reimport it as a referenced model

    ExportModel(mdl, mymodelpath);

    SelectObj(mdl, "BRANCH")		// models must be branch-selected when deleting

    DeleteObj();

    Application.LogMessage(Application.ActiveSceneRoot.Models.GetAsText());

    // INFO :

    var rtn = ImportModel(mymodelpath, null, true);

    mdl = rtn.Value("Value");

    // Now make it local

    MakeModelLocal(mdl);

    Application.LogMessage(Application.ActiveSceneRoot.Models.GetAsText());

    // INFO : mymodel

### See Also

ConvertToRefModel ToggleReferencedModel