diff --git a/_locales/de_DE.json b/_locales/de_DE.json index d65be9c..dd7c524 100644 --- a/_locales/de_DE.json +++ b/_locales/de_DE.json @@ -40,6 +40,7 @@ "animatedPickHint": "Alle Ergebnisse behalten eine 400×400-Arbeitsfläche; das Label zeigt Detailauflösung@fps/Qualität/Dateigröße. Wählen Sie eines und drücken Sie Bestätigen, um es zu übernehmen, oder brechen Sie ab, um alle zu verwerfen.", "animatedPickConfirm": "Bestätigen", "animatedPriority": "Priorität", + "animatedCanvas": "Ausgabegröße", "priorityResolution": "Auflösung zuerst", "priorityFramerate": "Bildrate zuerst", "priorityBalanced": "Auflösung und Bildrate abwechselnd", diff --git a/_locales/en.json b/_locales/en.json index 4d88e6b..d57c9f2 100644 --- a/_locales/en.json +++ b/_locales/en.json @@ -40,6 +40,7 @@ "animatedPickHint": "Every result keeps a 400×400 canvas; the label shows detail resolution@fps/quality/file size. Select one and press Confirm to replace the thumbnail, or cancel to discard them all.", "animatedPickConfirm": "Confirm", "animatedPriority": "Priority", + "animatedCanvas": "Canvas size", "priorityResolution": "Resolution first", "priorityFramerate": "Frame rate first", "priorityBalanced": "Alternate resolution and frame rate", diff --git a/_locales/es_ES.json b/_locales/es_ES.json index 4b40248..ff8234a 100644 --- a/_locales/es_ES.json +++ b/_locales/es_ES.json @@ -40,6 +40,7 @@ "animatedPickHint": "Todos los resultados mantienen un lienzo de 400×400; la etiqueta indica la resolución de detalle@fps/calidad/tamaño de archivo. Elige uno y pulsa Confirmar para aplicarlo, o cancela para descartarlos todos.", "animatedPickConfirm": "Confirmar", "animatedPriority": "Prioridad", + "animatedCanvas": "Tamaño del lienzo", "priorityResolution": "Resolución primero", "priorityFramerate": "Frecuencia primero", "priorityBalanced": "Alternar resolución y frecuencia", diff --git a/_locales/ja_JP.json b/_locales/ja_JP.json index 582b6e9..6bae31b 100644 --- a/_locales/ja_JP.json +++ b/_locales/ja_JP.json @@ -40,6 +40,7 @@ "animatedPickHint": "すべての結果は 400×400 のキャンバスです。ラベルは実際のディテール解像度@fps/品質/ファイルサイズを示します。1つ選んで確認を押すと置き換え、キャンセルですべて破棄します。", "animatedPickConfirm": "確認", "animatedPriority": "優先度", + "animatedCanvas": "出力サイズ", "priorityResolution": "解像度優先", "priorityFramerate": "フレームレート優先", "priorityBalanced": "解像度とフレームレートを交互に", diff --git a/_locales/ko_KR.json b/_locales/ko_KR.json index 1bd188d..98872bc 100644 --- a/_locales/ko_KR.json +++ b/_locales/ko_KR.json @@ -40,6 +40,7 @@ "animatedPickHint": "모든 결과의 캔버스는 400×400이며, 라벨은 실제 디테일 해상도@fps/품질/파일 크기입니다. 하나를 선택하고 확인을 누르면 적용되고, 취소하면 모두 버려집니다.", "animatedPickConfirm": "확인", "animatedPriority": "우선 순위", + "animatedCanvas": "출력 크기", "priorityResolution": "해상도 우선", "priorityFramerate": "프레임률 우선", "priorityBalanced": "해상도와 프레임률 교차", diff --git a/_locales/ru_RU.json b/_locales/ru_RU.json index 45c68dd..ff73f7b 100644 --- a/_locales/ru_RU.json +++ b/_locales/ru_RU.json @@ -40,6 +40,7 @@ "animatedPickHint": "У всех результатов холст 400×400; в подписи указаны реальное разрешение детализации@fps/качество/размер файла. Выберите результат и нажмите «Подтвердить», чтобы применить его, или отмените, чтобы всё отбросить.", "animatedPickConfirm": "Подтвердить", "animatedPriority": "Приоритет", + "animatedCanvas": "Размер холста", "priorityResolution": "Сначала разрешение", "priorityFramerate": "Сначала частота кадров", "priorityBalanced": "Чередовать разрешение и частоту", diff --git a/_locales/zh_CN.json b/_locales/zh_CN.json index 842f2b9..45a2284 100644 --- a/_locales/zh_CN.json +++ b/_locales/zh_CN.json @@ -40,6 +40,7 @@ "animatedPickHint": "所有结果画布都是 400×400,标签为实际细节分辨率@帧率/质量/文件大小。点选一个结果后按确认替换缩略图,取消则全部放弃。", "animatedPickConfirm": "确认", "animatedPriority": "优先级别", + "animatedCanvas": "输出尺寸", "priorityResolution": "分辨率优先", "priorityFramerate": "帧率优先", "priorityBalanced": "分辨率和帧率交替进行", diff --git a/_locales/zh_TW.json b/_locales/zh_TW.json index a474add..ea2ef70 100644 --- a/_locales/zh_TW.json +++ b/_locales/zh_TW.json @@ -40,6 +40,7 @@ "animatedPickHint": "所有結果畫布都是 400×400,標籤為實際細節解析度@影格率/品質/檔案大小。點選一個結果後按確認替換縮圖,取消則全部放棄。", "animatedPickConfirm": "確認", "animatedPriority": "優先級別", + "animatedCanvas": "輸出尺寸", "priorityResolution": "解析度優先", "priorityFramerate": "影格率優先", "priorityBalanced": "解析度與影格率交替進行", diff --git a/js/animated-profiles.js b/js/animated-profiles.js index f402aa6..1663494 100644 --- a/js/animated-profiles.js +++ b/js/animated-profiles.js @@ -32,19 +32,35 @@ const ANIMATED_PRIORITIES = { const DEFAULT_PRIORITY = 'resolution'; +/** + * 可选的输出画布边长(正方形),界面上的下拉就是这两项。 + * + * Eagle 缩略图网格里每格实际只显示 100–240px 左右,200 与 400 在这个尺寸下几乎看不出差别, + * 但像素数只有四分之一,体积能降约 4 倍。配置里写的细节分辨率超过所选边长时会被压下来, + * 所以同一份档位表在两种尺寸下都能用。 + */ +const ANIMATED_OUTPUT_SIZES = [200, 400]; +const DEFAULT_OUTPUT_SIZE = 200; + // 相邻锚点之间插多少个采样点。数值越大,越容易压在目标体积附近,但粗估阶段耗时略增。 const PATH_STEPS_PER_SEGMENT = 6; -function animatedProfiles(priority) { +function animatedProfiles(priority, outputSize) { + const limit = outputSize || DEFAULT_OUTPUT_SIZE; const plan = ANIMATED_PRIORITIES[priority] || ANIMATED_PRIORITIES[DEFAULT_PRIORITY]; - return plan.map(([size, fps, quality]) => ({ size, fps, quality })); + return plan.map(([size, fps, quality]) => ({ + size: Math.min(size, limit), + fps, + quality, + })); } /** * 把锚点路径插值成更密的采样路径,供按目标体积二分定位使用。 * 分辨率取整、帧率至少 1、质量保留两位小数;首尾锚点原样保留。 */ -function expandAnimatedPath(priority) { +function expandAnimatedPath(priority, outputSize) { + const limit = outputSize || DEFAULT_OUTPUT_SIZE; const anchors = ANIMATED_PRIORITIES[priority] || ANIMATED_PRIORITIES[DEFAULT_PRIORITY]; const lerp = (from, to, t) => from + (to - from) * t; const path = []; @@ -54,15 +70,23 @@ function expandAnimatedPath(priority) { for (let step = 0; step < PATH_STEPS_PER_SEGMENT; step++) { const t = step / PATH_STEPS_PER_SEGMENT; path.push({ - size: Math.round(lerp(fromSize, toSize, t)), + size: Math.min(limit, Math.round(lerp(fromSize, toSize, t))), fps: Math.max(1, Math.round(lerp(fromFps, toFps, t))), quality: Math.round(lerp(fromQuality, toQuality, t) * 100) / 100, }); } } const [size, fps, quality] = anchors[anchors.length - 1]; - path.push({ size, fps, quality }); + path.push({ size: Math.min(size, limit), fps, quality }); return path; } -module.exports = { ANIMATED_PRIORITIES, DEFAULT_PRIORITY, PATH_STEPS_PER_SEGMENT, animatedProfiles, expandAnimatedPath }; +module.exports = { + ANIMATED_PRIORITIES, + DEFAULT_PRIORITY, + ANIMATED_OUTPUT_SIZES, + DEFAULT_OUTPUT_SIZE, + PATH_STEPS_PER_SEGMENT, + animatedProfiles, + expandAnimatedPath, +}; diff --git a/release/UNIVERSAL_SpineViewer/_locales/de_DE.json b/release/UNIVERSAL_SpineViewer/_locales/de_DE.json index d65be9c..dd7c524 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/de_DE.json +++ b/release/UNIVERSAL_SpineViewer/_locales/de_DE.json @@ -40,6 +40,7 @@ "animatedPickHint": "Alle Ergebnisse behalten eine 400×400-Arbeitsfläche; das Label zeigt Detailauflösung@fps/Qualität/Dateigröße. Wählen Sie eines und drücken Sie Bestätigen, um es zu übernehmen, oder brechen Sie ab, um alle zu verwerfen.", "animatedPickConfirm": "Bestätigen", "animatedPriority": "Priorität", + "animatedCanvas": "Ausgabegröße", "priorityResolution": "Auflösung zuerst", "priorityFramerate": "Bildrate zuerst", "priorityBalanced": "Auflösung und Bildrate abwechselnd", diff --git a/release/UNIVERSAL_SpineViewer/_locales/en.json b/release/UNIVERSAL_SpineViewer/_locales/en.json index 4d88e6b..d57c9f2 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/en.json +++ b/release/UNIVERSAL_SpineViewer/_locales/en.json @@ -40,6 +40,7 @@ "animatedPickHint": "Every result keeps a 400×400 canvas; the label shows detail resolution@fps/quality/file size. Select one and press Confirm to replace the thumbnail, or cancel to discard them all.", "animatedPickConfirm": "Confirm", "animatedPriority": "Priority", + "animatedCanvas": "Canvas size", "priorityResolution": "Resolution first", "priorityFramerate": "Frame rate first", "priorityBalanced": "Alternate resolution and frame rate", diff --git a/release/UNIVERSAL_SpineViewer/_locales/es_ES.json b/release/UNIVERSAL_SpineViewer/_locales/es_ES.json index 4b40248..ff8234a 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/es_ES.json +++ b/release/UNIVERSAL_SpineViewer/_locales/es_ES.json @@ -40,6 +40,7 @@ "animatedPickHint": "Todos los resultados mantienen un lienzo de 400×400; la etiqueta indica la resolución de detalle@fps/calidad/tamaño de archivo. Elige uno y pulsa Confirmar para aplicarlo, o cancela para descartarlos todos.", "animatedPickConfirm": "Confirmar", "animatedPriority": "Prioridad", + "animatedCanvas": "Tamaño del lienzo", "priorityResolution": "Resolución primero", "priorityFramerate": "Frecuencia primero", "priorityBalanced": "Alternar resolución y frecuencia", diff --git a/release/UNIVERSAL_SpineViewer/_locales/ja_JP.json b/release/UNIVERSAL_SpineViewer/_locales/ja_JP.json index 582b6e9..6bae31b 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/ja_JP.json +++ b/release/UNIVERSAL_SpineViewer/_locales/ja_JP.json @@ -40,6 +40,7 @@ "animatedPickHint": "すべての結果は 400×400 のキャンバスです。ラベルは実際のディテール解像度@fps/品質/ファイルサイズを示します。1つ選んで確認を押すと置き換え、キャンセルですべて破棄します。", "animatedPickConfirm": "確認", "animatedPriority": "優先度", + "animatedCanvas": "出力サイズ", "priorityResolution": "解像度優先", "priorityFramerate": "フレームレート優先", "priorityBalanced": "解像度とフレームレートを交互に", diff --git a/release/UNIVERSAL_SpineViewer/_locales/ko_KR.json b/release/UNIVERSAL_SpineViewer/_locales/ko_KR.json index 1bd188d..98872bc 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/ko_KR.json +++ b/release/UNIVERSAL_SpineViewer/_locales/ko_KR.json @@ -40,6 +40,7 @@ "animatedPickHint": "모든 결과의 캔버스는 400×400이며, 라벨은 실제 디테일 해상도@fps/품질/파일 크기입니다. 하나를 선택하고 확인을 누르면 적용되고, 취소하면 모두 버려집니다.", "animatedPickConfirm": "확인", "animatedPriority": "우선 순위", + "animatedCanvas": "출력 크기", "priorityResolution": "해상도 우선", "priorityFramerate": "프레임률 우선", "priorityBalanced": "해상도와 프레임률 교차", diff --git a/release/UNIVERSAL_SpineViewer/_locales/ru_RU.json b/release/UNIVERSAL_SpineViewer/_locales/ru_RU.json index 45c68dd..ff73f7b 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/ru_RU.json +++ b/release/UNIVERSAL_SpineViewer/_locales/ru_RU.json @@ -40,6 +40,7 @@ "animatedPickHint": "У всех результатов холст 400×400; в подписи указаны реальное разрешение детализации@fps/качество/размер файла. Выберите результат и нажмите «Подтвердить», чтобы применить его, или отмените, чтобы всё отбросить.", "animatedPickConfirm": "Подтвердить", "animatedPriority": "Приоритет", + "animatedCanvas": "Размер холста", "priorityResolution": "Сначала разрешение", "priorityFramerate": "Сначала частота кадров", "priorityBalanced": "Чередовать разрешение и частоту", diff --git a/release/UNIVERSAL_SpineViewer/_locales/zh_CN.json b/release/UNIVERSAL_SpineViewer/_locales/zh_CN.json index 842f2b9..45a2284 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/zh_CN.json +++ b/release/UNIVERSAL_SpineViewer/_locales/zh_CN.json @@ -40,6 +40,7 @@ "animatedPickHint": "所有结果画布都是 400×400,标签为实际细节分辨率@帧率/质量/文件大小。点选一个结果后按确认替换缩略图,取消则全部放弃。", "animatedPickConfirm": "确认", "animatedPriority": "优先级别", + "animatedCanvas": "输出尺寸", "priorityResolution": "分辨率优先", "priorityFramerate": "帧率优先", "priorityBalanced": "分辨率和帧率交替进行", diff --git a/release/UNIVERSAL_SpineViewer/_locales/zh_TW.json b/release/UNIVERSAL_SpineViewer/_locales/zh_TW.json index a474add..ea2ef70 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/zh_TW.json +++ b/release/UNIVERSAL_SpineViewer/_locales/zh_TW.json @@ -40,6 +40,7 @@ "animatedPickHint": "所有結果畫布都是 400×400,標籤為實際細節解析度@影格率/品質/檔案大小。點選一個結果後按確認替換縮圖,取消則全部放棄。", "animatedPickConfirm": "確認", "animatedPriority": "優先級別", + "animatedCanvas": "輸出尺寸", "priorityResolution": "解析度優先", "priorityFramerate": "影格率優先", "priorityBalanced": "解析度與影格率交替進行", diff --git a/release/UNIVERSAL_SpineViewer/js/animated-profiles.js b/release/UNIVERSAL_SpineViewer/js/animated-profiles.js index f402aa6..1663494 100644 --- a/release/UNIVERSAL_SpineViewer/js/animated-profiles.js +++ b/release/UNIVERSAL_SpineViewer/js/animated-profiles.js @@ -32,19 +32,35 @@ const ANIMATED_PRIORITIES = { const DEFAULT_PRIORITY = 'resolution'; +/** + * 可选的输出画布边长(正方形),界面上的下拉就是这两项。 + * + * Eagle 缩略图网格里每格实际只显示 100–240px 左右,200 与 400 在这个尺寸下几乎看不出差别, + * 但像素数只有四分之一,体积能降约 4 倍。配置里写的细节分辨率超过所选边长时会被压下来, + * 所以同一份档位表在两种尺寸下都能用。 + */ +const ANIMATED_OUTPUT_SIZES = [200, 400]; +const DEFAULT_OUTPUT_SIZE = 200; + // 相邻锚点之间插多少个采样点。数值越大,越容易压在目标体积附近,但粗估阶段耗时略增。 const PATH_STEPS_PER_SEGMENT = 6; -function animatedProfiles(priority) { +function animatedProfiles(priority, outputSize) { + const limit = outputSize || DEFAULT_OUTPUT_SIZE; const plan = ANIMATED_PRIORITIES[priority] || ANIMATED_PRIORITIES[DEFAULT_PRIORITY]; - return plan.map(([size, fps, quality]) => ({ size, fps, quality })); + return plan.map(([size, fps, quality]) => ({ + size: Math.min(size, limit), + fps, + quality, + })); } /** * 把锚点路径插值成更密的采样路径,供按目标体积二分定位使用。 * 分辨率取整、帧率至少 1、质量保留两位小数;首尾锚点原样保留。 */ -function expandAnimatedPath(priority) { +function expandAnimatedPath(priority, outputSize) { + const limit = outputSize || DEFAULT_OUTPUT_SIZE; const anchors = ANIMATED_PRIORITIES[priority] || ANIMATED_PRIORITIES[DEFAULT_PRIORITY]; const lerp = (from, to, t) => from + (to - from) * t; const path = []; @@ -54,15 +70,23 @@ function expandAnimatedPath(priority) { for (let step = 0; step < PATH_STEPS_PER_SEGMENT; step++) { const t = step / PATH_STEPS_PER_SEGMENT; path.push({ - size: Math.round(lerp(fromSize, toSize, t)), + size: Math.min(limit, Math.round(lerp(fromSize, toSize, t))), fps: Math.max(1, Math.round(lerp(fromFps, toFps, t))), quality: Math.round(lerp(fromQuality, toQuality, t) * 100) / 100, }); } } const [size, fps, quality] = anchors[anchors.length - 1]; - path.push({ size, fps, quality }); + path.push({ size: Math.min(size, limit), fps, quality }); return path; } -module.exports = { ANIMATED_PRIORITIES, DEFAULT_PRIORITY, PATH_STEPS_PER_SEGMENT, animatedProfiles, expandAnimatedPath }; +module.exports = { + ANIMATED_PRIORITIES, + DEFAULT_PRIORITY, + ANIMATED_OUTPUT_SIZES, + DEFAULT_OUTPUT_SIZE, + PATH_STEPS_PER_SEGMENT, + animatedProfiles, + expandAnimatedPath, +}; diff --git a/release/UNIVERSAL_SpineViewer/viewer/spine.html b/release/UNIVERSAL_SpineViewer/viewer/spine.html index 22cf237..69e7ec5 100644 --- a/release/UNIVERSAL_SpineViewer/viewer/spine.html +++ b/release/UNIVERSAL_SpineViewer/viewer/spine.html @@ -105,6 +105,12 @@ + +