From 08abed324c5790c77b5afae82c45ce23c34b77c7 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 9 Oct 2026 00:19:22 +0300 Subject: [PATCH] fix 'color' target --- res/modules/internal/animation_codegen.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/res/modules/internal/animation_codegen.lua b/res/modules/internal/animation_codegen.lua index 5a7c5d8e0..1b637d866 100644 --- a/res/modules/internal/animation_codegen.lua +++ b/res/modules/internal/animation_codegen.lua @@ -207,11 +207,16 @@ local function codegen_track(raw_track, lineset, keysets, use_tsf, target_type) end if color[1] or color[2] or color[3] or color[4] then - code = code .. "\n target:set_color({" .. + local color_vector = "{" .. (color[1] and ("l" .. color[1]) or '1').. ", " .. (color[2] and ("l" .. color[2]) or '1').. ", " .. (color[3] and ("l" .. color[3]) or '1').. ", " .. - (color[4] and ("l" .. color[4]) or '1').. "})" + (color[4] and ("l" .. color[4]) or '1').. "}" + if target_type == "bone" then + code = code .. "\n target:set_color(" .. color_vector .. ", bone_index)" + else + code = code .. "\n target:set_color(" .. color_vector .. ")" + end end if not has_tsf or not use_tsf then