Saving memory by sharing a mesh among multiple nodes
 
 
 

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.

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).

Similarly, you can save memory by having many nodes share textures, materials, takes, animation curves, etc.