Skip to content

Commit

Permalink
[ren.animation_renderer2] somewhat reorganised animation_renderer2 dbgui
Browse files Browse the repository at this point in the history
  • Loading branch information
harrand committed Oct 28, 2023
1 parent 9fdad2a commit 2180701
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/tz/ren/animation2.dbgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,10 @@ namespace tz::ren
}

ImGui::Spacing();
if(anim_objects.playback.size() && ImGui::CollapsingHeader("Playing Animations", ImGuiTreeNodeFlags_DefaultOpen))
{
auto& currently_playing = anim_objects.playback.front();
std::string_view animation_name = this->gltf_get_animation_name(static_cast<tz::hanval>(gltf_id), currently_playing.animation_id);
ImGui::Text("%zu (%s)", currently_playing.animation_id, animation_name.data());
ImGui::ProgressBar(anim_objects.playback_time / this->gltf_get_animation_length(static_cast<tz::hanval>(gltf_id), currently_playing.animation_id));
ImGui::Checkbox("Loop", &currently_playing.loop);
ImGui::SliderFloat("Time Warp", &currently_playing.time_warp, -5.0f, 5.0f);
}

if(gltf.data.get_animations().size())
{
// choose an animation to play/queue
ImGui::Separator();
ImGui::TextColored(ImVec4{1.0f, 0.3f, 0.3f, 1.0f}, "Play/Queue Animation");
static playback_data new_anim;
ImGui::Checkbox("Loop", &new_anim.loop);
Expand All @@ -102,6 +92,17 @@ namespace tz::ren
this->animated_object_queue_animation(aoh, new_anim);
}
}

if(anim_objects.playback.size() && ImGui::CollapsingHeader("Playing Animations", ImGuiTreeNodeFlags_DefaultOpen))
{
ImGui::Separator();
auto& currently_playing = anim_objects.playback.front();
std::string_view animation_name = this->gltf_get_animation_name(static_cast<tz::hanval>(gltf_id), currently_playing.animation_id);
ImGui::Text("%zu (%s)", currently_playing.animation_id, animation_name.data());
ImGui::ProgressBar(anim_objects.playback_time / this->gltf_get_animation_length(static_cast<tz::hanval>(gltf_id), currently_playing.animation_id));
ImGui::Checkbox("Loop##1", &currently_playing.loop);
ImGui::SliderFloat("Time Warp##1", &currently_playing.time_warp, -5.0f, 5.0f);
}
}
}
ImGui::EndChild();
Expand Down

0 comments on commit 2180701

Please sign in to comment.