Keep tree lists updated at all times.

This simplifies the compiler logic since an updated tree list was necessary at many stages (e.g. attach and keyframes resizing) and it will be anyway required when computing the mjSpec signature.

PiperOrigin-RevId: 740356447
Change-Id: I7f2ec25b27b8d4ca4364801c9a401c40c6d84569
This commit is contained in:
Alessio Quaglino
2025-03-25 08:20:14 -07:00
committed by Copybara-Service
parent 12b40b948e
commit 4e206c29c1
3 changed files with 56 additions and 64 deletions
+3 -1
View File
@@ -334,9 +334,11 @@ class mjCModel : public mjCModel_, private mjSpec {
// list of active plugins
std::vector<std::pair<const mjpPlugin*, int>> active_plugins_;
// make lists of bodies and children
void MakeTreeLists(mjCBody* body = nullptr);
// compile phases
void TryCompile(mjModel*& m, mjData*& d, const mjVFS* vfs);
void MakeLists(mjCBody* body); // make lists of bodies, geoms, joints, sites
void SetNuser(); // set nuser fields
void IndexAssets(bool discard); // convert asset names into indices
void CheckEmptyNames(); // check empty names