mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7820] [MERGED] fix(avatars): keep colours and idle motion on generated 3D avatars #7947
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7947
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7820
Author: @SpicyMarinara
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/avatar-3d-colors-motion📝 Commits (1)
aec99f6fix(avatars): keep colours and idle motion on generated 3D avatars📊 Changes
7 files changed (+532 additions, -43 deletions)
View changed files
📝
e2e/avatar-2d.e2e.ts(+1 -31)➕
e2e/avatar-vrm.e2e.ts(+147 -0)➕
e2e/server-csp-fixture.ts(+32 -0)📝
packages/client/src/features/avatars/renderers/vrm/vrm-motion.ts(+28 -9)📝
packages/client/src/features/avatars/renderers/vrm/vrm-renderer.ts(+13 -2)📝
scripts/regressions/avatar-vrm.regression.ts(+126 -1)➕
scripts/regressions/fixtures/avatar-3d-fixtures.ts(+185 -0)📄 Description
Linked issue
No issue: @SpicyMarinara reported this directly while testing the staging Docker build (3D Avatars page, a model made with Tripo).
Why this change
A model made with Tripo showed its colours in the preview picture, but drew plain white once it loaded, and it barely moved.
fetch(blob:…), and the server's Content-Security-Policy (connect-srchas noblob:) blocks those requests. three then quietly drops each texture, so the model renders white. This never showed inpnpm dev, because Vite sends no CSP. It affects every VRM with textures in Docker and production, VRoid models included.Models that are already saved get both fixes the next time they load. Nobody needs to make them again.
What changed
vrm-renderer.ts: the loader loads a model's pictures as images (img-srcalready allowsblob:anddata:), using three's ownTextureLoaderfallback. The CSP stays as it is, as it did for the mesh avatar fix in5d1ec08a8. On an M4 the first frame of the real model takes about 15 ms longer than with image bitmaps (81 ms against 65 ms). After that, frames cost the same.vrm-motion.ts: a model with no mouth shape bound (bodyOnly) sways, breathes and turns 2.5 times as much, and nods and tilts its head with each phrase it speaks. A model with a face keeps exactly the pose it had (gain 1, no talk term), and reduced motion still holds every body still.scripts/regressions/fixtures/avatar-3d-fixtures.tsbuilds a Tripo-like model in code: a Mixamo skeleton underRoot, facing +X, with one PBR material and normal, colour and ORM pictures in Tripo's order. It then runs the model through the realglb-to-vrm.avatar-vrm.regression.tschecks the motion maths: a body-only model sways more and nods per phrase, and a model with a face nods exactly as before. It then loads the fixture while Node plays a browser whoseconnect-srcrefusesblob:, and checks that the colour map loads and that the Mixamo head visibly turns with no idle animation.e2e/avatar-vrm.e2e.tsdraws the fixture with the real renderer under the server's own CSP. It checks that the pixels are the texture's colour and not white, that the body moves, and that the page reports no CSP violations.serveWithServerCspmoved unchanged fromavatar-2d.e2e.tstoe2e/server-csp-fixture.tsso both specs share it.Not in this PR: the mouth. A Tripo model has no mouth to move: its rig is 23 body joints with no face shapes or jaw, so lip sync has nothing to drive. Here speech shows through head nods and tilts only. A moving mouth needs a new step, and that needs your decision first.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands run by the agent:
pnpm check: passed.node ./scripts/run-regressions.mjs --filter avatar: 18 of 18 passed.e2e/avatar-vrm.e2e.ts,avatar-2d,avatar-preview,avatar-setup,avatar-vrm-generationandavatar-generation, 26 of 26 passed.e2e/avatar-vrm.e2e.tspassed on both.connect-srcviolations forblob:.pnpm dev.Manual verification notes
connect-srcviolations.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/agents/avatars.mdalready says that a Tripo model's body moves and its face doesn't, which stays true.UI evidence (if applicable)
The agent rendered the real model locally under the server's CSP. Staging draws it white; this branch draws it in full colour (black waistcoat, red shirt, brown hair), and the idle difference map shows the head and shoulders moving about 50% more. The screenshots are kept with the agent's run.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.