You didn’t look at the full descriptions.
int clearModelNodes ( )
Recursively walks through the scene graph at this level and below, looking for ModelNodes, and calls model_node->set_preserve_transform(PT_drop_node) on each one.
This allows a subsequent call to flatten_strong() to eliminate all of the ModelNodes.
Returns the number of ModelNodes found.
[Basically, when you call loader.loadModel, a ModelNode is added to the top to prevent the model from being merged with others. If you call clearModelNodes, then this ‘barrier’ if you will will be removed.]
int flattenLight ( )
Lightly flattens out the hierarchy below this node by applying transforms, colors, and texture matrices from the nodes onto the vertices, but does not remove any nodes.
This can result in improved rendering performance because there will be fewer transforms in the resulting scene graph, but the number of nodes will remain the same.
In particular, any NodePaths that reference nodes within this hierarchy will not be damaged. However, since this operation will remove transforms from the scene graph, it may be dangerous to apply to nodes where you expect to dynamically modify the transform, or where you expect the geometry to remain in a particular local coordinate system.
The return value is always 0, since flatten_light does not remove any nodes.
int flattenMedium ( )
A more thorough flattening than flatten_light(), this first applies all the transforms, colors, and texture matrices from the nodes onto the vertices, and then removes unneeded grouping nodes–nodes that have exactly one child, for instance, but have no special properties in themselves.
This results in improved performance over flatten_light() because the number of nodes in the scene graph is reduced.
The return value is the number of nodes removed.
int flattenStrong ( )
The strongest possible flattening.
This first applies all of the transforms to the vertices, as in flatten_medium(), but then it will combine sibling nodes together when possible, in addition to removing unnecessary parent-child nodes. This can result in substantially fewer nodes, but any nicely-grouped hierachical bounding volumes may be lost.
It is generally a good idea to apply this kind of flattening only to nodes that will be culled largely as a single unit, like a car. Applying this to an entire scene may result in overall poorer performance because of less-effective culling.