Clear body subtreedofs when compiling. Fixes issue when attaching previously compiled model.
PiperOrigin-RevId: 738906593 Change-Id: I74875b4d07c422e397358dff5daf6682ec1bd655
This commit is contained in:
committed by
Copybara-Service
parent
2e11afa2de
commit
8d92a0fbe6
@@ -4008,9 +4008,6 @@ static void warninghandler(const char* msg) {
|
||||
mjModel* mjCModel::Compile(const mjVFS* vfs, mjModel** m) {
|
||||
if (compiled) {
|
||||
// clear kinematic tree
|
||||
for (int i=0; i < bodies_.size(); i++) {
|
||||
bodies_[i]->subtreedofs = 0;
|
||||
}
|
||||
mjCBody* world = bodies_[0];
|
||||
ResetTreeLists();
|
||||
Clear();
|
||||
@@ -4313,6 +4310,11 @@ void mjCModel::TryCompile(mjModel*& m, mjData*& d, const mjVFS* vfs) {
|
||||
// make lists of objects created in kinematic tree
|
||||
MakeLists(bodies_[0]);
|
||||
|
||||
// clear subtreedofs
|
||||
for (int i=0; i < bodies_.size(); i++) {
|
||||
bodies_[i]->subtreedofs = 0;
|
||||
}
|
||||
|
||||
// fill missing names and check that they are all filled
|
||||
for (const auto& asset : meshes_) asset->CopyFromSpec();
|
||||
for (const auto& asset : skins_) asset->CopyFromSpec();
|
||||
|
||||
Reference in New Issue
Block a user