Skip to content

Commit ca141bc

Browse files
authored
Merge pull request #12 from korarei/refactor/id
Refactor: Use obj.id
2 parents 6f46c8f + 885a65c commit ca141bc

File tree

8 files changed

+22
-25
lines changed

8 files changed

+22
-25
lines changed

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
## 動作確認
1313

14-
- [AviUtl ExEdit2 beta12](https://spring-fragrance.mints.ne.jp/aviutl/)
14+
- [AviUtl ExEdit2 beta14](https://spring-fragrance.mints.ne.jp/aviutl/)
1515

1616
> [!CAUTION]
17-
> beta12以降必須
17+
> beta14以降必須
1818
1919
## 導入・削除・更新
2020

@@ -38,7 +38,7 @@
3838

3939
## `ObjectMotionBlur@MotionBlur_K`との相違点
4040

41-
このスクリプトは[ObjectMotionBlur@MotionBlur_K](https://github.com/korarei/AviUtl_MotionBlur_K_Script)の劣化移植版である.いくつかの機能が削除,制限,追加されている.
41+
このスクリプトは[ObjectMotionBlur@MotionBlur_K](https://github.com/korarei/AviUtl_MotionBlur_K_Script)の移植版である.いくつかの機能が削除,追加されている.
4242

4343
### 削除項目
4444

@@ -48,12 +48,6 @@
4848

4949
- Shutter Phase: `-shutter_angle`で固定.
5050

51-
### 制限項目
52-
53-
`beta12`で提供されているライブラリのみを使用したため制限された.
54-
55-
- Object ID (オブジェクト固有な値)
56-
5751
### 追加項目
5852

5953
新たに追加した機能.
@@ -158,7 +152,7 @@
158152

159153
表示される情報は以下のとおり
160154

161-
- Object ID (所謂`Object Index`.GeometryはObject IDごとに保存される.)
155+
- Object ID (所謂`obj.id`.GeometryはObject IDごとに保存される.)
162156

163157
- Index (所謂`obj.index`.個別オブジェクトのインデックス.)
164158

@@ -179,7 +173,6 @@
179173
resize = true, -- booleanも可
180174
geo_cache = 0,
181175
cache_ctrl = 0,
182-
object_id = 0,
183176
mix = 0.0,
184177
print_info = false, -- booleanも可
185178
}
@@ -259,6 +252,10 @@ Doug Lea and released to the public domain, as explained at
259252
https://creativecommons.org/licenses/publicdomain
260253

261254
## Change Log
255+
- **v1.0.0**
256+
- `Object ID`をスクリプト側で入手できるように変更.
257+
- `Print Information`で表示される`Required Samples`が1少なかった問題の解決.
258+
262259
- **v0.2.2**
263260
- luaの`require`から呼び出せるように変更.
264261
- リサイズ計算の精度向上.

dll_src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.20.0)
2-
project(ObjectMotionBlur_LK VERSION 0.2.2 LANGUAGES CXX)
2+
project(ObjectMotionBlur_LK VERSION 1.0.0 LANGUAGES CXX)
33

44
# Path Settings.
55
set(LUA_DIR "${CMAKE_SOURCE_DIR}/../.lua")

dll_src/lua_func.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ Obj::get_input(std::uint32_t ext) {
5252
input.res = Vec2<float>(static_cast<float>(lua_tonumber(L, -2)), static_cast<float>(lua_tonumber(L, -1)));
5353
lua_pop(L, 2);
5454

55-
input.obj_id = static_cast<std::size_t>(get_integer(11, 0ll));
56-
lua_getfield(L, -1, "index");
57-
lua_getfield(L, -2, "num");
55+
lua_getfield(L, -1, "id");
56+
lua_getfield(L, -2, "index");
57+
lua_getfield(L, -3, "num");
58+
input.obj_id = static_cast<std::size_t>(lua_tointeger(L, -3));
5859
input.obj_idx = static_cast<std::size_t>(lua_tointeger(L, -2));
5960
input.obj_num = static_cast<std::size_t>(lua_tointeger(L, -1));
60-
lua_pop(L, 2);
61+
lua_pop(L, 3);
6162

6263
lua_getfield(L, -1, "frame");
6364
lua_getfield(L, -2, "totalframe");

dll_src/luajit/luajit.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
LIBRARY "LuaJIT"
1+
LIBRARY "luaJIT"
22
EXPORTS
33
__swprintf_l
44
__vswprintf_l

dll_src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ process_motion_blur(lua_State *L) {
170170
"Object ID : {}\n"
171171
"Index : {}\n"
172172
"Required Samples: {}",
173-
input.obj_id, input.obj_idx, req_smp);
173+
input.obj_id, input.obj_idx, req_smp + 1u);
174174
obj.print(info);
175175
}
176176

scripts/ObjectMotionBlur_LK_template.anm2

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
--infomation:${SCRIPT_NAME} ${VERSION}
1+
--infomation:${SCRIPT_NAME} ${VERSION} by ${AUTHOR}
22
--label:${LABEL}
33
--track2:Shutter Angle,0,360,180
44
--track3:Sample Limit,1,4096,256,1
@@ -7,16 +7,15 @@
77
--check@c1:Resize,1
88
--select@s1:Geo Cache,None=0,Full=1,Minimal=2
99
--select@s2:Cache Control,Off=0,Auto=1,All=2,Current=3
10-
--track@t6:Object ID,0,15000,0,1
1110
--track@t5:Mix,0,100,0,0.01
1211
--check@c2:Print Information,0
1312
--value@_0:PI,{}
1413
--[[pixelshader@motion_blur:
1514
${SHADER_MOTION_BLUR}
1615
]]
1716

18-
if (not pcall(obj.getvalue, "cx")) then
19-
debug_print("AviUtl ExEdit2 beta12 or later is required.")
17+
if (obj.getinfo("version") < 2001400) then
18+
debug_print("AviUtl ExEdit2 beta14 or later is required.")
2019
return
2120
end
2221

@@ -38,7 +37,6 @@ local ext = tonumber(_0.extrapolation) or s0 s0 = nil
3837
local resize = tobool(_0.resize, c1 ~= 0) c1 = nil
3938
local geo_cache = tonumber(_0.geo_cache or s1) s1 = nil
4039
local cache_ctrl = tonumber(_0.cache_ctrl or s2) s2 = nil
41-
local obj_id = math.max(tonumber(_0.object_id) or t6, 0) t6 = nil -- beta 11a
4240
local mix = tonumber(_0.mix) or t5 t5 = nil
4341
local print_info = tobool(_0.print_info, c2 ~= 0) c2 = nil
4442
_0 = nil
@@ -54,6 +52,5 @@ lib.process_motion_blur(
5452
geo_cache,
5553
cache_ctrl,
5654
mix,
57-
print_info,
58-
obj_id
55+
print_info
5956
)

tools/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def main():
5858
replacements.update({
5959
"LABEL": config["label"],
6060
"SCRIPT_NAME": config["script_name"],
61+
"AUTHOR": config["author"],
6162
"VERSION": args.tag
6263
})
6364

tools/build_config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"author": "Korarei",
23
"label": "ぼかし",
34
"script_name": "ObjectMotionBlur_LK",
45
"replacements_path": {

0 commit comments

Comments
 (0)