Skip to content

Commit

Permalink
Merge pull request #65 from mimaraka/develop
Browse files Browse the repository at this point in the history
v2.0-beta1.0.1
  • Loading branch information
mimaraka authored Feb 14, 2025
2 parents 98e7043 + c31306c commit c6f6341
Show file tree
Hide file tree
Showing 44 changed files with 86 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/バグ報告.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: バグ報告
about: 発生したバグについての報告
title: ''
labels: ''
labels: 'bug'
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/機能の改善要望.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 機能の改善要望
about: 改善してほしい機能の要望
title: ''
labels: ''
labels: 'enhancement'
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/機能の追加要望.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 機能の追加要望
about: 追加してほしい機能の要望
title: ''
labels: ''
labels: 'enhancement'
assignees: ''

---
Expand Down
17 changes: 2 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ AviUtl を起動後、メインウィンドウの「表示」メニューから
このモードでは、直線・ベジェ・振動・バウンスの 4 種類のカーブを自由に組み合わせてカーブを作成することができます。
グラフ上の何もないところをダブルクリックするとアンカーが追加されます。
カーブを削除するときは、アンカーをダブルクリックします。

アンカー上で右クリックをすることで、区間ごとのカーブの種類を変更したり、区間ごとに異なるモディファイアを設定したりすることができます。

- #### ベジェ

Expand Down Expand Up @@ -102,21 +104,6 @@ AviUtl を起動後、メインウィンドウの「表示」メニューから

