1010--track@t6:Object ID,0,15000,0,1
1111--track@t5:Mix,0,100,0,0.01
1212--check@c2:Print Information,0
13- --track0:X Center,-10000,10000,0,0.01
14- --track1:Y Center,-10000,10000,0,0.01
1513--value@_0:PI,{}
1614--[[pixelshader@motion_blur:
1715${SHADER_MOTION_BLUR}
1816]]
1917
18+ if (not pcall(obj.getvalue, "cx")) then
19+ debug_print("AviUtl ExEdit2 beta12 or later is required.")
20+ return
21+ end
22+
2023local function tobool(v, d)
2124 if (type(v) == "boolean") then
2225 return v
@@ -38,8 +41,6 @@ local geo_ctrl = tonumber(_0.geo_ctrl or s2) s2 = nil
3841local obj_id = tonumber(_0.object_id) or t6 t6 = nil -- beta 11a
3942local mix = math.min(math.max(tonumber(_0.mix) or t5, 0.0), 100.0) * 0.01 t5 = nil
4043local print_info = tobool(_0.print_info, c2 ~= 0) c2 = nil
41- local cx = (tonumber(_0.cx) or obj.track0) -- beta 11a
42- local cy = (tonumber(_0.cy) or obj.track1) -- beta 11a
4344_0 = nil
4445
4546local ffi = require("ffi")
@@ -84,12 +85,17 @@ local Output = ffi.typeof("Output")
8485local gv = obj.getvalue
8586
8687local dll_path = obj.getinfo("script_path") .. "ObjectMotionBlur_LK.dll"
87- local lib = ffi.load(dll_path)
88+ local ok, lib = pcall(ffi.load, dll_path)
89+ if (not ok) then
90+ debug_print("Dynamic library not found. Hint: Ensure the file path contains only ASCII characters.")
91+ return
92+ end
8893
8994local smp_lim = (preview_smp_lim == 0 or obj.getinfo("saving")) and render_smp_lim or preview_smp_lim
9095local w, h = obj.getpixel()
96+ local cx, cy = gv("cx"), gv("cy")
9197local dt = 1.0 / obj.framerate
92- local targets = {0, 1 , "x", "y", "rz", "zoom"}
98+ local targets = {"cx", "cy" , "x", "y", "rz", "zoom"}
9399
94100local param = Param(shutter_angle, smp_lim, ext, resize, geo_cache, geo_ctrl)
95101
0 commit comments