Skip to content

Commit 0c2c638

Browse files
authored
Merge pull request #79 from mimaraka/develop
v2.0-beta1.1
2 parents 651f31c + 3741eb3 commit 0c2c638

26 files changed

+210
-125
lines changed

README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
![GitHub all releases](https://img.shields.io/github/downloads/mimaraka/aviutl-plugin-curve_editor/total)
88
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/mimaraka/aviutl-plugin-curve_editor)
99

10-
![graph3 1](https://github.com/user-attachments/assets/74930f51-99d3-4ce9-bafb-778a3476e864)
10+
![thumbnail](https://github.com/user-attachments/assets/fa8243c9-3b7b-4b86-aa59-c266e6101fb7)
1111

12-
様々なイージングを作成・管理することができる AviUtl 用のプラグイン・スクリプトです。
12+
様々なイージングを作成・管理することができる AviUtl のプラグイン・スクリプトです。
1313

1414
## ダウンロード
1515

16-
下のリンクから最新バージョンの zip ファイル(`curve_editor-v*.zip`)をダウンロードしてください。
16+
下のリンクから最新バージョンの ZIP ファイル(`curve_editor-v*.zip`)をダウンロードしてください。
1717
[**ダウンロード**](https://github.com/mimaraka/aviutl-plugin-curve_editor/releases/latest)
1818

1919
## インストール
2020

21-
ダウンロードした`curve_editor-v*.zip`を解凍し、以下の内容物をそれぞれ適切な場所に配置します。
21+
ダウンロードしたZIPファイルを展開し、以下の内容物をそれぞれ適切な場所に配置します。
2222

2323
| 内容物 | 移動先 |
2424
| :--------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------: |
@@ -83,7 +83,7 @@ AviUtl を起動後、メインウィンドウの「表示」メニューから
8383

8484
### グラフビュー
8585

86-
マウスホイールを回転させて、でビューを拡大縮小することができます
86+
マウスホイールを回転させて、ビューを拡大縮小することができます
8787

8888
マウスホイールをドラッグする、または、 `Alt` キーを押しながら左ボタンでドラッグすることで、ビューの位置を変更することができます。
8989

@@ -100,9 +100,9 @@ AviUtl を起動後、メインウィンドウの「表示」メニューから
100100
> [!TIP]
101101
> Shift キーを押しながらドラッグ&ドロップすることで、XYZ 座標など、イージングが一度に設定されるトラックバーについても、各座標ごとに個別にイージングを設定することができます。
102102
103-
### その他
103+
## その他
104104

105-
詳細な使用方法については [Wiki](https://github.com/mimaraka/aviutl-plugin-curve_editor/wiki) を参照してください
105+
詳細な使用方法やよくある問題の解決方法については、 [Wiki](https://github.com/mimaraka/aviutl-plugin-curve_editor/wiki) を参照してください。
106106

107107
## 動作環境
108108

@@ -116,13 +116,9 @@ AviUtl を起動後、メインウィンドウの「表示」メニューから
116116
> - [Visual C++ 2015/2017/2019/2022 再頒布可能パッケージ (x86)](https://aka.ms/vs/17/release/vc_redist.x86.exe)
117117
> - [Microsoft Edge WebView2 ランタイム (x86)](https://developer.microsoft.com/ja-jp/microsoft-edge/webview2/?form=MA13LH)
118118
119-
## Q&A
120-
121-
Wiki の[トラブルシューティング](https://github.com/mimaraka/aviutl-plugin-curve_editor/wiki/%E3%83%88%E3%83%A9%E3%83%96%E3%83%AB%E3%82%B7%E3%83%A5%E3%83%BC%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0)を参照してください。
122-
123119
## バグ報告
124120

125-
バグ報告は [Issues](https://github.com/mimaraka/aviutl-plugin-curve_editor/issues) または [Google Form](https://forms.gle/mhv96DSYVhhKPkYQ8) (匿名回答可)からお願いします。
121+
バグ報告は Issues または [Google Form](https://forms.gle/mhv96DSYVhhKPkYQ8) (匿名回答可)からお願いします。
126122

127123
## 免責事項
128124

curve_editor/config.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,18 @@ namespace curve_editor::global {
9595
}
9696
}
9797

98-
const char* Config::get_edit_mode_dispname() const noexcept {
99-
return get_edit_mode_dispname(edit_mode_);
98+
const char* Config::get_apply_mode_dispname(ApplyMode apply_mode) const noexcept {
99+
using StringId = StringTable::StringId;
100+
switch (apply_mode) {
101+
case ApplyMode::Normal:
102+
return string_table[StringId::LabelApplyModeNormal];
103+
case ApplyMode::IgnoreMidPoint:
104+
return string_table[StringId::LabelApplyModeIgnoreMidPoint];
105+
case ApplyMode::Interpolate:
106+
return string_table[StringId::LabelApplyModeInterpolate];
107+
default:
108+
return nullptr;
109+
}
100110
}
101111

102112
bool Config::set_apply_mode(EditMode edit_mode, ApplyMode apply_mode) noexcept {
@@ -135,14 +145,6 @@ namespace curve_editor::global {
135145
else return false;
136146
}
137147

138-
void Config::set_separator_pos(double separator_pos) noexcept {
139-
separator_pos_ = mkaul::clamp(separator_pos, 0., 1.);
140-
}
141-
142-
void Config::set_preset_size(int preset_size) noexcept {
143-
preset_size_ = mkaul::clamp(preset_size, 20, 200);
144-
}
145-
146148
#define GET_KEY(var) std::string{ #var, 0u, strlen(#var) - 1u}.c_str()
147149

148150
// jsonファイルを読み込み

curve_editor/config.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace curve_editor::global {
5151
bool set_edit_mode(EditMode edit_mode) noexcept;
5252

5353
const char* get_edit_mode_dispname(EditMode edit_mode) const noexcept;
54-
const char* get_edit_mode_dispname() const noexcept;
54+
const char* get_edit_mode_dispname() const noexcept { return get_edit_mode_dispname(edit_mode_); };
5555

5656
auto get_layout_mode() const noexcept { return layout_mode_; }
5757
bool set_layout_mode(LayoutMode layout_mode) noexcept;
@@ -61,6 +61,9 @@ namespace curve_editor::global {
6161
bool set_apply_mode(EditMode edit_mode, ApplyMode apply_mode) noexcept;
6262
bool set_apply_mode(ApplyMode apply_mode) noexcept { return set_apply_mode(get_edit_mode(), apply_mode); }
6363

64+
const char* get_apply_mode_dispname(ApplyMode apply_mode) const noexcept;
65+
const char* get_apply_mode_dispname() const noexcept { return get_apply_mode_dispname(get_apply_mode()); }
66+
6467
const auto& get_curve_color() const noexcept { return pref_.curve_color; }
6568
void set_curve_color(mkaul::ColorF curve_color) noexcept { pref_.curve_color = curve_color; }
6669

@@ -119,6 +122,9 @@ namespace curve_editor::global {
119122
auto get_bg_image_opacity() const noexcept { return pref_.bg_image_opacity; }
120123
void set_bg_image_opacity(float bg_image_opacity) noexcept { pref_.bg_image_opacity = mkaul::clamp(bg_image_opacity, 0.f, 1.f); }
121124

125+
auto get_apply_button_height() const noexcept { return pref_.apply_button_height; }
126+
void set_apply_button_height(uint32_t apply_button_height) noexcept { pref_.apply_button_height = mkaul::clamp(apply_button_height, 30u, 200u); }
127+
122128
auto get_enable_hotkeys() const noexcept { return pref_.enable_hotkeys; }
123129
void set_enable_hotkeys(bool enable_hotkeys) noexcept { pref_.enable_hotkeys = enable_hotkeys; }
124130

@@ -132,10 +138,10 @@ namespace curve_editor::global {
132138
void set_ignore_autosaver_warning(bool ignore_autosaver_warning) noexcept { ignore_autosaver_warning_ = ignore_autosaver_warning; }
133139

134140
auto get_separator_pos() const noexcept { return separator_pos_; }
135-
void set_separator_pos(double separator_pos) noexcept;
141+
void set_separator_pos(double separator_pos) noexcept { separator_pos_ = mkaul::clamp(separator_pos, 0., 1.); }
136142

137143
auto get_preset_size() const noexcept { return preset_size_; }
138-
void set_preset_size(int preset_size) noexcept;
144+
void set_preset_size(int preset_size) noexcept { preset_size_ = mkaul::clamp(preset_size, 20, 200); }
139145

140146
const auto& get_select_window_size() const noexcept { return select_window_size_; }
141147
void set_select_window_size(const mkaul::Size<uint32_t>& select_window_size) noexcept { select_window_size_ = select_window_size; }

curve_editor/constants.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace curve_editor::global {
2626
inline constexpr auto PLUGIN_VERSION = mkaul::Version{
2727
mkaul::VersionNumber{2},
2828
mkaul::PreviewType{mkaul::PreviewType::Type::Beta},
29-
mkaul::VersionNumber{1, 0, 2}
29+
mkaul::VersionNumber{1, 1, 0}
3030
};
3131
inline constexpr auto PLUGIN_DEVELOPER = "mimaraka";
3232
inline constexpr auto PLUGIN_TRANSLATOR = "Deepdive";

curve_editor/curve_editor.rc

1.8 KB
Binary file not shown.

curve_editor/dialog_pref_appearance.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ namespace curve_editor {
2929
hwnd_button_bg_image_path_ = ::GetDlgItem(hwnd, IDC_BUTTON_BACKGROUND_IMAGE);
3030
hwnd_slider_bg_image_opacity_ = ::GetDlgItem(hwnd, IDC_SLIDER_IMAGE_OPACITY);
3131
hwnd_static_bg_image_opacity_ = ::GetDlgItem(hwnd, IDC_STATIC_IMAGE_OPACITY);
32+
hwnd_static_apply_button_height_ = ::GetDlgItem(hwnd, IDC_STATIC_APPLY_BUTTON_HEIGHT);
33+
hwnd_slider_apply_button_height_ = ::GetDlgItem(hwnd, IDC_SLIDER_APPLY_BUTTON_HEIGHT);
3234
hwnd_check_show_trace_ = ::GetDlgItem(hwnd, IDC_CHECK_SHOW_TRACE);
3335
hwnd_check_enable_animation_ = ::GetDlgItem(hwnd, IDC_CHECK_ENABLE_ANIMATION);
3436

@@ -44,6 +46,7 @@ namespace curve_editor {
4446
::SendMessageA(hwnd_slider_curve_thickness_, TBM_SETRANGE, TRUE, MAKELPARAM(1, 100));
4547
::SendMessageA(hwnd_slider_curve_quality_, TBM_SETRANGE, TRUE, MAKELPARAM(100, 1000));
4648
::SendMessageA(hwnd_slider_bg_image_opacity_, TBM_SETRANGE, TRUE, MAKELPARAM(0, 100));
49+
::SendMessageA(hwnd_slider_apply_button_height_, TBM_SETRANGE, TRUE, MAKELPARAM(30, 200));
4750
}
4851

4952

@@ -78,6 +81,10 @@ namespace curve_editor {
7881
int value_int = ::SendMessageA(hwnd_slider_bg_image_opacity_, TBM_GETPOS, NULL, NULL);
7982
::SetWindowTextA(hwnd_static_bg_image_opacity_, std::format("{}%", value_int).c_str());
8083
}
84+
else if (lparam == (LPARAM)hwnd_slider_apply_button_height_) {
85+
int value_int = ::SendMessageA(hwnd_slider_apply_button_height_, TBM_GETPOS, NULL, NULL);
86+
::SetWindowTextA(hwnd_static_apply_button_height_, std::format("{}", value_int).c_str());
87+
}
8188
return TRUE;
8289

8390
case WM_PAINT:
@@ -143,10 +150,12 @@ namespace curve_editor {
143150
::SendMessageA(hwnd_slider_curve_thickness_, TBM_SETPOS, TRUE, (LPARAM)(global::config.get_curve_thickness() * 10.f));
144151
::SendMessageA(hwnd_slider_curve_quality_, TBM_SETPOS, TRUE, (LPARAM)(global::config.get_curve_resolution()));
145152
::SendMessageA(hwnd_slider_bg_image_opacity_, TBM_SETPOS, TRUE, (LPARAM)round(global::config.get_bg_image_opacity() * 100.f));
153+
::SendMessageA(hwnd_slider_apply_button_height_, TBM_SETPOS, TRUE, (LPARAM)global::config.get_apply_button_height());
146154

147155
::SendMessageA(hwnd, WM_HSCROLL, NULL, (LPARAM)hwnd_slider_curve_thickness_);
148156
::SendMessageA(hwnd, WM_HSCROLL, NULL, (LPARAM)hwnd_slider_curve_quality_);
149157
::SendMessageA(hwnd, WM_HSCROLL, NULL, (LPARAM)hwnd_slider_bg_image_opacity_);
158+
::SendMessageA(hwnd, WM_HSCROLL, NULL, (LPARAM)hwnd_slider_apply_button_height_);
150159

151160
return TRUE;
152161

@@ -162,10 +171,12 @@ namespace curve_editor {
162171
global::config.set_curve_resolution(
163172
(uint32_t)::SendMessageA(hwnd_slider_curve_quality_, TBM_GETPOS, NULL, NULL)
164173
);
165-
166174
global::config.set_bg_image_opacity(
167175
(float)::SendMessageA(hwnd_slider_bg_image_opacity_, TBM_GETPOS, NULL, NULL) * 0.01f
168176
);
177+
global::config.set_apply_button_height(
178+
(uint32_t)::SendMessageA(hwnd_slider_apply_button_height_, TBM_GETPOS, NULL, NULL)
179+
);
169180
{
170181
char buffer[MAX_PATH];
171182
::GetWindowTextA(hwnd_edit_bg_image_path_, buffer, MAX_PATH);

curve_editor/dialog_pref_appearance.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ namespace curve_editor {
1919
HWND hwnd_button_bg_image_path_ = NULL;
2020
HWND hwnd_static_bg_image_opacity_ = NULL;
2121
HWND hwnd_slider_bg_image_opacity_ = NULL;
22+
HWND hwnd_static_apply_button_height_ = NULL;
23+
HWND hwnd_slider_apply_button_height_ = NULL;
2224
HWND hwnd_check_show_trace_ = NULL;
2325
HWND hwnd_check_enable_animation_ = NULL;
2426

curve_editor/filter_wndproc.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ namespace curve_editor {
2424
static MyWebView2 my_webview;
2525
static ActCtxHelper actctx_helper;
2626
static DragAndDrop dnd;
27+
static bool dnd_init_done = false;
2728

2829
switch (message) {
2930
// ウィンドウ作成時
3031
case WindowMessage::Init:
3132
actctx_helper.init();
32-
dnd.init();
3333
my_webview.init(hwnd, [](MyWebView2* this_) {
3434
mkaul::WindowRectangle bounds;
3535
bounds.from_client_rect(this_->get_hwnd());
@@ -57,6 +57,15 @@ namespace curve_editor {
5757
dnd.exit();
5858
break;
5959

60+
// 拡張編集フックに関する初期化処理
61+
// curve_editor.aufの配置場所によっては、WindowMessage::Init時点ではexedit.aufが読み込まれていない可能性がある
62+
case WindowMessage::ChangeWindow:
63+
if (!dnd_init_done) {
64+
dnd.init();
65+
dnd_init_done = true;
66+
}
67+
break;
68+
6069
case WindowMessage::FileClose:
6170
global::editor.reset_id_curves();
6271
my_webview.send_command(MessageCommand::UpdateEditor);

curve_editor/host_object_config.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ namespace curve_editor {
1313
ConfigHostObject() {
1414
register_member(L"editMode", DispatchType::PropertyGet, +[] { return global::config.get_edit_mode(); });
1515
register_member(L"editMode", DispatchType::PropertyPut, +[](int edit_mode) { global::config.set_edit_mode((EditMode)edit_mode); });
16+
register_member(L"applyMode", DispatchType::PropertyGet, +[] { return global::config.get_apply_mode(); });
17+
register_member(L"applyMode", DispatchType::PropertyPut, +[](int apply_mode) { global::config.set_apply_mode((ApplyMode)apply_mode); });
1618
register_member(L"layoutMode", DispatchType::PropertyGet, +[] { return global::config.get_layout_mode(); });
1719
register_member(L"editModeNum", DispatchType::PropertyGet, +[] { return (uint32_t)EditMode::NumEditMode; });
20+
register_member(L"applyModeNum", DispatchType::PropertyGet, +[] { return (uint32_t)ApplyMode::NumApplyMode; });
1821
register_member(L"getEditModeName", DispatchType::Method, +[](int edit_mode) { return global::config.get_edit_mode_dispname((EditMode)edit_mode); });
22+
register_member(L"getApplyModeName", DispatchType::Method, +[](int apply_mode) { return global::config.get_apply_mode_dispname((ApplyMode)apply_mode); });
1923
register_member(L"showXLabel", DispatchType::PropertyGet, +[] {return global::config.get_show_x_label(); });
2024
register_member(L"showYLabel", DispatchType::PropertyGet, +[] { return global::config.get_show_y_label(); });
2125
register_member(L"showHandle", DispatchType::PropertyGet, +[] { return global::config.get_show_handle(); });
@@ -38,6 +42,7 @@ namespace curve_editor {
3842
register_member(L"separatorPos", DispatchType::PropertyPut, +[](double separator_pos) { global::config.set_separator_pos(separator_pos); });
3943
register_member(L"presetSize", DispatchType::PropertyGet, +[] { return global::config.get_preset_size(); });
4044
register_member(L"presetSize", DispatchType::PropertyPut, +[](int preset_size) { global::config.set_preset_size(preset_size); });
45+
register_member(L"applyButtonHeight", DispatchType::PropertyGet, +[] { return global::config.get_apply_button_height(); });
4146
}
4247
};
4348
} // namespace curve_editor

curve_editor/message_handler.cpp

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -348,39 +348,6 @@ namespace curve_editor {
348348
auto curve = global::id_manager.get_curve<GraphCurve>(curve_id);
349349

350350
ContextMenu{
351-
MenuItem{
352-
global::string_table[StringId::MenuGraphApplyMode],
353-
MenuItem::Type::String,
354-
MenuItem::State::Null,
355-
nullptr,
356-
{
357-
MenuItem{
358-
global::string_table[StringId::LabelApplyModeNormal],
359-
MenuItem::Type::RadioCheck,
360-
global::config.get_apply_mode(mode) == ApplyMode::Normal ? MenuItem::State::Checked : MenuItem::State::Null,
361-
[mode]() {
362-
global::config.set_apply_mode(mode, ApplyMode::Normal);
363-
}
364-
},
365-
MenuItem{
366-
global::string_table[StringId::LabelApplyModeIgnoreMidPoint],
367-
MenuItem::Type::RadioCheck,
368-
global::config.get_apply_mode(mode) == ApplyMode::IgnoreMidPoint ? MenuItem::State::Checked : MenuItem::State::Null,
369-
[mode]() {
370-
global::config.set_apply_mode(mode, ApplyMode::IgnoreMidPoint);
371-
}
372-
},
373-
MenuItem{
374-
global::string_table[StringId::LabelApplyModeInterpolate],
375-
MenuItem::Type::RadioCheck,
376-
global::config.get_apply_mode(mode) == ApplyMode::Interpolate ? MenuItem::State::Checked : MenuItem::State::Null,
377-
[mode]() {
378-
global::config.set_apply_mode(mode, ApplyMode::Interpolate);
379-
}
380-
},
381-
}
382-
},
383-
MenuItem{"", MenuItem::Type::Separator},
384351
//MenuItem{global::string_table[StringId::MenuGraphAddAnchor]},
385352
MenuItem{global::string_table[StringId::MenuGraphReverseCurve],
386353
MenuItem::Type::String,
@@ -897,21 +864,24 @@ namespace curve_editor {
897864
pfd->QueryInterface(IID_PPV_ARGS(&pfc));
898865
if (pfc) {
899866
pfc->AddCheckButton(0, ::sjis_to_wide(global::string_table[StringId::LabelCollectionExportOmitDate]).c_str(), FALSE);
867+
pfc->AddCheckButton(1, ::sjis_to_wide(global::string_table[StringId::LabelCollectionExportSetIndent]).c_str(), TRUE);
900868
}
901869
hr = pfd->Show(hwnd_);
902870
if (SUCCEEDED(hr)) {
903871
IShellItem* psi;
904872
hr = pfd->GetResult(&psi);
905873
if (SUCCEEDED(hr)) {
906874
BOOL omit_date = FALSE;
875+
BOOL set_indent = TRUE;
907876
if (pfc) {
908877
pfc->GetCheckButtonState(0, &omit_date);
878+
pfc->GetCheckButtonState(1, &set_indent);
909879
}
910880
PWSTR path;
911881
hr = psi->GetDisplayName(SIGDN_FILESYSPATH, &path);
912882
if (SUCCEEDED(hr)) {
913883
global::preset_manager.export_collection(
914-
global::preset_manager.get_current_collection_id(), ::wide_to_sjis(path), omit_date
884+
global::preset_manager.get_current_collection_id(), ::wide_to_sjis(path), omit_date, set_indent
915885
);
916886
::CoTaskMemFree(path);
917887
}

0 commit comments

Comments
 (0)