Hi,
The update is now available (both Binary and Source),
Please look here:
https://github.com/Esenthel/EsenthelEngi...roject.cpp
Code:
void Project::removeOrphanedElms()
{
Memt<UID> used;
TimeStamp time; time.getUTC();
// get all used meshes
FREPA(elms) // go forward because most likely 'used' ID's will be increasing
{
C Elm &elm=elms[i]; if(C ElmObj *obj_data=elm.objData())used.binaryInclude(obj_data->mesh_id, Compare);
}
// remove unused meshes
REPA(elms)
{
Elm &elm=elms[i]; if(elm.type==ELM_MESH && !elm.removed() && !used.binaryHas(elm.id, Compare))elm.setRemoved(true, time);
}
used.clear();
// get all used phys
FREPA(elms) // go forward because most likely 'used' ID's will be increasing
{
C Elm &elm=elms[i]; if(C ElmMesh *mesh_data=elm.meshData())if(mesh_data->phys_id.valid())used.binaryInclude(mesh_data->phys_id, Compare);
}
// remove unused phys
REPA(elms)
{
Elm &elm=elms[i]; if(elm.type==ELM_PHYS && !elm.removed() && !used.binaryHas(elm.id, Compare))elm.setRemoved(true, time);
}
}
This is automatically called when clicking "Erase Removed Elements" from the menu.
This should remove any ELM_MESH elements that aren't referenced by any ELM_OBJ elements.
Please note, that if you want to use "Erase Removed Elements", it's recommended to:
-Disconnect all "Esenthel Editor" apps from "Esenthel Server"
-call "Erase Removed Elements" in "Esenthel Editor" on every developer machine
-call "Erase Removed Elements" on "Esenthel Server" app (by right-clicking on the project in the project list)
-after that you can re-connect to the Server.
Hope this helps.