Group |
public void DisposeWithAllChildren( bool disposeMeshes, bool disposeMaterials, bool disposeTextures = true, bool runSceneCleanup = false )
DisposeWithAllChildren method disposes all child SceneNodes objects. If child is a GroupNode, then its children will be also disposed.
This method also disposes this GroupNode. This also removes this GroupNode from its parent GroupNode (if any). Therefore it is NOT allowed to call this method on RootNode. To prevent disposal of this GroupNode, call the DisposeAllChildren(Boolean, Boolean, Boolean, Boolean) method instead.
When disposeMeshes and disposeMaterials parameters are true, then also all meshes and materials are disposed.
When runSceneCleanup parameter is true (false by default), this method also calls the Cleanup(Boolean, Boolean, Boolean, Boolean, Boolean) method with default parameters to clean the released objects.
To dispose only some children call DisposeChildren(Int32, Int32, Boolean, Boolean, Boolean, Boolean) method that takes startIndex and count as parameters.
The difference between this method and the standard Dispose(Boolean) method is that with standard dispose method you cannot force mesh and material disposal. In this case the mesh is disposed only when it is created by the SceneNode (for example in PyramidModelNode or LineNode) and not when it is set to the MeshModelNode (for example with ReaderObj or Assimp importer). Also Material and BackMaterial are disposed only when they are created by the SceneNode (for example when LineNode is created by specifying the line color) and not when new StandardMaterial is created and set to ModelNode's Material property.