詳細な使用方法については [Wiki](https://github.com/mimaraka/aviutl-plugin-curve_editor/wiki) を参照してください。。

## プロジェクトファイルへのカーブの保存機能について

一部のモードのカーブは、プロジェクトファイル(`.aup`)への埋め込みが可能となっており、プロジェクト保存時に同時に保存されるようになっています。
しかし、仕様上、**拡張編集標準のバックアップ機能では、これらのカーブを保存することはできません。**

そのため、カーブのデータを保持した状態でバックアップを行いたい場合は、以下のいずれかのプラグインを導入してください。

- [autosaver (オリジナル)](https://github.com/epi5131/autosaver)
- [autosaver (Garech フォーク版)](https://github.com/Garech-mas/autosaver)

## スクリプトから使用する(スクリプト開発者向け)

スクリプト制御や、`.anm``.obj``.tra`などのスクリプトファイル上で、Curve Editor のカーブを呼び出して使用することができます。
詳しくは、[API リファレンス (Lua スクリプト)](<https://github.com/mimaraka/aviutl-plugin-curve_editor/wiki/API%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9-(Lua%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88)>)を参照してください。

## 動作環境

| OS | AviUtl | 拡張編集 |
Expand Down
2 changes: 1 addition & 1 deletion curve_editor/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace curve_editor::global {
inline constexpr auto PLUGIN_VERSION = mkaul::Version{
mkaul::VersionNumber{2},
mkaul::PreviewType{mkaul::PreviewType::Type::Beta},
mkaul::VersionNumber{1}
mkaul::VersionNumber{1, 0, 1}
};
inline constexpr auto PLUGIN_DEVELOPER = "mimaraka";
inline constexpr auto PLUGIN_TRANSLATOR = "Deepdive";
Expand Down
3 changes: 3 additions & 0 deletions curve_editor/curve_base.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include "curve_id_manager.hpp"
#include "enum.hpp"
#include <cereal/cereal.hpp>
#include <nlohmann/json.hpp>

Expand Down Expand Up @@ -45,6 +46,8 @@ namespace curve_editor {
virtual void set_locked(bool locked) noexcept { locked_ = locked; }
[[nodiscard]] virtual bool is_default() const noexcept = 0;
[[nodiscard]] auto get_id() const noexcept { return id_; }
// TODO: CurveTypeというenumにする
[[nodiscard]] constexpr virtual EditMode get_type() const noexcept = 0;
[[nodiscard]] constexpr virtual std::string get_name() const noexcept = 0;
[[nodiscard]] virtual std::string get_disp_name() const noexcept = 0;
[[nodiscard]] virtual nlohmann::json create_json() const noexcept;
Expand Down
2 changes: 1 addition & 1 deletion curve_editor/curve_bezier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace curve_editor {
[[nodiscard]] std::unique_ptr<GraphCurve> clone_graph() const noexcept override { return std::make_unique<BezierCurve>(*this); }
[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return clone_graph(); }

// カーブの名前を取得する
[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Bezier; }
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_BEZIER; }
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelEditModeBezier]; }

Expand Down
1 change: 1 addition & 0 deletions curve_editor/curve_bounce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ namespace curve_editor {
[[nodiscard]] std::unique_ptr<GraphCurve> clone_graph() const noexcept override { return std::make_unique<BounceCurve>(*this); }
[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return clone_graph(); }

[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Bounce; }
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_BOUNCE; }
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelEditModeBounce]; }

Expand Down
8 changes: 4 additions & 4 deletions curve_editor/curve_editor.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<AdditionalIncludeDirectories>C:\aviutl_libs\lua5_1_4_Win32_dll8_lib\include\;C:\cpplibs\boost_1_69_0\include\boost-1_83\;$(ProjectDir)\external\json\include\;$(ProjectDir)\external\strconv\;$(ProjectDir)\external\aviutl_exedit_sdk\;$(ProjectDir)\external\cereal\include\;$(ProjectDir)\external\FastNoiseLite\Cpp\;$(ProjectDir)\external\aviutl-mkaul\;$(ProjectDir)\external\sol2\include\;$(ProjectDir)\external\magic_enum\include\</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(UserProfile)\source\lib\lua5_1_4_Win32_dll8_lib\include\;$(UserProfile)\source\lib\boost_1_87_0\;$(ProjectDir)\external\json\include\;$(ProjectDir)\external\strconv\;$(ProjectDir)\external\aviutl_exedit_sdk\;$(ProjectDir)\external\cereal\include\;$(ProjectDir)\external\FastNoiseLite\Cpp\;$(ProjectDir)\external\aviutl-mkaul\;$(ProjectDir)\external\sol2\include\;$(ProjectDir)\external\magic_enum\include\</AdditionalIncludeDirectories>
<AdditionalOptions>/source-charset:utf-8 /MP %(AdditionalOptions)</AdditionalOptions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>curve_editor.def</ModuleDefinitionFile>
<AdditionalDependencies>$(ProjectDir)external\aviutl-mkaul\mkaul\$(Configuration)\mkaul.lib;C:\aviutl_libs\lua5_1_4_Win32_dll8_lib\lua51.lib;comctl32.lib;d2d1.lib;$(CoreLibraryDependencies)</AdditionalDependencies>
<AdditionalDependencies>$(ProjectDir)external\aviutl-mkaul\mkaul\$(Configuration)\mkaul.lib;$(UserProfile)\source\lib\lua5_1_4_Win32_dll8_lib\lua51.lib;comctl32.lib;d2d1.lib;$(CoreLibraryDependencies)</AdditionalDependencies>
<DelayLoadDLLs>lua51.dll</DelayLoadDLLs>
<AdditionalManifestDependencies>type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'</AdditionalManifestDependencies>
</Link>
Expand Down Expand Up @@ -128,7 +128,7 @@ msbuild mkaul\mkaul.vcxproj /p:Configuration=$(Configuration) /p:Platform=$(Plat
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<AdditionalIncludeDirectories>C:\aviutl_libs\lua5_1_4_Win32_dll8_lib\include\;C:\cpplibs\boost_1_69_0\include\boost-1_83\;$(ProjectDir)\external\json\include\;$(ProjectDir)\external\strconv\;$(ProjectDir)\external\aviutl_exedit_sdk\;$(ProjectDir)\external\cereal\include\;$(ProjectDir)\external\FastNoiseLite\Cpp\;$(ProjectDir)\external\aviutl-mkaul\;$(ProjectDir)\external\sol2\include\;$(ProjectDir)\external\magic_enum\include\</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(UserProfile)\source\lib\lua5_1_4_Win32_dll8_lib\include\;$(UserProfile)\source\lib\boost_1_87_0\;$(ProjectDir)\external\json\include\;$(ProjectDir)\external\strconv\;$(ProjectDir)\external\aviutl_exedit_sdk\;$(ProjectDir)\external\cereal\include\;$(ProjectDir)\external\FastNoiseLite\Cpp\;$(ProjectDir)\external\aviutl-mkaul\;$(ProjectDir)\external\sol2\include\;$(ProjectDir)\external\magic_enum\include\</AdditionalIncludeDirectories>
<AdditionalOptions>/source-charset:utf-8 /MP %(AdditionalOptions)</AdditionalOptions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
Expand All @@ -140,7 +140,7 @@ msbuild mkaul\mkaul.vcxproj /p:Configuration=$(Configuration) /p:Platform=$(Plat
<GenerateDebugInformation>false</GenerateDebugInformation>
<ModuleDefinitionFile>curve_editor.def</ModuleDefinitionFile>
<DelayLoadDLLs>lua51.dll</DelayLoadDLLs>
<AdditionalDependencies>$(ProjectDir)external\aviutl-mkaul\mkaul\$(Configuration)\mkaul.lib;C:\aviutl_libs\lua5_1_4_Win32_dll8_lib\lua51.lib;comctl32.lib;d2d1.lib;$(CoreLibraryDependencies)</AdditionalDependencies>
<AdditionalDependencies>$(ProjectDir)external\aviutl-mkaul\mkaul\$(Configuration)\mkaul.lib;$(UserProfile)\source\lib\lua5_1_4_Win32_dll8_lib\lua51.lib;comctl32.lib;d2d1.lib;$(CoreLibraryDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'</AdditionalManifestDependencies>
</Link>
<PostBuildEvent>
Expand Down
1 change: 1 addition & 0 deletions curve_editor/curve_elastic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ namespace curve_editor {
[[nodiscard]] std::unique_ptr<GraphCurve> clone_graph() const noexcept override { return std::make_unique<ElasticCurve>(*this); }
[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return clone_graph(); }

[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Elastic; }
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_ELASTIC; }
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelEditModeElastic]; }

Expand Down
2 changes: 2 additions & 0 deletions curve_editor/curve_linear.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ namespace curve_editor {
[[nodiscard]] std::unique_ptr<GraphCurve> clone_graph() const noexcept override { return std::make_unique<LinearCurve>(*this); }
[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return clone_graph(); }

// TODO: CurveTypeに直す際にここも直す
[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Normal; }
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_LINEAR; }
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelCurveSegmentTypeLinear]; }

Expand Down
1 change: 1 addition & 0 deletions curve_editor/curve_normal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace curve_editor {
[[nodiscard]] std::unique_ptr<GraphCurve> clone_graph() const noexcept override { return std::make_unique<NormalCurve>(*this); }
[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return clone_graph(); }

[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Normal; }
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_NORMAL; }
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelEditModeNormal]; }

