Copy UIDs during mj_copySpec.

This will produce the same mjSpec signature after a deep copy.

PiperOrigin-RevId: 743538018
Change-Id: Ic0f5b06a00e8883cb92dc98159db3bea02cb7a36
This commit is contained in:
Alessio Quaglino
2025-04-03 06:28:05 -07:00
committed by Copybara-Service
parent 54f132f3f0
commit 8941f56e86
3 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -297,7 +297,7 @@ void mjCModel::CopyList(std::vector<T*>& dest,
// copy the element from the other model to this model
if (deepcopy_) {
source[i]->ForgetKeyframes();
candidate->uid = GetUid();
candidate->uid = source[i]->uid;
} else {
candidate->AddRef();
}