From b4b4fe37140ef45ac6caf71eca8143cd2d604213 Mon Sep 17 00:00:00 2001 From: shweet Date: Tue, 16 Dec 2025 20:22:42 -0500 Subject: [PATCH] AAAAAAAAAH ROOT TRANSFORM --- src/imgui/window/animation_preview.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/imgui/window/animation_preview.cpp b/src/imgui/window/animation_preview.cpp index a2ebe37..6290587 100644 --- a/src/imgui/window/animation_preview.cpp +++ b/src/imgui/window/animation_preview.cpp @@ -555,9 +555,17 @@ namespace anm2ed::imgui auto uvMin = frame.crop / texSize; auto uvMax = (frame.crop + frame.size) / texSize; - auto rootFrame = animation->rootAnimation.frame_generate(sampleTime, anm2::ROOT); - vec3 frameColorOffset = frame.colorOffset + rootFrame.colorOffset + colorOffset + sampleColor; - vec4 frameTint = frame.tint * rootFrame.tint; + + vec3 frameColorOffset = frame.colorOffset + colorOffset + sampleColor; + vec4 frameTint = frame.tint; + + if (isRootTransform) + { + auto rootFrame = animation->rootAnimation.frame_generate(sampleTime, anm2::ROOT); + frameColorOffset += rootFrame.colorOffset; + frameTint *= rootFrame.tint; + } + frameTint.a = std::max(0.0f, frameTint.a - (alphaOffset + sampleAlpha)); auto vertices = math::uv_vertices_get(uvMin, uvMax);