diff --git a/src/imgui/window/animation_preview.cpp b/src/imgui/window/animation_preview.cpp index ee8e35a..01abe49 100644 --- a/src/imgui/window/animation_preview.cpp +++ b/src/imgui/window/animation_preview.cpp @@ -49,8 +49,10 @@ namespace anm2ed::imgui return directory; } - std::filesystem::path render_frame_filename(const std::filesystem::path& format, int index) + std::filesystem::path render_frame_filename(const std::filesystem::path& format, int index, int type) { + if (type != render::PNGS) return path::from_utf8(std::format("frame_{:06}.png", index)); + auto formatString = path::to_utf8(format); try { @@ -108,6 +110,26 @@ namespace anm2ed::imgui pixels[index + 2] = (uint8_t)glm::clamp((float)std::round((float)pixels[index + 2] / alphaUnit), 0.0f, 255.0f); } } + + int trigger_sound_id_get(Document& document, Element* animation, float time, int deterministicIndex = -1) + { + if (!animation) return -1; + auto triggers = animation_item_get(*animation, ItemType::TRIGGER); + if (!triggers || !triggers->isVisible) return -1; + + auto trigger = frame_generate(*triggers, time); + if (!trigger.isVisible || trigger.soundIds.empty()) return -1; + + size_t soundIndex{}; + if (trigger.soundIds.size() > 1) + soundIndex = deterministicIndex >= 0 ? (size_t)deterministicIndex % trigger.soundIds.size() + : (size_t)math::random_in_range(0.0f, (float)trigger.soundIds.size()); + soundIndex = std::min(soundIndex, trigger.soundIds.size() - 1); + + auto soundID = trigger.soundIds[soundIndex]; + return document.sound_get(soundID) ? soundID : -1; + } + bool render_audio_stream_generate(AudioStream& audioStream, std::map& sounds, const std::vector& frameSoundIDs, int fps) { @@ -164,7 +186,6 @@ namespace anm2ed::imgui auto& anm2 = document.anm2; auto& playback = document.playback; auto& frameTime = document.frameTime; - auto& end = manager.recordingEnd; auto& zoom = document.previewZoom; auto& overlayIndex = document.overlayIndex; auto& pan = document.previewPan; @@ -175,29 +196,12 @@ namespace anm2ed::imgui sound.stop(mixer); }; - auto trigger_sound_id_get = [&](Element* animation, float time) - { - if (!animation) return -1; - auto triggers = animation_item_get(*animation, ItemType::TRIGGER); - if (!triggers || !triggers->isVisible) return -1; - - auto trigger = frame_generate(*triggers, time); - if (!trigger.isVisible || trigger.soundIds.empty()) return -1; - - auto soundIndex = - trigger.soundIds.size() > 1 ? (size_t)math::random_in_range(0.0f, (float)trigger.soundIds.size()) : (size_t)0; - soundIndex = std::min(soundIndex, trigger.soundIds.size() - 1); - auto soundID = trigger.soundIds[soundIndex]; - return document.sound_get(soundID) ? soundID : -1; - }; - if (manager.isRecording) { auto& ffmpegPath = settings.renderFFmpegPath; auto& path = settings.renderPath; auto pathString = path::to_utf8(path); auto& type = settings.renderType; - auto renderFrameRate = std::max(settings.playbackTickRate, 1); auto isRenderPreviewOverridden = settings.renderIsUseAnimationBounds || settings.renderIsUseIsolatedAnimation; auto render_preview_restore = [&]() { @@ -212,10 +216,8 @@ namespace anm2ed::imgui isCheckerPanInitialized = false; }; - if (playback.time >= (float)end + 1.0f || playback.isFinished) + if (renderFrameIndex >= renderFrameCount) { - if (settings.timelineIsSound) audioStream.capture_end(mixer); - if (type == render::PNGS) { if (!renderTempFrames.empty()) @@ -310,8 +312,7 @@ namespace anm2ed::imgui else audioStream.stream.clear(); - if (animation_render(ffmpegPath, path, renderTempFrames, renderTempFrameDurations, audioStream, - (render::Type)type, renderFrameRate)) + if (animation_render(ffmpegPath, path, renderTempFrames, audioStream, (render::Type)type, renderFrameRate)) { toasts.push(std::vformat(localize.get(TOAST_EXPORT_RENDERED_ANIMATION), std::make_format_args(pathString))); logger.info(std::vformat(localize.get(TOAST_EXPORT_RENDERED_ANIMATION, anm2ed::ENGLISH), @@ -330,13 +331,11 @@ namespace anm2ed::imgui { renderTempDirectory.clear(); renderTempFrames.clear(); - renderTempFrameDurations.clear(); renderFrameSoundIDs.clear(); } else { render_temp_cleanup(renderTempDirectory, renderTempFrames); - renderTempFrameDurations.clear(); renderFrameSoundIDs.clear(); } @@ -345,49 +344,14 @@ namespace anm2ed::imgui playback.isPlaying = false; playback.isFinished = false; manager.isRecording = false; + manager.isRecordingStart = false; + renderFrameIndex = 0; + renderFrameCount = 0; manager.progressPopup.close(); } - else - { - if (settings.timelineIsSound && renderTempFrames.empty()) audioStream.capture_begin(mixer); - auto frameSoundID = -1; - if (settings.timelineIsSound && !document.sounds.empty()) - { - auto soundTime = (int)std::floor(playback.time); - auto animation = anm2.element_get(ElementType::ANIMATION, document.reference.animationIndex); - if (soundTime != renderFrameSoundTimePrev && animation) - frameSoundID = trigger_sound_id_get(animation, playback.time); - renderFrameSoundTimePrev = soundTime; - } - renderFrameSoundIDs.push_back(frameSoundID); - - bind(); - auto pixels = pixels_get(); - if (isRenderPreviewOverridden) pixels_unpremultiply_alpha(pixels); - auto frameIndex = (int)renderTempFrames.size(); - auto framePath = renderTempDirectory / render_frame_filename(settings.renderFormat, frameIndex); - if (Texture::write_pixels_png(framePath, size, pixels.data())) - { - renderTempFrames.push_back(framePath); - auto fallbackDuration = 1.0 / (double)renderFrameRate; - renderTempFrameDurations.push_back(fallbackDuration); - } - else - { - toasts.push( - std::vformat(localize.get(TOAST_EXPORT_RENDERED_ANIMATION_FAILED), std::make_format_args(pathString))); - logger.error(std::vformat(localize.get(TOAST_EXPORT_RENDERED_ANIMATION_FAILED, anm2ed::ENGLISH), - std::make_format_args(pathString))); - if (type != render::PNGS) render_temp_cleanup(renderTempDirectory, renderTempFrames); - renderTempFrameDurations.clear(); - renderFrameSoundIDs.clear(); - render_preview_restore(); - playback.isPlaying = false; - playback.isFinished = false; - manager.isRecording = false; - manager.progressPopup.close(); - } - } + stop_all_sounds(); + wasPlaybackPlaying = false; + return; } if (playback.isPlaying) @@ -405,7 +369,7 @@ namespace anm2ed::imgui { if (!manager.isRecording && !document.sounds.empty() && isSound) { - if (auto soundID = trigger_sound_id_get(animation, playback.time); soundID != -1) + if (auto soundID = trigger_sound_id_get(document, animation, playback.time); soundID != -1) if (auto sound = document.sound_get(soundID)) sound->play(false, mixer); } @@ -667,8 +631,13 @@ namespace anm2ed::imgui manager.isRecordingStart = false; manager.isRecording = true; + renderFrameIndex = 0; + auto info = element_first_get(anm2.root, ElementType::INFO); + renderAnimationFps = std::max(info ? info->fps : 30, 1); + renderFrameRate = render::fps_get(settings.renderFpsMode, renderAnimationFps, settings.playbackTickRate); + renderFrameCount = + render::frame_count_get(manager.recordingStart, manager.recordingEnd, renderAnimationFps, renderFrameRate); renderTempFrames.clear(); - renderTempFrameDurations.clear(); renderFrameSoundIDs.clear(); renderFrameSoundTimePrev = -1; if (settings.renderType == render::PNGS) @@ -703,6 +672,9 @@ namespace anm2ed::imgui logger.error(std::vformat(localize.get(TOAST_EXPORT_RENDERED_ANIMATION_FAILED, anm2ed::ENGLISH), std::make_format_args(pathString))); manager.isRecording = false; + manager.isRecordingStart = false; + renderFrameIndex = 0; + renderFrameCount = 0; manager.progressPopup.close(); playback.isPlaying = false; playback.isFinished = false; @@ -710,7 +682,18 @@ namespace anm2ed::imgui } playback.isPlaying = true; playback.timing_reset(); - playback.time = manager.recordingStart; + playback.time = + render::frame_time_get(manager.recordingStart, renderFrameIndex, renderAnimationFps, renderFrameRate); + document.frameTime = playback.time; + } + + if (manager.isRecording && renderFrameIndex < renderFrameCount) + { + playback.isPlaying = true; + playback.isFinished = false; + playback.time = + render::frame_time_get(manager.recordingStart, renderFrameIndex, renderAnimationFps, renderFrameRate); + document.frameTime = playback.time; } if (isSizeTrySet) @@ -1126,6 +1109,61 @@ namespace anm2ed::imgui settings.onionskinMode == (int)OnionskinMode::INDEX); } + if (manager.isRecording && renderFrameIndex < renderFrameCount) + { + auto renderType = settings.renderType; + auto isRenderPreviewOverridden = settings.renderIsUseAnimationBounds || settings.renderIsUseIsolatedAnimation; + auto render_capture_fail = [&]() + { + auto pathString = path::to_utf8(settings.renderPath); + toasts.push( + std::vformat(localize.get(TOAST_EXPORT_RENDERED_ANIMATION_FAILED), std::make_format_args(pathString))); + logger.error(std::vformat(localize.get(TOAST_EXPORT_RENDERED_ANIMATION_FAILED, anm2ed::ENGLISH), + std::make_format_args(pathString))); + if (renderType != render::PNGS) render_temp_cleanup(renderTempDirectory, renderTempFrames); + renderFrameSoundIDs.clear(); + if (isRenderPreviewOverridden) + { + settings = savedSettings; + pan = savedPan; + zoom = savedZoom; + overlayIndex = savedOverlayIndex; + isSizeTrySet = true; + hasPendingZoomPanAdjust = false; + isCheckerPanInitialized = false; + } + playback.isPlaying = false; + playback.isFinished = false; + manager.isRecording = false; + manager.isRecordingStart = false; + renderFrameIndex = 0; + renderFrameCount = 0; + manager.progressPopup.close(); + }; + + auto frameSoundID = -1; + if (settings.timelineIsSound && !document.sounds.empty()) + { + auto soundTime = (int)std::floor(frameTime); + if (soundTime != renderFrameSoundTimePrev && animation) + frameSoundID = trigger_sound_id_get(document, animation, frameTime, renderFrameIndex); + renderFrameSoundTimePrev = soundTime; + } + renderFrameSoundIDs.push_back(frameSoundID); + + auto pixels = pixels_get(); + if (isRenderPreviewOverridden) pixels_unpremultiply_alpha(pixels); + auto framePath = + renderTempDirectory / render_frame_filename(settings.renderFormat, renderFrameIndex, settings.renderType); + if (Texture::write_pixels_png(framePath, size, pixels.data())) + { + renderTempFrames.push_back(framePath); + ++renderFrameIndex; + } + else + render_capture_fail(); + } + unbind(); if (isTransparent) @@ -1494,9 +1532,7 @@ namespace anm2ed::imgui if (ImGui::BeginPopupModal(manager.progressPopup.label(), &manager.progressPopup.isOpen, ImGuiWindowFlags_NoResize)) { - auto& start = manager.recordingStart; - auto& end = manager.recordingEnd; - auto progress = (playback.time - start) / (end - start); + auto progress = renderFrameCount > 0 ? (float)renderFrameIndex / (float)renderFrameCount : 0.0f; ImGui::ProgressBar(progress); @@ -1505,31 +1541,37 @@ namespace anm2ed::imgui shortcut(manager.chords[SHORTCUT_CANCEL]); if (ImGui::Button(localize.get(BASIC_CANCEL), ImVec2(ImGui::GetContentRegionAvail().x, 0))) { - if (settings.renderType == render::PNGS) + auto renderType = settings.renderType; + auto isRenderPreviewOverridden = settings.renderIsUseAnimationBounds || settings.renderIsUseIsolatedAnimation; + if (renderType == render::PNGS) { renderTempDirectory.clear(); renderTempFrames.clear(); - renderTempFrameDurations.clear(); + renderFrameSoundIDs.clear(); } else { render_temp_cleanup(renderTempDirectory, renderTempFrames); - renderTempFrameDurations.clear(); + renderFrameSoundIDs.clear(); } - pan = savedPan; - zoom = savedZoom; - settings = savedSettings; - overlayIndex = savedOverlayIndex; - isSizeTrySet = true; - hasPendingZoomPanAdjust = false; - isCheckerPanInitialized = false; - - if (settings.timelineIsSound) audioStream.capture_end(mixer); + if (isRenderPreviewOverridden) + { + pan = savedPan; + zoom = savedZoom; + settings = savedSettings; + overlayIndex = savedOverlayIndex; + isSizeTrySet = true; + hasPendingZoomPanAdjust = false; + isCheckerPanInitialized = false; + } playback.isPlaying = false; playback.isFinished = false; manager.isRecording = false; + manager.isRecordingStart = false; + renderFrameIndex = 0; + renderFrameCount = 0; manager.progressPopup.close(); } diff --git a/src/imgui/window/animation_preview.hpp b/src/imgui/window/animation_preview.hpp index 8e17dd6..53825e3 100644 --- a/src/imgui/window/animation_preview.hpp +++ b/src/imgui/window/animation_preview.hpp @@ -33,8 +33,11 @@ namespace anm2ed::imgui glm::vec2 nullRectScaleAnchor{}; std::filesystem::path renderTempDirectory{}; std::vector renderTempFrames{}; - std::vector renderTempFrameDurations{}; std::vector renderFrameSoundIDs{}; + int renderFrameIndex{}; + int renderFrameCount{}; + int renderFrameRate{1}; + int renderAnimationFps{1}; int renderFrameSoundTimePrev{-1}; public: diff --git a/src/imgui/wizard/render_animation.cpp b/src/imgui/wizard/render_animation.cpp index 58fdf57..26b1352 100644 --- a/src/imgui/wizard/render_animation.cpp +++ b/src/imgui/wizard/render_animation.cpp @@ -8,6 +8,7 @@ #include "log.hpp" #include "path.hpp" #include "process.hpp" +#include "render.hpp" #include "toast.hpp" #include "util/imgui/input.hpp" #include "util/imgui/layout.hpp" @@ -77,6 +78,7 @@ namespace anm2ed::imgui::wizard auto& path = settings.renderPath; auto& format = settings.renderFormat; auto& scale = settings.renderScale; + auto& renderFpsMode = settings.renderFpsMode; auto& isUseAnimationBounds = settings.renderIsUseAnimationBounds; auto& isUseIsolatedAnimation = settings.renderIsUseIsolatedAnimation; auto& type = settings.renderType; @@ -91,7 +93,17 @@ namespace anm2ed::imgui::wizard auto frameMax = animationFrameNum - 1; start = std::clamp(start, 0, frameMax); end = std::clamp(end, start, frameMax); - auto renderFrameNum = isRange ? render::frame_count_get(start, end) : animationFrameNum; + auto info = element_first_get(document.anm2.root, ElementType::INFO); + auto animationFps = std::max(info ? info->fps : 30, 1); + if (renderFpsMode < render::FPS_ANIMATION || renderFpsMode >= render::FPS_COUNT) + renderFpsMode = render::FPS_ANIMATION; + auto renderFps = render::fps_get(renderFpsMode, animationFps, settings.playbackTickRate); + auto render_frame_count_get = [&]() + { + if (isRange) return render::frame_count_get(start, end, animationFps, renderFps); + return render::frame_count_get(0, frameMax, animationFps, renderFps); + }; + auto renderFrameNum = render_frame_count_get(); auto widgetSize = widget_size_with_row_get(2); @@ -196,7 +208,7 @@ namespace anm2ed::imgui::wizard ImGui::SetItemTooltip("%s", localize.get(TOOLTIP_END)); } ImGui::EndDisabled(); - renderFrameNum = isRange ? render::frame_count_get(start, end) : animationFrameNum; + renderFrameNum = render_frame_count_get(); if (type == render::SPRITESHEET) { @@ -224,6 +236,21 @@ namespace anm2ed::imgui::wizard ImGui::Separator(); + const char* renderFpsOptions[] = {localize.get(LABEL_ANIMATION_FPS), localize.get(LABEL_PLAYBACK_RATE)}; + ImGui::Combo(localize.get(LABEL_RENDER_FPS), &renderFpsMode, renderFpsOptions, IM_ARRAYSIZE(renderFpsOptions)); + ImGui::SetItemTooltip("%s", localize.get(TOOLTIP_RENDER_FPS)); + + renderFps = render::fps_get(renderFpsMode, animationFps, settings.playbackTickRate); + renderFrameNum = render_frame_count_get(); + if (type == render::SPRITESHEET) + { + auto layout = render::spritesheet_layout_get(rows, columns, renderFrameNum); + rows = layout.rows; + columns = layout.columns; + } + + ImGui::Separator(); + ImGui::Checkbox(localize.get(LABEL_SOUND), &settings.timelineIsSound); ImGui::SetItemTooltip("%s", localize.get(TOOLTIP_SOUND)); diff --git a/src/render.cpp b/src/render.cpp index 5b164b1..7cfb55f 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include @@ -22,25 +21,9 @@ using namespace anm2ed::util; namespace anm2ed { - namespace - { - std::string ffmpeg_concat_escape(const std::string& value) - { - std::string escaped{}; - escaped.reserve(value.size()); - for (auto character : value) - { - if (character == '\'') escaped += "'\\''"; - else - escaped += character; - } - return escaped; - } - } - bool animation_render(const std::filesystem::path& ffmpegPath, const std::filesystem::path& path, - const std::vector& framePaths, - const std::vector& frameDurations, AudioStream& audioStream, render::Type type, int fps) + const std::vector& framePaths, AudioStream& audioStream, + render::Type type, int fps) { if (framePaths.empty() || ffmpegPath.empty() || path.empty()) return false; fps = std::max(fps, 1); @@ -120,39 +103,17 @@ namespace anm2ed } } - auto framesListPath = temporaryDirectory / path::from_utf8(std::format( - "anm2ed_frames_{}_{}.txt", std::hash{}(pathString), SDL_GetTicks())) ; - std::ofstream framesListFile(framesListPath); - if (!framesListFile) - { - audio_remove(); - return false; - } - - auto defaultFrameDuration = 1.0 / (double)fps; - for (std::size_t index = 0; index < framePaths.size(); ++index) - { - auto framePath = framePaths[index]; - auto framePathString = path::to_utf8(framePath); - auto frameDuration = defaultFrameDuration; - if (index < frameDurations.size() && frameDurations[index] > 0.0) frameDuration = frameDurations[index]; - framesListFile << "file '" << ffmpeg_concat_escape(framePathString) << "'\n"; - framesListFile << "duration " << std::format("{:.9f}", frameDuration) << "\n"; - } - auto lastFramePathString = path::to_utf8(framePaths.back()); - framesListFile << "file '" << ffmpeg_concat_escape(lastFramePathString) << "'\n"; - framesListFile.close(); - - auto framesListPathString = path::to_utf8(framesListPath); - command = std::format("\"{0}\" -y -f concat -safe 0 -i \"{1}\"", ffmpegPathString, framesListPathString); + auto framePattern = temporaryDirectory / path::from_utf8("frame_%06d.png"); + auto framePatternString = path::to_utf8(framePattern); + command = std::format("\"{0}\" -y -framerate {1} -start_number 0 -i \"{2}\"", ffmpegPathString, fps, + framePatternString); if (!audioInputArguments.empty()) command += " " + audioInputArguments; - if (type != render::GIF) command += std::format(" -fps_mode cfr -r {}", fps); + command += std::format(" -fps_mode cfr -r {}", fps); switch (type) { case render::GIF: - command += " -fps_mode vfr"; command += " -lavfi \"split[s0][s1];[s0]palettegen=stats_mode=full:reserve_transparent=1[p];" "[s1][p]paletteuse=dither=floyd_steinberg:alpha_threshold=128\"" @@ -172,8 +133,6 @@ namespace anm2ed break; default: { - std::error_code ec; - std::filesystem::remove(framesListPath, ec); return false; } } @@ -192,8 +151,6 @@ namespace anm2ed if (!process.get()) { - std::error_code ec; - std::filesystem::remove(framesListPath, ec); audio_remove(); return false; } @@ -202,14 +159,10 @@ namespace anm2ed if (ffmpegExitCode != 0) { logger.error(std::format("FFmpeg exited with code {} while exporting {}", ffmpegExitCode, pathString)); - std::error_code ec; - std::filesystem::remove(framesListPath, ec); audio_remove(); return false; } - std::error_code ec; - std::filesystem::remove(framesListPath, ec); audio_remove(); return true; } diff --git a/src/render.hpp b/src/render.hpp index de7ce97..b6e52e4 100644 --- a/src/render.hpp +++ b/src/render.hpp @@ -23,6 +23,13 @@ namespace anm2ed::render COUNT }; + enum FpsMode + { + FPS_ANIMATION, + FPS_PLAYBACK_RATE, + FPS_COUNT + }; + constexpr const char* STRINGS[] = { #define X(symbol, string, extension) string, RENDER_LIST @@ -43,6 +50,33 @@ namespace anm2ed::render inline int frame_count_get(int start, int end) { return std::max(end - start + 1, 1); } + inline int frame_count_get(int start, int end, int animationFps, int renderFps) + { + animationFps = std::max(animationFps, 1); + renderFps = std::max(renderFps, 1); + auto duration = (double)frame_count_get(start, end) / (double)animationFps; + return std::max((int)std::ceil(duration * (double)renderFps), 1); + } + + inline float frame_time_get(int start, int frameIndex, int animationFps, int renderFps) + { + animationFps = std::max(animationFps, 1); + renderFps = std::max(renderFps, 1); + return (float)start + ((float)frameIndex * ((float)animationFps / (float)renderFps)); + } + + inline int fps_get(int mode, int animationFps, int playbackRate) + { + switch (mode) + { + case FPS_PLAYBACK_RATE: + return std::max(playbackRate, 1); + case FPS_ANIMATION: + default: + return std::max(animationFps, 1); + } + } + inline SpritesheetLayout spritesheet_layout_get(int rows, int columns, int frameCount) { frameCount = std::max(frameCount, 1); @@ -74,6 +108,5 @@ namespace anm2ed { std::filesystem::path ffmpeg_log_path(); bool animation_render(const std::filesystem::path&, const std::filesystem::path&, - const std::vector&, const std::vector&, AudioStream&, - render::Type, int); + const std::vector&, AudioStream&, render::Type, int); } diff --git a/src/resource/strings.hpp b/src/resource/strings.hpp index 901d87e..cc61f44 100644 --- a/src/resource/strings.hpp +++ b/src/resource/strings.hpp @@ -304,6 +304,7 @@ namespace anm2ed X(LABEL_FORMAT, "Format", "Formato", "Формат", "格式", "파일 포맷") \ X(LABEL_FRAGMENT, "Fragment", "Fragment", "Fragment", "Fragment", "Fragment") \ X(LABEL_FPS, "FPS", "FPS", "FPS", "FPS", "FPS") \ + X(LABEL_ANIMATION_FPS, "Animation FPS", "Animation FPS", "Animation FPS", "Animation FPS", "Animation FPS") \ X(LABEL_FRAME_PROPERTIES_WINDOW, "Frame Properties###Frame Properties", "Propiedades de Frame###Frame Properties", "Свойства кадра###Frame Properties", "帧属性###Frame Properties", "프레임 속성###Frame Properties") \ X(LABEL_GENERATE, "Generate", "Generar", "Сгенерировать", "生成", "생성") \ X(LABEL_GENERATE_COLUMNS, "Columns", "Columnas", "Колонны", "列", "열") \ @@ -375,9 +376,11 @@ namespace anm2ed X(LABEL_PLAY, "Play", "Reproducir", "Возпроизвести", "播放", "재생") \ X(LABEL_PLAYBACK_ALWAYS_LOOP, "Always Loop", "Siempre Loopear", "Всегда воспроизводить циклично", "持续循环", "항상 반복") \ X(LABEL_PLAYBACK_MENU, "Playback", "Reproduccion", "Возпроизведение", "回放", "재생") \ + X(LABEL_PLAYBACK_RATE, "Playback Rate", "Playback Rate", "Playback Rate", "Playback Rate", "Playback Rate") \ X(LABEL_PREPEND_FRAMES, "Prepend Frames", "Anteponer Frames", "Добавить кадры", "在前面插入帧", "뒷프레임에 추가") \ X(LABEL_RECT, "Rect", "Rect", "Прямоугольник", "矩形", "사각형") \ X(LABEL_RENDER, "Render", "Renderizar", "Рендер", "渲染", "렌더링") \ + X(LABEL_RENDER_FPS, "Render FPS", "Render FPS", "Render FPS", "Render FPS", "Render FPS") \ X(LABEL_REPEAT_DELAY, "Repeat Delay (seconds)", "Repetir Delay (segundos)", "Задержка повторения (секунды)", "键盘按键重复延迟 (秒)", "반복 입력 지연 시간 (초)") \ X(LABEL_REPEAT_RATE, "Repeat Rate (seconds)", "Repetir Tasa (segundos)", "Скорость повторения (секунды)", "键盘按键重复速率 (秒)", "반복 입력 속도 (초)") \ X(LABEL_REPLACE_FRAMES, "Replace Frames", "Reemplazar Frames", "Заменить кадры", "替换帧", "프레임 교체") \ @@ -684,6 +687,7 @@ namespace anm2ed X(TOOLTIP_PREVIEW_TRANSPARENT, "Toggle the animation preview background being transparent.", "Alterna la transparencia del fondo de la vista previa de animacion.", "Переключить прозрачность фона предпросмотра анимации.", "切换动画预览背景是否透明.", "애니메이션 미리보기 배경을 투명하게 전환합니다.") \ X(TOOLTIP_USE_ANIMATION_BOUNDS, "Render using the animation's bounds instead of the preview viewport.", "Render using the animation's bounds instead of the preview viewport.", "Render using the animation's bounds instead of the preview viewport.", "Render using the animation's bounds instead of the preview viewport.", "Render using the animation's bounds instead of the preview viewport.") \ X(TOOLTIP_USE_ISOLATED_ANIMATION, "Render only animation layers with a transparent background and preview helpers hidden.", "Render only animation layers with a transparent background and preview helpers hidden.", "Render only animation layers with a transparent background and preview helpers hidden.", "Render only animation layers with a transparent background and preview helpers hidden.", "Render only animation layers with a transparent background and preview helpers hidden.") \ + X(TOOLTIP_RENDER_FPS, "Set the exported animation frame rate.", "Set the exported animation frame rate.", "Set the exported animation frame rate.", "Set the exported animation frame rate.", "Set the exported animation frame rate.") \ X(TOOLTIP_RELOAD_OVERLAYS, "Reloads the selected overlays.", "Reloads the selected overlays.", "Reloads the selected overlays.", "Reloads the selected overlays.", "Reloads the selected overlays.") \ X(TOOLTIP_RELOAD_SPRITESHEETS, "Reloads the selected spritesheets.", "Recarga la spritesheet seleccionada.", "Перезагружает выбранные спрайт-листы.", "重新加载所选图集.", "선택한 스프라이트 시트를 다시 불러옵니다.") \ X(TOOLTIP_RELOAD_SOUNDS, "Reloads the selected sounds.", "Recarga los sonidos seleccionados.", "Перезагружает выбранные звуки.", "重新加载所选声音.", "선택한 사운드를 다시 불러옵니다.") \ diff --git a/src/settings.hpp b/src/settings.hpp index 1fc1f4d..f322ce2 100644 --- a/src/settings.hpp +++ b/src/settings.hpp @@ -202,6 +202,7 @@ namespace anm2ed X(RENDER_IS_USE_ANIMATION_BOUNDS, renderIsUseAnimationBounds, STRING_UNDEFINED, BOOL, true) \ X(RENDER_IS_USE_ISOLATED_ANIMATION, renderIsUseIsolatedAnimation, STRING_UNDEFINED, BOOL, false) \ X(RENDER_SCALE, renderScale, STRING_UNDEFINED, FLOAT, 1.0f) \ + X(RENDER_FPS_MODE, renderFpsMode, STRING_UNDEFINED, INT, render::FPS_ANIMATION) \ X(RENDER_FFMPEG_PATH, renderFFmpegPath, STRING_UNDEFINED, PATH, FFMPEG_PATH_DEFAULT) #define SETTINGS_SHORTCUTS \ diff --git a/workshop/metadata.xml b/workshop/metadata.xml index 8b5c3c9..fbff99e 100644 --- a/workshop/metadata.xml +++ b/workshop/metadata.xml @@ -51,6 +51,6 @@ Alternatively, if you have subscribed to the mod, you can find the latest releas [h3]Happy animating![/h3] [img]https://files.catbox.moe/4auc1c.gif[/img] - 2.26 + 2.27 Public