Instancing: sharing a mesh (or other node attribute)
 
 
 

In the CubeCreator tutorial program, every time the user adds a cube, CubeCreator creates a new KFbxMesh object and a new KFbxNode object containing that mesh. That’s two objects for each cube, not to mention all the layer objects, layer element objects, and so forth. If the user needs hundreds or thousands of cubes, the memory requirements could be significant.

Imagine that you need a program where all cubes looked alike, but you needed many thousands of them. You could save memory by creating one KFbxMesh object when the program starts up. Then, every time you needed a new cube, you create a new KFbxNode object, then point that node to the one mesh.

This is called instancing. In general, you can save memory by having many node objects share one node attribute object (i.e., one object of any subclass of KFbxNodeAttribute). Each node is an instance of the mesh, NURBS, or other scene element.

If you export your scene to an FBX file, instancing also reduces the file size.

You can also save memory by having multiple nodes share textures, materials, animation curves, etc.