diff options
Diffstat (limited to 'public/bluebey-studio/src/panel.js')
| -rw-r--r-- | public/bluebey-studio/src/panel.js | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/public/bluebey-studio/src/panel.js b/public/bluebey-studio/src/panel.js index ae45e48..db784cb 100644 --- a/public/bluebey-studio/src/panel.js +++ b/public/bluebey-studio/src/panel.js @@ -134,7 +134,7 @@ export function buildPanel(app, root) { root.replaceChildren(); // --- randomising ---------------------------------------------------------- - // Shared by 「顔をランダムに」 (face tab) and 「すべてをランダムに」 (the top bar). + // The patch behind 「顔をランダムに」 in the face tab. const rnd = (min, max) => min + (max - min) * Math.random(); const pick = (list) => list[Math.floor(Math.random() * list.length)]; const randomEye = () => ({ @@ -181,22 +181,9 @@ export function buildPanel(app, root) { }; }; const randomFace = () => replace({ face: randomFacePatch() }, 'face'); - const randomAll = () => { - // 後ろを向く(180°)や大きく傾くポーズは避ける。見える顔が変わる範囲だけ。 - const poses = POSE_PRESETS.filter((preset) => { - const m = preset.pose?.bones?.master ?? [0, 0, 0]; - return Math.abs(m[0]) <= 45 && Math.abs(m[1]) <= 40 && Math.abs(m[2]) <= 40; - }); - const pose = pick(poses.length ? poses : POSE_PRESETS); - app.actions.applyPosePreset?.(pose.id); - // The viewer style (実写/フラット/線画), the body colours, and 左右反転 are - // deliberately left alone. - replace({ face: randomFacePatch() }, 'face'); - sync(); - }; // A small action bar above the tabs: undo/redo apply to every tab, so they must - // not be buried inside one of them. 「すべてをランダムに」 sits here too. + // not be buried inside one of them. const topBar = h('div', { class: 'panel-topbar' }); const iconButton = (label, d, onClick) => { const button = h('button', { type: 'button', class: 'icon-btn', title: label, 'aria-label': label }); @@ -207,7 +194,6 @@ export function buildPanel(app, root) { topBar.append( iconButton('元に戻す', 'M4.8 11.5h9.7a5.2 5.2 0 0 1 0 10.4h-3.6M4.8 11.5 9.6 6.7M4.8 11.5 9.6 16.3', () => app.actions.undo()), iconButton('やり直す', 'M19.2 11.5h-9.7a5.2 5.2 0 0 0 0 10.4h3.6M19.2 11.5 14.4 6.7M19.2 11.5 14.4 16.3', () => app.actions.redo()), - iconButton('すべてをランダムに', 'M7.2 9.4a2.6 2.6 0 1 1 3.9 2.3c-.9.5-1.3 1.2-1.3 2.1v.4M9.2 17.4h.01M16.8 6.8v6.1M16.8 15.6h.01', () => randomAll()), ); root.append(topBar); |
