Remove requirement to specify a name prefix or suffix during attach.
PiperOrigin-RevId: 703049862 Change-Id: I5fd6da0581331b1b716110292a8160ae16934157
This commit is contained in:
committed by
Copybara-Service
parent
503e5e1815
commit
f882f4b065
@@ -873,10 +873,6 @@ mjCBody& mjCBody::operator+=(const mjCFrame& other) {
|
|||||||
other.model->suffix = other.suffix;
|
other.model->suffix = other.suffix;
|
||||||
other.model->StoreKeyframes(model);
|
other.model->StoreKeyframes(model);
|
||||||
|
|
||||||
if (other.prefix.empty() && other.suffix.empty()) {
|
|
||||||
throw mjCError(this, "either prefix or suffix must be non-empty");
|
|
||||||
}
|
|
||||||
|
|
||||||
// attach defaults
|
// attach defaults
|
||||||
if (other.model != model) {
|
if (other.model != model) {
|
||||||
mjCDef* subdef = new mjCDef(*other.model->Default());
|
mjCDef* subdef = new mjCDef(*other.model->Default());
|
||||||
@@ -1845,10 +1841,6 @@ mjCFrame& mjCFrame::operator+=(const mjCBody& other) {
|
|||||||
other.model->prefix = "";
|
other.model->prefix = "";
|
||||||
other.model->suffix = "";
|
other.model->suffix = "";
|
||||||
|
|
||||||
if (other.prefix.empty() && other.suffix.empty()) {
|
|
||||||
throw mjCError(this, "either prefix or suffix must be non-empty");
|
|
||||||
}
|
|
||||||
|
|
||||||
mjCBody* subtree = new mjCBody(other, model);
|
mjCBody* subtree = new mjCBody(other, model);
|
||||||
other.ForgetKeyframes();
|
other.ForgetKeyframes();
|
||||||
other.model->prefix = subtree->prefix;
|
other.model->prefix = subtree->prefix;
|
||||||
|
|||||||
Reference in New Issue
Block a user