Skip to content
Holger Seelig edited this page Aug 27, 2020 · 1 revision

About Cloning

When you begin creating X3D scenes, you will want to capitalize on the economy of modeling an object once and then reusing it, with modifications, when it appears elsewhere in the scene. Aside from making the X3D file shorter and easier to read, this technique decreases the time it takes to download your scene and increases overall performance. Make it a general practice to reuse nodes whenever possible.

Creating a node and then referring to it by name in multiple places is called cloning. If you change the original named node, all clones of that node will change as well.

Sometimes you will have the same geometry repeated in a scene, but with different colors and textures. In such cases, you can name the geometry the first time and reuse it, but include different material and texture nodes to change the appearance.

Creating a Clone

Suppose that you have the same texture used multiple time on different geometries.

The OutlineEditor might display something like this:

clone1

If you want to clone the ImageTexture node now you just select both nodes. The order in which you select the nodes is important. First select the nodes that you want to replace by the clone and as last step select the node that should be the clone:

  • Shift-click to select both ImageTextures.
  • Choose Edit > Clone > Create Clone.

Now the OutlineEditor will display this:

clone1

You will notice now a small number in brackets behind the node name. This number indicates that the node is cloned and how many times.

Unlink a Clone

If you don't want the clone anymore for several reasons you can unlink the clone relationship again.

  • Select the clone indicated by the small number behind the node name
  • Choose Edit > Clone > Unlink Clone

The OutlineEditor will now display somthing like this:

clone1

The clone relationship is now broken. You will see no small number behind the node name now. For every instance a copy of the clone is made and the clone is replaced by the copy. Important to know: the first unlinked node in the hierarchy will left the clone node.

Remove a Clone

Go to the Outline Editor, place the cursor over a clone and activate the context menu. Select Remove Node will remove only this one clone.