diff --git a/CMakeLists.txt b/CMakeLists.txt index c2b6302..c8ddc2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,11 @@ find_package(OpenGL REQUIRED) # --- Assimp -------------------------------------------------------------------- # Assimp 5.2 (Ubuntu 22.04) crashes on some Blender FBX exports and uses older bone-offset conventions. +# Assimp's version file only matches the requested major version, so look for 6.x separately. find_package(assimp 5.3 CONFIG QUIET) +if(NOT assimp_FOUND) + find_package(assimp 6 CONFIG QUIET) +endif() if(NOT assimp_FOUND) if(NOT MR_FETCH_ASSIMP) message(FATAL_ERROR "Assimp not found. Install it or configure with -DMR_FETCH_ASSIMP=ON") diff --git a/src/app/AppUi.h b/src/app/AppUi.h index 5a19546..a5cba07 100644 --- a/src/app/AppUi.h +++ b/src/app/AppUi.h @@ -148,6 +148,7 @@ private: float motionFrame_ = 0.f; bool playing_ = false; bool loopMotion_ = true; + int frameInput_ = 0; double lastTick_ = -1.0; std::shared_ptr camera_; std::string cameraName_; diff --git a/src/app/Timeline.cpp b/src/app/Timeline.cpp index 0d7608e..50599c4 100644 --- a/src/app/Timeline.cpp +++ b/src/app/Timeline.cpp @@ -59,10 +59,11 @@ void App::drawTimelineWindow() { ImGui::SameLine(); if (ImGui::Button(">|")) setMotionFrame(end); ImGui::SameLine(); - int frame = static_cast(motionFrame_ + 0.5f); ImGui::SetNextItemWidth(ImGui::GetFontSize() * 4.5f); - if (ImGui::InputInt("##frame", &frame, 0, 0, ImGuiInputTextFlags_EnterReturnsTrue)) - setMotionFrame(std::clamp(static_cast(frame), 0.f, end)); + ImGui::InputInt("##frame", &frameInput_, 0, 0); + if (ImGui::IsItemDeactivatedAfterEdit()) + setMotionFrame(std::clamp(static_cast(frameInput_), 0.f, end)); + if (!ImGui::IsItemActive()) frameInput_ = static_cast(motionFrame_ + 0.5f); ImGui::SameLine(); const float seconds = motionFrame_ / 30.f; ImGui::Text("/ %.0f %d:%05.2f", end, static_cast(seconds) / 60, std::fmod(seconds, 60.f));