Turn one illustration into an animated 2D mesh avatar with a coding agent and a local editor
Show which OBS source to use for each stream background
shinshin865f7b652020bf
diff --git a/e2e/live-streaming.spec.ts b/e2e/live-streaming.spec.tsindex b76aaf0..f1536c8 100644--- a/e2e/live-streaming.spec.ts+++ b/e2e/live-streaming.spec.ts@@ -114,7 +114,10 @@ test('live controls calibrate, mirror, compose mic mouth, localize and relay witawait expect.poll(async () => Math.abs((await nextParams()).angleX)).toBeLessThan(0.5);await page.getByRole('checkbox', { name: 'Show camera preview' }).uncheck();await expect(page.locator('video')).toHaveClass(/camera-hidden/);+ await expect(page.getByTestId('background-hint')).toContainText('Browser Source');+ await expect(page.getByTestId('background-hint')).toContainText('Window Capture does not keep transparency');await page.getByLabel('Background', { exact: true }).selectOption('#00ff00');+ await expect(page.getByTestId('background-hint')).toContainText('Chroma Key');expect(await page.getByRole('textbox', { name: 'Copy OBS URL' }).inputValue()).toContain('bg=%2300ff00');await page.getByRole('button', { name: '日本語', exact: true }).click();await expect(page.getByRole('button', { name: '正面の姿勢を登録', exact: true })).toBeVisible();diff --git a/src/live/LiveApp.tsx b/src/live/LiveApp.tsxindex 4c68dfe..6fd5727 100644--- a/src/live/LiveApp.tsx+++ b/src/live/LiveApp.tsx@@ -154,7 +154,8 @@ export function LiveApp() {</section><section><h2>{t.background}</h2><select aria-label={t.background} value={settings.background} onChange={event => setSettings(current => ({ ...current, background: backgroundColor(event.target.value) }))}><option value="transparent">{t.transparent}</option><option value="#00ff00">{t.green}</option><option value="#0000ff">{t.blue}</option>{!['transparent', '#00ff00', '#0000ff'].includes(settings.background) && <option value={settings.background}>{t.custom}</option>}- </select><label>{t.custom}<input type="color" value={settings.background === 'transparent' ? '#ffffff' : settings.background} onChange={event => setSettings(current => ({ ...current, background: event.target.value }))} /></label>+ </select><small className="background-hint" data-testid="background-hint">{settings.background === 'transparent' ? t.bgHintTransparent : ['#00ff00', '#0000ff'].includes(settings.background) ? t.bgHintChroma : t.bgHintCustom}</small>+ <label>{t.custom}<input type="color" value={settings.background === 'transparent' ? '#ffffff' : settings.background} onChange={event => setSettings(current => ({ ...current, background: event.target.value }))} /></label><label>{t.fit}<select value={settings.fit} onChange={event => setSettings(current => ({ ...current, fit: event.target.value as 'contain' | 'cover' }))}><option value="contain">{t.contain}</option><option value="cover">{t.cover}</option></select></label><div className="live-buttons"><button className="live-primary" onClick={() => { void navigator.clipboard.writeText(url).then(() => setCopyState('copied')).catch(() => setCopyState('copyError')); }}>{t.obs}</button><a className="live-open" href={url} target="_blank" rel="noreferrer">{t.openStream}</a></div>diff --git a/src/live/i18n.ts b/src/live/i18n.tsindex d3c8b48..69bdcde 100644--- a/src/live/i18n.ts+++ b/src/live/i18n.ts@@ -5,6 +5,9 @@ export const liveEn = {mirror: 'Mirror', sensitivity: 'Sensitivity', smoothing: 'Smoothing', cameraPreview: 'Show camera preview',microphone: 'Microphone lip sync', gain: 'Microphone gain', privacy: 'Camera video and microphone audio stay on this machine. Only avatar motion values are shared with the stream view.',background: 'Background', transparent: 'Transparent', green: 'Green', blue: 'Blue', custom: 'Custom color',+ bgHintTransparent: 'In OBS, use a Browser Source with the URL below. The background is see-through as is. Window Capture does not keep transparency; choose green or blue for that.',+ bgHintChroma: 'In OBS, use a Browser Source or a Window Capture of the stream view, then add a Chroma Key filter to the source with the same key colour.',+ bgHintCustom: 'In OBS, use a Browser Source or a Window Capture of the stream view, then add a Color Key filter to the source set to this colour.',fit: 'Framing', contain: 'Fit whole avatar', cover: 'Fill frame', obs: 'Copy OBS URL', openStream: 'Open stream view in a new tab', copied: 'URL copied', copyError: 'Could not copy. Select and copy the URL below.',obsHelp: 'Keep this page open. Add the URL as a Browser Source in OBS, for example at 1080 × 1080.',loading: 'Loading avatar…', ready: 'Avatar ready', projectError: 'Could not load this project. Open a readable local project in the editor first.',@@ -34,6 +37,9 @@ const liveJa: typeof liveEn = {mirror: '左右反転', sensitivity: '感度', smoothing: '動きをなめらかにする', cameraPreview: 'カメラ映像を表示',microphone: 'マイクで口を動かす', gain: 'マイクの感度', privacy: 'カメラ映像とマイクの音声は、この端末内で処理します。配信用画面に渡すのはアバターの動きの数値だけです。',background: '背景', transparent: '透明', green: '緑', blue: '青', custom: '指定した色',+ bgHintTransparent: 'OBSでは下のURLを「ブラウザ」ソースで追加してください。そのまま背景が透過されます。「ウィンドウキャプチャ」では透過されないので、その場合は緑か青を選んでください。',+ bgHintChroma: 'OBSでは「ブラウザ」ソース、またはOBS用の画面の「ウィンドウキャプチャ」を使い、ソースのフィルタに「クロマキー」を追加して同じ色を指定してください。',+ bgHintCustom: 'OBSでは「ブラウザ」ソース、またはOBS用の画面の「ウィンドウキャプチャ」を使い、ソースのフィルタに「カラーキー」を追加してこの色を指定してください。',fit: '画面への収め方', contain: '全体を表示', cover: '画面を埋める', obs: 'OBS用URLをコピー', openStream: 'OBS用の画面を別タブで開く', copied: 'URLをコピーしました', copyError: 'コピーできませんでした。下のURLを選択してコピーしてください。',obsHelp: 'この画面を開いたまま、OBSの「ブラウザ」ソースにURLを追加してください。サイズは1080 × 1080などに設定します。',loading: 'アバターを読み込み中…', ready: 'アバターの準備完了', projectError: 'プロジェクトを読み込めませんでした。エディタの一覧から、読み取り可能なローカルプロジェクトを開いてください。',@@ -63,6 +69,9 @@ const liveZh: typeof liveEn = {mirror: '镜像', sensitivity: '灵敏度', smoothing: '动作平滑度', cameraPreview: '显示摄像头画面',microphone: '麦克风口型同步', gain: '麦克风增益', privacy: '摄像头画面和麦克风音频仅在本机处理。直播画面只接收虚拟形象的动作数值。',background: '背景', transparent: '透明', green: '绿色', blue: '蓝色', custom: '自定义颜色',+ bgHintTransparent: '在OBS中,请将下方地址添加为“浏览器”来源,背景会直接透明。“窗口采集”无法保留透明,此时请选择绿色或蓝色。',+ bgHintChroma: '在OBS中,使用“浏览器”来源或对OBS画面进行“窗口采集”,然后为该来源添加“色度键”滤镜并指定相同的颜色。',+ bgHintCustom: '在OBS中,使用“浏览器”来源或对OBS画面进行“窗口采集”,然后为该来源添加“色值键”滤镜并指定此颜色。',fit: '画面适配', contain: '显示完整形象', cover: '填满画面', obs: '复制OBS地址', openStream: '在新标签页打开OBS画面', copied: '地址已复制', copyError: '复制失败。请选中并复制下方地址。',obsHelp: '保持此页面打开,在OBS中添加“浏览器”来源并粘贴地址,例如将尺寸设为1080 × 1080。',loading: '正在加载形象…', ready: '形象已就绪', projectError: '无法加载项目。请先从编辑器的列表中打开可读取的本地项目。',diff --git a/src/live/live.css b/src/live/live.cssindex 92c1b21..e3b8499 100644--- a/src/live/live.css+++ b/src/live/live.css@@ -53,6 +53,7 @@ input[type="color"] { width: 100%; height: 32px; border: 0; padding: 0; }.expression-on { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: #e8f0fd; color: #1d4f9c; font-size: 11px; font-weight: 600; }.live-expression-body { padding: 0 16px 16px; }.live-expression-body h3 { margin: 16px 0 4px; font-size: 13px; }+.background-hint { margin-top: 8px; }.remote-help { margin: 0 0 4px; font-size: 12px; color: #4a5a70; }.remote-field { display: flex; gap: 6px; }.remote-field input { flex: 1; min-width: 0; font: 12px ui-monospace, monospace; padding: 6px 8px; border: 1px solid #c8d3e2; border-radius: 7px; }