From ea63d29221903a948ed84b2c982e5a99e296037e Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 29 Sep 2026 18:39:46 +0300 Subject: [PATCH] fix custom curves --- res/modules/internal/animation_codegen.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/res/modules/internal/animation_codegen.lua b/res/modules/internal/animation_codegen.lua index a8fabab8e..004cdc4a3 100644 --- a/res/modules/internal/animation_codegen.lua +++ b/res/modules/internal/animation_codegen.lua @@ -15,11 +15,13 @@ local exclude_patters = { } -- TODO: replace with actual expression -> lua translator -local function process_expression(src, memoised, ismul) - if ismul then - src = string.format("(%s) * intensity + (1.0 - intensity)", src) - else - src = string.format("(%s) * intensity", src) +local function process_expression(src, memoised, ismul, iscurve) + if not iscurve then + if ismul then + src = string.format("(%s) * intensity + (1.0 - intensity)", src) + else + src = string.format("(%s) * intensity", src) + end end for i, pattern in ipairs(exclude_patters) do @@ -284,7 +286,7 @@ function internals.compile_animation_track(raw_track, track_name) for name, curve in pairs(raw_track.curves) do context.curves[name] = load(string.format( "return function(kl, kr, t) return %s end", - process_expression(curve.func, context.memoised) + process_expression(curve.func, context.memoised, false, true) ), "", "t", env)() end