3D Lingo Dictionary > C-D > cloneModelFromCastmember |  |

cloneModelFromCastmember

Syntax

    member(whichCastmember).cloneModelFromCastmember(newModelName, sourceModelName, sourceCastmember)

Description

3D command; copies the model named `sourceModelName` from the cast member `sourceCastmember`, renames it `newModelName`, and inserts it into the cast member `whichCastmember` as a child of its 3D world.

This command also copies the children of `sourceModelName`, as well as the model resources, shaders, and textures used by the model and its children.

The source cast member must be finished loading for this command to work correctly.

Example

This statement makes a copy of the model named Pluto of the cast member named Scene and inserts it into the cast member named Scene2 with the new name Planet. The children of Pluto are also imported, as are the model resources, shaders, and textures used by Pluto and its children.

    member("Scene2").cloneModelFromCastmember("Planet", "Pluto", member("Scene"))

See also

`cloneMotionFromCastmember`, `clone`, `cloneDeep`, `loadFile()`