From d6f7d2d424a885b385e7285690b6f48ccf225f62 Mon Sep 17 00:00:00 2001 From: Nate Koenig Date: Tue, 16 Jun 2020 15:19:35 -0700 Subject: [PATCH] Fix hierarchical submesh processing in the ColladaLoader. (#78) Fix hierarchical submesh processing in the ColladaLoader. #78 Signed-off-by: Nate Koenig --- Changelog.md | 3 +++ graphics/src/ColladaLoader.cc | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Changelog.md b/Changelog.md index 2eec25bf6..520d551af 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,9 @@ ## Ignition Common 3.X.X +1. Fix hierarchical submesh processing in the ColladaLoader. + * [Pull Request 78](https://github.com/ignitionrobotics/ign-common/pull/78) + ## Ignition Common 3.6.0 (2020-06-09) 1. Refactor Image::MaxColor to reduce computation time diff --git a/graphics/src/ColladaLoader.cc b/graphics/src/ColladaLoader.cc index 54f88be26..7812b36cc 100644 --- a/graphics/src/ColladaLoader.cc +++ b/graphics/src/ColladaLoader.cc @@ -466,11 +466,6 @@ void ColladaLoaderPrivate::LoadNode(tinyxml2::XMLElement *_elem, Mesh *_mesh, ignition::math::Matrix4d transform = this->LoadNodeTransform(_elem); transform = _transform * transform; - if (_elem->Attribute("name")) - { - this->currentNodeName = _elem->Attribute("name"); - } - nodeXml = _elem->FirstChildElement("node"); while (nodeXml) { @@ -478,6 +473,11 @@ void ColladaLoaderPrivate::LoadNode(tinyxml2::XMLElement *_elem, Mesh *_mesh, nodeXml = nodeXml->NextSiblingElement("node"); } + if (_elem->Attribute("name")) + { + this->currentNodeName = _elem->Attribute("name"); + } + if (_elem->FirstChildElement("instance_node")) { std::string nodeURLStr =