Skip to content

Commit 8d2ce3e

Browse files
simplify animation name lookup
1 parent 19c2d64 commit 8d2ce3e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ICE/IO/src/ModelLoader.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,9 @@ std::unordered_map<std::string, Animation> ModelLoader::extractAnimations(const
303303

304304
a.tracks[boneName] = std::move(track);
305305
}
306-
307-
out.try_emplace(anim->mName.C_Str(), std::move(a));
306+
std::string anim_name = anim->mName.C_Str();
307+
308+
out.try_emplace(anim_name.substr(anim_name.find_first_of('|') + 1), std::move(a));
308309
}
309310
return out;
310311
}

ICEFIELD/icefield.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ int main(void) {
4545
scene->getRegistry()->addComponent<TransformComponent>(
4646
entity2, TransformComponent(Eigen::Vector3f::Zero(), Eigen::Vector3f(0, 0, 0), Eigen::Vector3f::Constant(1)));
4747
scene->getRegistry()->addComponent<RenderComponent>(entity2, RenderComponent(mesh_id_2));
48-
scene->getRegistry()->addComponent<AnimationComponent>(entity2, AnimationComponent{.currentAnimation = "CharacterArmature|Walk", .loop = true});
48+
scene->getRegistry()->addComponent<AnimationComponent>(entity2, AnimationComponent{.currentAnimation = "Walk", .loop = true});
4949

5050
auto camera = std::make_shared<PerspectiveCamera>(60.0, 16.0 / 9.0, 0.01, 10000.0);
5151
camera->backward(5);

0 commit comments

Comments
 (0)