mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7889] [MERGED] fix(avatars): mesh avatar mouths span the whole drawn mouth #7987
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#7987
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/7889
Author: @SpicyMarinara
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/mesh-mouth-width📝 Commits (2)
6d6c6dcfix(avatars): mesh avatar mouths span the whole drawn mouth9353232fix(avatars): project faded lip ends onto the fitted mouth line📊 Changes
6 files changed (+133 additions, -4 deletions)
View changed files
📝
packages/server/src/services/avatars/generation/mesh-layer-builder.ts(+48 -1)📝
patches/mesh-avatar@0.1.1.patch(+9 -0)📝
pnpm-lock.yaml(+3 -3)📝
pnpm-workspace.yaml(+1 -0)📝
scripts/regressions/avatar-2d-renderers.regression.ts(+20 -0)📝
scripts/regressions/avatar-generation.regression.ts(+52 -0)📄 Description
Linked issue
No issue. This follows up #7880. Mari tested Maukie's mesh avatar after making it again on #7880: the eyes work, but the mouth is too short side to side. If an issue is wanted for tracking, it should be opened before this merges.
Closes #
Why this change
When a mesh avatar talks, its open mouth only covers the middle of the drawn mouth line, so the line's ends stick out on both sides.
The rig is not the problem. On Maukie's new file the rig's mouth corners are within about 1 px of the drawn line's ends (611.5–720 on the 1327×1254 base), and halfLen is 53.03, half the line, as the mesh-avatar format defines it ("half length of lip-corner line").
The cause is in the mesh-avatar 0.1.1 runtime. Its painted mouth only opens where
|s| < wf, withsmeasured in halfLens, andwf = mix(0.78, 0.46, form)indist/index.js, so:This affects every avatar that uses the painted mouth: generated ones, and imported
.mavatarfiles without drawn mouth shapes.What changed
patches/mesh-avatar@0.1.1.patch,pnpm-workspace.yaml,pnpm-lock.yaml):wfis now1.0, so for every vowel and motion the opening runs from one lip corner to the other and narrows to a point at each corner. Each vowel still keeps its own depth and roundness, teeth and tongue.fitDrawnMouthinmesh-layer-builder.ts): lip lines that fade to lighter ends than the ink threshold now keep those ends. The same applies to a line that runs past corners the vision model placed too far in. A local-contrast check follows the line outward column by column: the line must be darker than the skin just above and below it, so smooth shading doesn't count. This is capped at 30% of the vision mouth's width on each side. The fit itself still uses only the solid ink, and the fitted curve is extended to the point on it nearest where the line visibly ends, so a tilted mouth with a flat faded tail isn't carried past the tail, so #7880's position and bow measurement stay the same. The guards are unchanged: no clear line, an open drawn mouth, or a line much shorter than the vision mouth still keep the vision corners.avatar-generation: a tapered line fixture (dark centre, ends lighter than the ink threshold, vision corners placed inside the line) gets corners within 2 built px of the visible ends. Without the fix they land about 15 px short on each side. A 3:4 tilted line with a flat faded tail ends at the point of the line nearest the tail end. All #7880 cases still pass.avatar-2d-renderers: pins the installed runtime's painted width to the whole lip line for every mouth form.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Ran by the agent:
pnpm checknode scripts/run-regressions.mjs --filter avatar: all 20 avatar regressions pass.To check by hand:
.mavatarwithout drawn mouth shapes. Its painted mouth now also opens to its lip corners.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n] <paths>follow-up issue opened (see CONTRIBUTING.md § Translated documentation)The docs say simple mouths are drawn when a file has none. That stays true, so no doc text changes.
UI evidence (if applicable)
The before and after sheets are kept locally rather than attached, because they show Mari's character art. Both sheets use the same layout and crop: a row of calm, nod and greet above a row of a, o and i. Blue ticks mark the ends of the drawn line.
Summary by CodeRabbit
Improvements
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.