Discard all keyframes when attaching models.

PiperOrigin-RevId: 649415647
Change-Id: Ie2defe248df7078684d987351985cb66bd754e5b
This commit is contained in:
Alessio Quaglino
2024-07-04 08:03:08 -07:00
committed by Copybara-Service
parent a0945e4b5a
commit a5a3c9efc7
2 changed files with 14 additions and 0 deletions
+6
View File
@@ -860,6 +860,9 @@ mjCBody& mjCBody::operator+=(const mjCFrame& other) {
// attach referencing elements
*model += *other.model;
// (b/350784262) delete keyframes
model->DeleteAll<mjCKey>(model->keys_);
// clear namespace and return body
other.model->prefix.clear();
other.model->suffix.clear();
@@ -1598,6 +1601,9 @@ mjCFrame& mjCFrame::operator+=(const mjCBody& other) {
// attach referencing elements
*model += *other.model;
// (b/350784262) delete keyframes
model->DeleteAll<mjCKey>(model->keys_);
// clear suffixes and return
other.model->suffix.clear();
other.model->prefix.clear();