Copy plugins when attaching a model.

Before this CL, the same mjCPlugin objects were referenced by both models.

Fixes #2100.

PiperOrigin-RevId: 680579479
Change-Id: Ida3459f78f9fa4a942cea31b3d5d3e8da2832feb
This commit is contained in:
Alessio Quaglino
2024-09-30 08:06:54 -07:00
committed by Copybara-Service
parent 43a82e08be
commit e6e6e3b51b
3 changed files with 83 additions and 14 deletions
-1
View File
@@ -386,7 +386,6 @@ class mjCModel : public mjCModel_, private mjSpec {
mjListKeyMap ids; // map from object names to ids
mjCError errInfo; // last error info
bool plugin_owner; // this class allocated the plugins
std::vector<mjKeyInfo> key_pending_; // attached keyframes
};
#endif // MUJOCO_SRC_USER_USER_MODEL_H_