Skip to content

Commit

Permalink
Added animators
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-beqiraj committed May 4, 2024
1 parent 68873d5 commit 1ef9b6a
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions GUI/src/MeshInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,19 @@ void Prisma::MeshInfo::showSelected(Prisma::MeshInfo::MeshData meshData) {
auto isAnimate = dynamic_cast<AnimatedMesh*>(meshData.mesh);
if (isAnimate) {
auto animator = isAnimate->animator();
auto animation = animator->animation();
auto getLast = [](std::string s) {
size_t found = s.find_last_of('/');
return found != std::string::npos ? s.substr(found + 1) : s;
};
auto name = getLast(animation->name());
ImGui::Text("%s", name.c_str());
float current = animator->currentTime();
//ImGui::ProgressBar(current);
if (ImGui::SliderFloat("Frames", &current, 0.0f, animation->GetDuration())) {
animator->frame(current);
if (animator) {
auto animation = animator->animation();
auto getLast = [](std::string s) {
size_t found = s.find_last_of('/');
return found != std::string::npos ? s.substr(found + 1) : s;
};
auto name = getLast(animation->name());
ImGui::Text("%s", name.c_str());
float current = animator->currentTime();
//ImGui::ProgressBar(current);
if (ImGui::SliderFloat("Frames", &current, 0.0f, animation->GetDuration())) {
animator->frame(current);
}
}
}
ImGui::Dummy(ImVec2(0.0f, 10.0f));
Expand Down

0 comments on commit 1ef9b6a

Please sign in to comment.