Repository navigation
fix(render): cross-fade pose release instead of hard-cutting to idle - #315
sanketpatel32 wants to merge 3 commits into
Conversation
When a clip change has no authored transition frames — the common case for the post-speech pose release back to standing, whose graph edges and release clips do not exist — the renderer now keeps the outgoing frame on screen as an overlay sprite and dissolves it over RENDER_POSE_FADE_MS (default 200 ms) instead of jumping in a single frame. The outgoing texture is pinned in the frame store (or display-retained for video-backed clips) for the fade window so the texture window cannot evict it mid-fade, and the pin is released when the fade completes, is replaced by a newer clip change, or the character deactivates. Authored transition clips still take precedence, and renderPoseFadeMs=0 restores the previous hard cut. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Signed-off-by: Sanket Patel <sanpatel323@gmail.com>
dee9f7d to
927f34b
Compare
Lucas1479
left a comment
There was a problem hiding this comment.
Thank you @sanketpatel32 for picking up #263. The overlay approach is clean, and pinning the outgoing texture so the frame store can't evict it mid-fade is the right detail.
A few changes are needed:
-
CI blocker.
RENDER_POSE_FADE_MSis declared by hand inconfig/settings.py, sotests/test_config_catalog.py::test_no_new_or_migrated_handwritten_config_declarationsfails with "declare RENDER_POSE_FADE_MS in the catalog". Please declare it in the config catalog. -
Scope. The fade runs on every
setEmotionclip change, not only on the post-speech release.- The description says authored transitions take precedence. That refers to the
_transitionstable, but nothing in the repository sendsloadTransitionFrames(the bridge only forwards it), so the table stays empty. - Authored transition nodes in the pose graph are cross-faded as well.
- Please limit the fade to the release path the issue describes, or correct the description and show that authored sequences are visually unaffected.
- The description says authored transitions take precedence. That refers to the
-
Authored release clips. As noted in #263, we plan to add authored pose-to-idle transition clips. The fade should only be a fallback where no authored release path exists.
-
Evidence. Please attach a short before/after recording of the default character releasing a pose after speech, with both the image-sequence and the video frame source. Please also run the Electron type check (
tsc), since this PR changes TypeScript files.
…talog
- RENDER_POSE_FADE_MS moves from a handwritten config/settings.py
declaration to config/catalog/graphics/budget.json (integer 0-2000,
default 200), regenerating settings.py, configCatalog.generated.ts and
.env.example — unblocks test_config_catalog.
- The cross-fade now runs only on release hops: SpriteForgeRuntime marks
the post-speech release node play, the release-node advance and the
release()-to-root return with { release: true }, threaded through
_playNode to SpriteRenderer.setEmotion. Authored sequences and
interactive poses no longer get an overlay; authored transition clips
still take precedence, so the fade stays the fallback when the planned
authored release clips land.
- Tests: new non-release no-fade case; existing fade cases pass the
release flag.
|
Requested changes addressed in d1e255a:
Outstanding: the before/after recording of the default character releasing after speech (image-sequence and video frame source) still needs a staged run — flagging rather than fabricating it. |
…-release-transition
Fixes #263
Problem
After speech ends, a posed character snaps back to standing/idle in a single frame ("角色说完话回到站立时是一个瞬间跳变"). The post-speech release path calls
_playNodedirectly and the pose graph has no pose→idle transition edges or release clips, sosetEmotionhard-cuts.Fix (owning layer:
render/web/renderer.js,SpriteRenderer.setEmotion)When a clip change has no authored transition frames, the renderer now keeps the outgoing frame visible as an overlay sprite and dissolves it over a configurable duration instead of cutting:
renderPoseFadeMsquery param /RENDER_POSE_FADE_MSenv var, default 200 ms (clamped 0–2000;0restores the previous hard cut).Plumbing
RENDER_POSE_FADE_MSreaches every render surface:render_handler.py(desktop),wallpaper_engine_bridge.py/wallpaper_handler.py(bridge-info + URL),wallpaper/lively/index.html, and the Electron chain (main/index.tsdescriptor/normalize/URL,preload/index.mts,env.d.ts,wallpaperSlice.ts). Documented inconfig/README.md.Tests
tests/sprite_pose_fade.test.cjs(5 contracts: dissolve+pin release,=0hard cut, authored-transition precedence, fade replacement mid-flight, teardown pin release) +tests/test_sprite_pose_fade.pywrapper.poseFadeMs: 0to keep their hard-cut assumptions explicit.tests/test_wallpaper_asset_revision.pyupdated for the new URL contract.Verification
node --test: sprite_pose_fade 5/5, sprite_texture_lifecycle 24/24, sprite_canvas_fit 4/4, sprite_frame_sampling 18/18, sprite_video_source 27/27, hybrid_lifecycle 4/4; post-speech handoff script OK.pytest: test_sprite_pose_fade, test_spriteforge_post_speech_handoff, test_render_budget, test_sprite_texture_lifecycle, test_sprite_frame_sampling, test_frame_store (27 passed); test_electron_renderer_boundary + test_wallpaper_asset_revision + test_wallpaper_bridge_portability (16 passed, 1 skipped).tsc/vitebuild (deps not installed locally);node --checkpasses on all touched JS.Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>