Expand Down
1 change: 1 addition & 0 deletions curve_editor/curve_script.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ namespace curve_editor {

[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return std::make_unique<ScriptCurve>(*this); }

[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Script; }
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_SCRIPT; }
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelEditModeScript]; }
[[nodiscard]] double curve_function(double, double start, double) const noexcept override;
Expand Down
1 change: 1 addition & 0 deletions curve_editor/curve_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace curve_editor {
[[nodiscard]] std::unique_ptr<GraphCurve> clone_graph() const noexcept override { return std::make_unique<ValueCurve>(*this); }
[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return clone_graph(); }

[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Value; }
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_VALUE; }
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelEditModeValue]; }

Expand Down
13 changes: 2 additions & 11 deletions curve_editor/drag_and_drop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,7 @@ namespace curve_editor {

auto curve = global::id_manager.get_curve<NumericGraphCurve>(curve_id_);
if (curve) {
// TODO: get_type()を実装し次第変更
if (curve->get_name() == global::CURVE_NAME_BEZIER) {
mode = EditMode::Bezier;
}
else if (curve->get_name() == global::CURVE_NAME_ELASTIC) {
mode = EditMode::Elastic;
}
else if (curve->get_name() == global::CURVE_NAME_BOUNCE) {
mode = EditMode::Bounce;
}
mode = curve->get_type();
param = curve->encode();
}
else {
Expand Down Expand Up @@ -165,7 +156,7 @@ namespace curve_editor {
buttons_[idx].unhighlight();
}
for (const auto idx : track_idcs) {
buttons_[idx].highlight(p_render_target_);
buttons_[idx].highlight(p_render_target_, curve_id_);
}
track_idcs_buffer_ = track_idcs;
}
Expand Down
2 changes: 1 addition & 1 deletion curve_editor/external/FastNoiseLite
2 changes: 1 addition & 1 deletion curve_editor/external/aviutl-mkaul
7 changes: 6 additions & 1 deletion curve_editor/message_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,12 @@ namespace curve_editor {
MenuItem{
global::string_table[StringId::MenuGraphPasteCurve],
MenuItem::Type::String,
(mode == EditMode::Normal and global::editor.editor_graph().is_copying_normal()) ? MenuItem::State::Null : MenuItem::State::Disabled,
(
mode == EditMode::Normal
and global::editor.editor_graph().is_copying_normal()
and curve
and curve->is_locked()
) ? MenuItem::State::Null : MenuItem::State::Disabled,
[curve_id, this]() {
auto curve = global::id_manager.get_curve<NormalCurve>(curve_id);
if (curve) {
Expand Down
8 changes: 6 additions & 2 deletions curve_editor/trackbar_button.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "config.hpp"
#include "curve.hpp"
#include "trackbar_button.hpp"


Expand Down Expand Up @@ -37,7 +38,7 @@ namespace curve_editor {
return false;
}

void TrackbarButton::highlight(ID2D1DCRenderTarget* p_render_target) const noexcept {
void TrackbarButton::highlight(ID2D1DCRenderTarget* p_render_target, uint32_t curve_id) const noexcept {
constexpr float ROUND_RADIUS = 1.5f;
constexpr mkaul::ColorF COLOR_NORMAL{ 45, 140, 235 };
constexpr mkaul::ColorF COLOR_IGNORE_MID_POINT = { 243, 123, 52 };
Expand All @@ -52,8 +53,11 @@ namespace curve_editor {
static ID2D1SolidColorBrush* p_brush = nullptr;
RECT rect_wnd;

auto curve = global::id_manager.get_curve<Curve>(curve_id);
if (!curve) return;

// ApplyModeに応じた色の設定
switch (global::config.get_apply_mode(global::config.get_edit_mode())) {
switch (global::config.get_apply_mode(curve->get_type())) {
case ApplyMode::Normal:
color = COLOR_NORMAL;
break;
Expand Down
2 changes: 1 addition & 1 deletion curve_editor/trackbar_button.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace curve_editor {
auto track_idx() const noexcept { return track_idx_; }
bool is_hovered() const noexcept;
bool is_visible() const noexcept { return ::IsWindowVisible(hwnd_); }
void highlight(ID2D1DCRenderTarget* p_render_target) const noexcept;
void highlight(ID2D1DCRenderTarget* p_render_target, uint32_t curve_id) const noexcept;
void unhighlight() const noexcept;
};
} // namespace curve_editor
2 changes: 1 addition & 1 deletion curve_editor/ui/src/button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import './scss/button.scss';
import './style/button.scss';


interface ToolbarButtonProps {
Expand Down
2 changes: 1 addition & 1 deletion curve_editor/ui/src/curve_thumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as d3 from 'd3';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCode } from '@fortawesome/free-solid-svg-icons';
import { editor } from './host_object';
import './scss/curve_thumbnail.scss';
import './style/curve_thumbnail.scss';


interface GraphThumbnailProps {
Expand Down
2 changes: 1 addition & 1 deletion curve_editor/ui/src/editor_graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ElasticControl from './control_elastic';
import BounceControl from './control_bounce';
import NormalControl from './control_normal';
import createControl from './control';
import './scss/editor_graph.scss';
import './style/editor_graph.scss';


class ImageObject {
Expand Down
2 changes: 1 addition & 1 deletion curve_editor/ui/src/editor_text.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import * as monaco from 'monaco-editor';
import { config, editor } from './host_object';
import './scss/editor_text.scss';
import './style/editor_text.scss';


interface TextEditorPanelProps {
Expand Down
2 changes: 1 addition & 1 deletion curve_editor/ui/src/panel_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { config, editor } from './host_object';
import { ToolbarButtonIcon, ToolbarButtonText } from './button';
import GraphEditorPanel from './editor_graph';
import TextEditorPanel from './editor_text';
import './scss/panel_editor.scss';
import './style/panel_editor.scss';


interface ParamButtonProps {
Expand Down
Loading

0 comments on commit c6f6341

Please sign in to comment.