Skip to content

Commit

Permalink
Merge 6702594 into b0001bf
Browse files Browse the repository at this point in the history
  • Loading branch information
onurtore authored Nov 15, 2022
2 parents b0001bf + 6702594 commit 6d5f755
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions graphics/src/AssimpLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ class AssimpLoader::Implementation
/// calculated from the "old" parent model transform.
/// \param[in] _skeleton the skeleton to work on
public: void ApplyInvBindTransform(SkeletonPtr _skeleton) const;

/// \brief Sets the removeScene flag by reading the GZ_MESH_REMOVE_SCENE
/// environment variable. If removeScene true, Assimp loader
/// removes scene node from skeleton.
public: void SetRemoveSceneEnv();

/// \brief True if scene node is removed from the skeleton
public: bool removeScene;
};

//////////////////////////////////////////////////
Expand Down Expand Up @@ -735,5 +743,18 @@ void AssimpLoader::Implementation::ApplyInvBindTransform(
}
}

//////////////////////////////////////////////////
void AssimpLoader::Implementation::SetRemoveSceneEnv()
{
std::string removeSceneEnv;
common::env("GZ_MESH_REMOVE_SCENE", removeSceneEnv);
this->removeScene = false;
if (removeSceneEnv == "true")
{
gzmsg << "Removing scene root node" << std::endl;
this->removeScene = true;
}
}

}
}
1 change: 1 addition & 0 deletions graphics/src/AssimpLoader_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ TEST_F(AssimpLoader, LoadBoxWithHierarchicalNodes)
/////////////////////////////////////////////////
TEST_F(AssimpLoader, MergeBoxWithDoubleSkeleton)
{
common::setenv("GZ_MESH_REMOVE_SCENE", "false");
common::AssimpLoader loader;
common::Mesh *mesh = loader.Load(
common::testing::TestFile("data", "box_with_double_skeleton.dae"));
Expand Down

0 comments on commit 6d5f755

Please sign in to comment.