Noob Surface

Archives Forums/Blitz3D SDK Programming/Noob Surface

H&K(Posted 2007) [#1]
If I free a Mesh, that I have made with surfaces, if there where no other instances of these surfaces are they also freed?


DJWoodgate(Posted 2007) [#2]
I assune you mean entity references to the mesh, in which case yes when there are no entity references to it the mesh and its surfaces are freed. There is no other way to free surfaces AFAIK, though you can clear them.
(In the case of surfaces they seem to be cleared and flagged for reuse when freed).

CopyMesh creates a new entity whch contains a new mesh. Empty surfaces are not copied by Copymesh.

Copyentity references the original Mesh and increments its reference count. FreeEntity reduces this count.

Addmesh condenses surfaces with the same Brush properties (Color, texture and suchlike). Note that this currently does not check if Maximum number of tris/verts is exceeded, and so you will get an error at renderworld if this occurs, so you need to be careful combining big meshes when surfaces have similar properties.