[PR #7622] [MERGED] feat(avatars): make a 3D model from a sprite with Tripo for 3D Avatars #7843

Closed
opened 2026-10-24 04:08:03 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7622
Author: @SpicyMarinara
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/tripo-3d-avatars


📝 Commits (10+)

  • 7564879 feat(avatars): make a VRM model from a sprite through Tripo (server)
  • 5f29fbd feat(avatars): Make 3D model in 3D Avatars setup, a Tripo connection, and framing from the model's top
  • 4df68c3 Merge branch 'staging' into feat/tripo-3d-avatars
  • 44fbfe1 test(avatars): e2e for Make 3D model and the Tripo connection; docs for Tripo
  • 8b25aec Merge remote-tracking branch 'origin/feat/tripo-3d-avatars' into feat/tripo-3d-avatars
  • 146fc70 fix(avatars): keep the not-enough-credits line out of a template literal
  • 5a72361 refactor(connections): hide the Tripo editor's address and model fields without re-indenting them
  • 560cea4 fix(avatars): say so when the model stream closes before it's done
  • 66e0601 fix(avatars): leave a model's textures alone when a view points past its binary chunk
  • 38405b2 fix(avatars): resize a texture shared by two images once, at the larger size

📊 Changes

39 files changed (+3517 additions, -183 deletions)

View changed files

📝 docs/agents/avatars.md (+28 -0)
📝 docs/connections/providers-reference.md (+8 -0)
➕ e2e/avatar-vrm-generation.e2e.ts (+401 -0)
📝 packages/client/src/components/agents/AgentEditor.tsx (+4 -22)
📝 packages/client/src/components/chat/ChatSummaryPanel.tsx (+2 -4)
📝 packages/client/src/components/chat/StoryboardChatSettingsPanel.tsx (+2 -7)
📝 packages/client/src/components/connections/ConnectionEditor.tsx (+38 -37)
📝 packages/client/src/components/panels/ConnectionsPanel.tsx (+6 -9)
📝 packages/client/src/components/panels/settings/TTSConfigCard.tsx (+2 -4)
📝 packages/client/src/features/avatars/generation/AvatarGenerationPanel.tsx (+4 -11)
📝 packages/client/src/features/avatars/generation/MeshAvatarSection.tsx (+1 -1)
📝 packages/client/src/features/avatars/generation/SpritePicker.tsx (+9 -0)
📝 packages/client/src/features/avatars/generation/use-avatar-generation.ts (+122 -1)
➕ packages/client/src/features/avatars/renderers/vrm/VrmModelMaker.tsx (+325 -0)
📝 packages/client/src/features/avatars/renderers/vrm/VrmSetupPanel.tsx (+30 -8)
📝 packages/client/src/features/avatars/renderers/vrm/vrm-motion.ts (+13 -4)
📝 packages/client/src/features/avatars/renderers/vrm/vrm-renderer.ts (+9 -1)
📝 packages/client/src/lib/connection-filters.ts (+2 -7)
📝 packages/client/src/localization/locales/en.json (+31 -0)
📝 packages/server/src/db/schema/connections.ts (+1 -0)

...and 19 more files

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

No linked issue: requested by the maintainer on 2026-10-14.

Why this change

  • 3D Avatars needs a VRM model, and most characters and personas don't have one. Making one by hand in VRoid Studio takes hours.
  • With this change, you pick a full-body sprite and click once. Tripo makes a 3D body that moves, using your own Tripo key and credits.
  • A model costs about 60 Tripo credits (about $0.60): 5 for the T-pose picture, 30 for the model and 25 for the skeleton. It takes about 3 to 4 minutes.
  • The model is labelled body only because it is: Tripo models have no face shapes, so the face doesn't move.

What changed

Connections: a Tripo provider

  • Connections has a new Tripo provider with a key field, one line of help and a link to Tripo's key page (https://developers.tripo3d.ai/en/keys).
  • Test Connection reads the account's credits (GET /account/balance). That call is free.
  • There is no Base URL or Model field. The key goes only to https://openapi.tripo3d.ai/v3.
  • The key is stored encrypted like every other connection key and never comes back to the browser.
  • Tripo connections never show up as chat connections. Before this change, each place that filters chat connections listed the non-chat providers itself. They now share isChatProvider() (NON_CHAT_PROVIDERS in packages/shared/src/constants/providers.ts).
  • A Tripo connection can't become the main default, a random-pool pick or an agent fallback. createLLMProvider refuses it.

3D Avatars: Make 3D model

  • Get a 3D model now has Make 3D model with Tripo. It picks the full-body neutral sprite for you. If there is none, it picks another full-body sprite. A portrait is never picked for you, because it would cost credits for a model without legs.
  • It shows the balance and the cost before you start, and Make 3D model stays disabled when the balance is too low.
  • While Tripo works, each step shows as it finishes, with the credits used so far:
    • Drawing the sprite in a T-pose
    • Making the 3D model
    • Adding a skeleton
    • Making the VRM file
  • Cancel stops waiting at once. The setup says that Tripo may still finish the step it was on and charge for it (Tripo has no way to stop a task).
  • A note asks you to keep the page open, because leaving works like Cancel. If the connection drops before the model is done, the setup says so.
  • The result shows the T-pose picture, Tripo's picture of the model and Body only, the face doesn't move. before anything is stored.
  • Save as the VRM model imports the file through the normal VRM import, so the importer checks it and everything after that works as for an imported model. Discard drops it.
  • A saved model with no expressions shows "Body only, the face doesn't move." under Faces and mouth shapes, with no faces to pick. The import says "This model has no face expressions, so its face doesn't move." in place of "You can pick them in setup".

Server

  • POST /api/avatar-generation/vrm-model streams progress events, then the draft. GET /api/avatar-generation/vrm-model/balance returns the credits and the cost.
  • The run follows the hand test:
    1. Check the balance.
    2. Upload the sprite. A flat background is cleaned off first with the existing sprite cleanup. Tripo also redraws the sprite on white.
    3. image-to-image with t_pose.
    4. image-to-model with the tested settings. It never sends export_orientation, compress or quad.
    5. The free rig check, used only to stop before paying for the skeleton when Tripo can't rig the model.
    6. rig with Mixamo.
    7. Convert to VRM.
  • One job runs per avatar. Closing the stream aborts the in-flight Tripo request and stops polling.
  • Tripo errors become plain messages:
    • Bad key: check the key in Connections.
    • Not enough credits: top up at Tripo. The balance is checked before anything is spent.
    • Content policy.
    • Busy: Tripo's Retry-After is honoured up to 4 times, then "try again in a minute".
    • Failed step: Tripo gives those credits back.
  • Debug mode and DEBUG_AGENTS log each request's settings and every task id through logDebugOverride. The key and download-link signatures never appear in a log line or an error.
  • glb-to-vrm (packages/server/src/services/avatars/generation/glb-to-vrm.ts) is plain JavaScript. It changes only the glTF JSON, and the binary chunk is copied byte for byte:
    • It maps the Mixamo bones to VRM bones and refuses a skeleton that is missing a required bone.
    • It refuses a model whose arms point more than 25° down, or whose hips sit below 35% of its height, with "Use a full-body sprite where the whole character is visible." Nothing is saved.
    • It turns the model to face +Z. The turn comes from the shoulder line, snapped to quarter turns.
    • It turns metal off and writes honest VRM 1.0 details (below).
    • A separate step shrinks the textures with sharp.

Choices worth checking

  • Metal is off (metallicFactor 0). The avatar scene has no reflections, so metal draws almost black. Tripo's metal maps average 0.05–0.20, and the colour map already paints the look of metal. The roughness stays.
  • Textures: the normal and metal/roughness maps drop from 2048 to 1024. The colour map keeps 2048, because it carries the face the chat frames. That cuts the textures from about 64 MB of GPU memory to about 34 MB. The live model's file went from about 3.5 MB to 2.4 MB.
    • Without sharp (Lite or Termux), the textures stay as they are, and PNG or JPEG sprites under 20 MB are sent as they are.
    • A texture sharp can't read also stays as it is.
  • Licence fields: Tripo's API terms (https://developers.tripo3d.ai/en/terms, §5.2, updated July 11, 2025) say Tripo keeps the rights to what free users make, and paid users own their outputs. I couldn't confirm the CC BY 4.0 detail for the free plan in Tripo's own terms. The sprite's art may also belong to someone else. So the file claims only:
    • avatarPermission: onlyAuthor
    • commercialUsage: personalNonProfit
    • allowRedistribution: false
    • modification: allowModification (change it, but don't share the changed model)
    • creditNotation: required
    • otherLicenseUrl: Tripo's terms, which setup links as "Read the author's terms"
    • Authors are ["Tripo AI"] and the name is the owner's.

3D chat framing (all VRMs)

  • The camera used to put the top of the frame at the head bone plus 0.42 × the head-to-hips distance. That cut 10–26 cm of hair and ears off Tripo models.
  • The frame now also reaches the top of the posed model (its bounding box), capped at one head-to-hips length above the head bone.
  • It only ever raises the top. A model whose top is lower frames exactly as before; the new regression checks this at 6 aspect ratios.

Reuse

  • preferredMeshSource and isFullBodySprite pick the sprite.
  • The 2D generation panel's sprite filter moved into avatarSourceSprites (SpritePicker.tsx), so both panels use one filter.
  • Sprite lookup is split into findAvatarSpriteFile and decodeAvatarSourceSprite. This is identical to the split in #7623, so the two PRs merge cleanly there.

Related PRs

  • #7620 (the 3D model guide) and #7623 (PNGTuber Cancel and background cleanup) landed while this PR was open.
  • The staging merge on this branch put the guide's Get a 3D model section and Make 3D model into one section.
  • #7631 follows up: Make 3D model now uses #7623's server Cancel (kind: "vrm") and avatarCutout, and the Tripo docs now sit under the guide's section.

Docs: docs/agents/avatars.md has a new section, Make a 3D model with Tripo, and a pointer from 3D avatars: VRM models. docs/connections/providers-reference.md has a new Tripo section. Translations: #7624.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Commands run by the agent (results):

  • node ./scripts/run-regressions.mjs --filter scripts/regressions/avatar-vrm-generation.regression.ts: passed. It mocks Tripo. The converter part covers:
    • the bone map, a missing bone, arms-down and legless refusals
    • facing +X, -X and +Z
    • a byte-identical binary chunk, the VRM meta, metal off
    • the Engine's vrmImporter accepting the result as body only
    • the stage's own three-vrm loader loading it facing +Z, checked on skinned vertices
    • shrinking: the mesh data is unchanged, it is skipped without sharp, and a view past the chunk, shared views and unreadable textures are handled
  • The Tripo client part of that regression covers:
    • every error class, key redaction, Retry-After, polling, timeout, Cancel and downloads (HTTPS only, never with the key)
    • the whole run: the exact request bodies, progress and credits, the balance pre-check, the rig-check stop, refusal of an arms-down model with nothing saved, debug logs without the key, signatures or polls, the route's 400 and SSE error, and Tripo connections kept out of chat defaults
  • node ./scripts/run-regressions.mjs --filter scripts/regressions/avatar-: 14/14 passed. This includes the new framing cases in avatar-vrm.regression.ts. They fail on the old framing ("tall hair stays in view"); I checked that by putting the old code back temporarily.
  • The provider-compat, agent-activation-questions, profile-import-data-security, agent-connection-parameters, decision-reachable-statements, smart-group-decision, command-center and open-issues regressions: passed.
  • Playwright, desktop-chromium, mobile-chromium and mobile-webkit (avatar-vrm-generation, avatar-setup, avatar-2d, avatar-preview): 57 passed. After the later commits, avatar-vrm-generation passed again on all three projects (9 passed).
  • Playwright, desktop-chromium, after the editor changes (agent-activation-questions, atlas-cloud-options, connection-model-switcher, decision-chat-connection, mari-thread-connection and avatar-vrm-generation): all passed.
  • pnpm localization:check: passed.
  • pnpm check: passed (exit 0) on the final code.
  • One live end-to-end run with the maintainer's test key, on a private Engine instance with its own data folder:
    • Calls went through the real routes: the Tripo connection, Test (balance 710), the balance route, the SSE route with debug on, then the normal import.
    • The sprite was full_neutral (Maukie).
    • It took 254 s and used 60 credits (balance 710 → 650).
    • Result: a 2.4 MB VRM 1.0 with 22 bones, 1.80 m tall, arms 8°/7° from a T-pose, turned -90°, normal and metal maps at 1024 and no expressions. The import answered 200 (activeKind vrm, title Maukie, authors Tripo AI).
    • In the 3D Avatars preview, the hair was cut off with the old framing and is whole with the new one.
    • The key appears nowhere in the server log, the run log or any file it wrote. No download signature was logged. The instance's data folder, with the encrypted key, was deleted afterwards.
  • Local CodeRabbit (coderabbit review --agent --committed), first pass:
    • A stream that closes without an end event was silent. Fixed, and now covered by e2e.
    • Two pre-existing docs-i18n reminders. Answered by #7624.
  • Local CodeRabbit, later passes. Each finding below was fixed, with a regression or e2e case:
    • The texture repack trusted view lengths.
    • It resized a shared view once per image.
    • An unreadable texture failed the whole run.
    • An importer refusal became a server error.
    • Tripo requests had no time limit.
    • Arms held forward or bent at the elbow passed the T-pose check. The three good Tripo models from the hand test measure 1–10° on the new check; the two bad ones are still refused.
    • Sprites narrower than Tripo's 1:3 limit failed at Tripo. They are now padded.
    • A new run could drop an unsaved paid model. Make now waits until it is saved or discarded.
  • That last fix commit (9f8d11463) merged while GitHub's CodeRabbit review was in progress. A separate local review of it had 0 findings.
  • The docs-i18n reminder is answered by #7624.

Manual verification notes

  • Manually verify with a real Tripo key in the browser:
    1. Add a Tripo connection in Connections and press Test Connection. It should show your credits.
    2. On 3D Avatars, choose a character with a full_neutral sprite and press Make 3D model.
    3. Watch the four steps and the credits used, then Save as the VRM model.
    4. Check the model in the preview and in a Roleplay chat with 3D Avatars on: it faces you, its hair isn't cut off at the top, metal parts aren't black, and Faces and mouth shapes says "Body only, the face doesn't move."
  • Manually verify Cancel during a real run. The setup should stop at once and say Tripo may still charge for the step. Then check Tripo's dashboard for what was charged.
  • Manually verify a bad key (Test Connection and the balance line both say to check the key in Connections). If you can, also check a low balance (Make stays disabled with "That's not enough for a model").
  • Manually verify that an imported VRoid model frames as before in a chat, at a narrow and a wide spot.
  • Manually verify that Tripo connections don't appear in any chat, agent, summary or TTS connection picker.
  • Manually check the honesty of the licence fields above. Change them if Tripo's terms for API credits should be read differently.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

docs/agents/avatars.md and docs/connections/providers-reference.md changed. The translation follow-up is #7624. No version or storage-format change: Tripo connections are rows in the existing connections table, and the model is stored like any imported VRM.

UI evidence (if applicable)

The e2e saves screenshots of the draft, the error state, the saved body-only model and the Tripo connection editor (vrm-model-*.png, tripo-connection.png), on desktop and on phones. I didn't upload them here, because public image uploads are blocked for this agent.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7622 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/tripo-3d-avatars` --- ### 📝 Commits (10+) - [`7564879`](https://github.com/Pasta-Devs/Marinara-Engine/commit/756487916cc6d43faa850a395ffe2d2130798d4f) feat(avatars): make a VRM model from a sprite through Tripo (server) - [`5f29fbd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5f29fbd6445aad5054edb4aa8f53841f087a7a86) feat(avatars): Make 3D model in 3D Avatars setup, a Tripo connection, and framing from the model's top - [`4df68c3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4df68c34b8f7b5c07e963f1e8ddfc3c116e39dbb) Merge branch 'staging' into feat/tripo-3d-avatars - [`44fbfe1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/44fbfe18f80acd0d76824290ecac401eaa32b714) test(avatars): e2e for Make 3D model and the Tripo connection; docs for Tripo - [`8b25aec`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8b25aec3a6b73510e2cfb1654b8eaba10eee0055) Merge remote-tracking branch 'origin/feat/tripo-3d-avatars' into feat/tripo-3d-avatars - [`146fc70`](https://github.com/Pasta-Devs/Marinara-Engine/commit/146fc70c9114f5cc2b4c52c3ed89cd84ad27dad5) fix(avatars): keep the not-enough-credits line out of a template literal - [`5a72361`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5a72361e6ea60a3903237fa29a1b94454f1f3cfc) refactor(connections): hide the Tripo editor's address and model fields without re-indenting them - [`560cea4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/560cea4ede3d5c4fe13fff43754e6d17087215c1) fix(avatars): say so when the model stream closes before it's done - [`66e0601`](https://github.com/Pasta-Devs/Marinara-Engine/commit/66e0601164e96dd5ba60f6e0631259cef1b2508e) fix(avatars): leave a model's textures alone when a view points past its binary chunk - [`38405b2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/38405b2f2b93a60e653fbe94db71b6649aa600fa) fix(avatars): resize a texture shared by two images once, at the larger size ### 📊 Changes **39 files changed** (+3517 additions, -183 deletions) <details> <summary>View changed files</summary> 📝 `docs/agents/avatars.md` (+28 -0) 📝 `docs/connections/providers-reference.md` (+8 -0) ➕ `e2e/avatar-vrm-generation.e2e.ts` (+401 -0) 📝 `packages/client/src/components/agents/AgentEditor.tsx` (+4 -22) 📝 `packages/client/src/components/chat/ChatSummaryPanel.tsx` (+2 -4) 📝 `packages/client/src/components/chat/StoryboardChatSettingsPanel.tsx` (+2 -7) 📝 `packages/client/src/components/connections/ConnectionEditor.tsx` (+38 -37) 📝 `packages/client/src/components/panels/ConnectionsPanel.tsx` (+6 -9) 📝 `packages/client/src/components/panels/settings/TTSConfigCard.tsx` (+2 -4) 📝 `packages/client/src/features/avatars/generation/AvatarGenerationPanel.tsx` (+4 -11) 📝 `packages/client/src/features/avatars/generation/MeshAvatarSection.tsx` (+1 -1) 📝 `packages/client/src/features/avatars/generation/SpritePicker.tsx` (+9 -0) 📝 `packages/client/src/features/avatars/generation/use-avatar-generation.ts` (+122 -1) ➕ `packages/client/src/features/avatars/renderers/vrm/VrmModelMaker.tsx` (+325 -0) 📝 `packages/client/src/features/avatars/renderers/vrm/VrmSetupPanel.tsx` (+30 -8) 📝 `packages/client/src/features/avatars/renderers/vrm/vrm-motion.ts` (+13 -4) 📝 `packages/client/src/features/avatars/renderers/vrm/vrm-renderer.ts` (+9 -1) 📝 `packages/client/src/lib/connection-filters.ts` (+2 -7) 📝 `packages/client/src/localization/locales/en.json` (+31 -0) 📝 `packages/server/src/db/schema/connections.ts` (+1 -0) _...and 19 more files_ </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue No linked issue: requested by the maintainer on 2026-10-14. ## Why this change - 3D Avatars needs a VRM model, and most characters and personas don't have one. Making one by hand in VRoid Studio takes hours. - With this change, you pick a full-body sprite and click once. Tripo makes a 3D body that moves, using your own Tripo key and credits. - A model costs about **60 Tripo credits (about $0.60)**: 5 for the T-pose picture, 30 for the model and 25 for the skeleton. It takes about 3 to 4 minutes. - The model is labelled body only because it is: Tripo models have no face shapes, so the face doesn't move. ## What changed **Connections: a Tripo provider** - Connections has a new **Tripo** provider with a key field, one line of help and a link to Tripo's key page (`https://developers.tripo3d.ai/en/keys`). - **Test Connection** reads the account's credits (`GET /account/balance`). That call is free. - There is no Base URL or Model field. The key goes only to `https://openapi.tripo3d.ai/v3`. - The key is stored encrypted like every other connection key and never comes back to the browser. - Tripo connections never show up as chat connections. Before this change, each place that filters chat connections listed the non-chat providers itself. They now share `isChatProvider()` (`NON_CHAT_PROVIDERS` in `packages/shared/src/constants/providers.ts`). - A Tripo connection can't become the main default, a random-pool pick or an agent fallback. `createLLMProvider` refuses it. **3D Avatars: Make 3D model** - **Get a 3D model** now has **Make 3D model with Tripo**. It picks the full-body neutral sprite for you. If there is none, it picks another full-body sprite. A portrait is never picked for you, because it would cost credits for a model without legs. - It shows the balance and the cost before you start, and **Make 3D model** stays disabled when the balance is too low. - While Tripo works, each step shows as it finishes, with the credits used so far: - Drawing the sprite in a T-pose - Making the 3D model - Adding a skeleton - Making the VRM file - **Cancel** stops waiting at once. The setup says that Tripo may still finish the step it was on and charge for it (Tripo has no way to stop a task). - A note asks you to keep the page open, because leaving works like Cancel. If the connection drops before the model is done, the setup says so. - The result shows the T-pose picture, Tripo's picture of the model and **Body only, the face doesn't move.** before anything is stored. - **Save as the VRM model** imports the file through the normal VRM import, so the importer checks it and everything after that works as for an imported model. **Discard** drops it. - A saved model with no expressions shows "Body only, the face doesn't move." under **Faces and mouth shapes**, with no faces to pick. The import says "This model has no face expressions, so its face doesn't move." in place of "You can pick them in setup". **Server** - `POST /api/avatar-generation/vrm-model` streams progress events, then the draft. `GET /api/avatar-generation/vrm-model/balance` returns the credits and the cost. - The run follows the hand test: 1. Check the balance. 2. Upload the sprite. A flat background is cleaned off first with the existing sprite cleanup. Tripo also redraws the sprite on white. 3. `image-to-image` with `t_pose`. 4. `image-to-model` with the tested settings. It never sends `export_orientation`, `compress` or `quad`. 5. The free rig check, used only to stop before paying for the skeleton when Tripo can't rig the model. 6. `rig` with Mixamo. 7. Convert to VRM. - One job runs per avatar. Closing the stream aborts the in-flight Tripo request and stops polling. - Tripo errors become plain messages: - Bad key: check the key in Connections. - Not enough credits: top up at Tripo. The balance is checked before anything is spent. - Content policy. - Busy: Tripo's `Retry-After` is honoured up to 4 times, then "try again in a minute". - Failed step: Tripo gives those credits back. - Debug mode and `DEBUG_AGENTS` log each request's settings and every task id through `logDebugOverride`. The key and download-link signatures never appear in a log line or an error. - **glb-to-vrm** (`packages/server/src/services/avatars/generation/glb-to-vrm.ts`) is plain JavaScript. It changes only the glTF JSON, and the binary chunk is copied byte for byte: - It maps the Mixamo bones to VRM bones and refuses a skeleton that is missing a required bone. - It refuses a model whose arms point more than 25° down, or whose hips sit below 35% of its height, with "Use a full-body sprite where the whole character is visible." Nothing is saved. - It turns the model to face +Z. The turn comes from the shoulder line, snapped to quarter turns. - It turns metal off and writes honest VRM 1.0 details (below). - A separate step shrinks the textures with sharp. **Choices worth checking** - **Metal is off** (`metallicFactor` 0). The avatar scene has no reflections, so metal draws almost black. Tripo's metal maps average 0.05–0.20, and the colour map already paints the look of metal. The roughness stays. - **Textures:** the normal and metal/roughness maps drop from 2048 to 1024. The colour map keeps 2048, because it carries the face the chat frames. That cuts the textures from about 64 MB of GPU memory to about 34 MB. The live model's file went from about 3.5 MB to 2.4 MB. - Without sharp (Lite or Termux), the textures stay as they are, and PNG or JPEG sprites under 20 MB are sent as they are. - A texture sharp can't read also stays as it is. - **Licence fields:** Tripo's API terms (`https://developers.tripo3d.ai/en/terms`, §5.2, updated July 11, 2025) say Tripo keeps the rights to what free users make, and paid users own their outputs. I couldn't confirm the CC BY 4.0 detail for the free plan in Tripo's own terms. The sprite's art may also belong to someone else. So the file claims only: - `avatarPermission: onlyAuthor` - `commercialUsage: personalNonProfit` - `allowRedistribution: false` - `modification: allowModification` (change it, but don't share the changed model) - `creditNotation: required` - `otherLicenseUrl`: Tripo's terms, which setup links as "Read the author's terms" - Authors are `["Tripo AI"]` and the name is the owner's. **3D chat framing (all VRMs)** - The camera used to put the top of the frame at the head bone plus 0.42 × the head-to-hips distance. That cut 10–26 cm of hair and ears off Tripo models. - The frame now also reaches the top of the posed model (its bounding box), capped at one head-to-hips length above the head bone. - It only ever raises the top. A model whose top is lower frames exactly as before; the new regression checks this at 6 aspect ratios. **Reuse** - `preferredMeshSource` and `isFullBodySprite` pick the sprite. - The 2D generation panel's sprite filter moved into `avatarSourceSprites` (SpritePicker.tsx), so both panels use one filter. - Sprite lookup is split into `findAvatarSpriteFile` and `decodeAvatarSourceSprite`. This is identical to the split in #7623, so the two PRs merge cleanly there. **Related PRs** - #7620 (the 3D model guide) and #7623 (PNGTuber Cancel and background cleanup) landed while this PR was open. - The staging merge on this branch put the guide's **Get a 3D model** section and **Make 3D model** into one section. - #7631 follows up: Make 3D model now uses #7623's server Cancel (`kind: "vrm"`) and `avatarCutout`, and the Tripo docs now sit under the guide's section. **Docs:** `docs/agents/avatars.md` has a new section, **Make a 3D model with Tripo**, and a pointer from **3D avatars: VRM models**. `docs/connections/providers-reference.md` has a new **Tripo** section. Translations: #7624. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Commands run by the agent (results): - `node ./scripts/run-regressions.mjs --filter scripts/regressions/avatar-vrm-generation.regression.ts`: passed. It mocks Tripo. The converter part covers: - the bone map, a missing bone, arms-down and legless refusals - facing +X, -X and +Z - a byte-identical binary chunk, the VRM meta, metal off - the Engine's `vrmImporter` accepting the result as body only - the stage's own three-vrm loader loading it facing +Z, checked on skinned vertices - shrinking: the mesh data is unchanged, it is skipped without sharp, and a view past the chunk, shared views and unreadable textures are handled - The Tripo client part of that regression covers: - every error class, key redaction, `Retry-After`, polling, timeout, Cancel and downloads (HTTPS only, never with the key) - the whole run: the exact request bodies, progress and credits, the balance pre-check, the rig-check stop, refusal of an arms-down model with nothing saved, debug logs without the key, signatures or polls, the route's 400 and SSE error, and Tripo connections kept out of chat defaults - `node ./scripts/run-regressions.mjs --filter scripts/regressions/avatar-`: 14/14 passed. This includes the new framing cases in `avatar-vrm.regression.ts`. They fail on the old framing ("tall hair stays in view"); I checked that by putting the old code back temporarily. - The provider-compat, agent-activation-questions, profile-import-data-security, agent-connection-parameters, decision-reachable-statements, smart-group-decision, command-center and open-issues regressions: passed. - Playwright, desktop-chromium, mobile-chromium and mobile-webkit (`avatar-vrm-generation`, `avatar-setup`, `avatar-2d`, `avatar-preview`): 57 passed. After the later commits, `avatar-vrm-generation` passed again on all three projects (9 passed). - Playwright, desktop-chromium, after the editor changes (`agent-activation-questions`, `atlas-cloud-options`, `connection-model-switcher`, `decision-chat-connection`, `mari-thread-connection` and `avatar-vrm-generation`): all passed. - `pnpm localization:check`: passed. - `pnpm check`: passed (exit 0) on the final code. - **One live end-to-end run** with the maintainer's test key, on a private Engine instance with its own data folder: - Calls went through the real routes: the Tripo connection, Test (balance 710), the balance route, the SSE route with debug on, then the normal import. - The sprite was `full_neutral` (Maukie). - It took 254 s and used **60 credits** (balance 710 → 650). - Result: a 2.4 MB VRM 1.0 with 22 bones, 1.80 m tall, arms 8°/7° from a T-pose, turned -90°, normal and metal maps at 1024 and no expressions. The import answered 200 (activeKind `vrm`, title `Maukie`, authors `Tripo AI`). - In the 3D Avatars preview, the hair was cut off with the old framing and is whole with the new one. - The key appears nowhere in the server log, the run log or any file it wrote. No download signature was logged. The instance's data folder, with the encrypted key, was deleted afterwards. - Local CodeRabbit (`coderabbit review --agent --committed`), first pass: - A stream that closes without an end event was silent. Fixed, and now covered by e2e. - Two pre-existing docs-i18n reminders. Answered by #7624. - Local CodeRabbit, later passes. Each finding below was fixed, with a regression or e2e case: - The texture repack trusted view lengths. - It resized a shared view once per image. - An unreadable texture failed the whole run. - An importer refusal became a server error. - Tripo requests had no time limit. - Arms held forward or bent at the elbow passed the T-pose check. The three good Tripo models from the hand test measure 1–10° on the new check; the two bad ones are still refused. - Sprites narrower than Tripo's 1:3 limit failed at Tripo. They are now padded. - A new run could drop an unsaved paid model. Make now waits until it is saved or discarded. - That last fix commit (`9f8d11463`) merged while GitHub's CodeRabbit review was in progress. A separate local review of it had 0 findings. - The docs-i18n reminder is answered by #7624. ### Manual verification notes - Manually verify with a real Tripo key in the browser: 1. Add a Tripo connection in Connections and press **Test Connection**. It should show your credits. 2. On **3D Avatars**, choose a character with a `full_neutral` sprite and press **Make 3D model**. 3. Watch the four steps and the credits used, then **Save as the VRM model**. 4. Check the model in the preview and in a Roleplay chat with 3D Avatars on: it faces you, its hair isn't cut off at the top, metal parts aren't black, and **Faces and mouth shapes** says "Body only, the face doesn't move." - Manually verify **Cancel** during a real run. The setup should stop at once and say Tripo may still charge for the step. Then check Tripo's dashboard for what was charged. - Manually verify a bad key (Test Connection and the balance line both say to check the key in Connections). If you can, also check a low balance (Make stays disabled with "That's not enough for a model"). - Manually verify that an imported VRoid model frames as before in a chat, at a narrow and a wide spot. - Manually verify that Tripo connections don't appear in any chat, agent, summary or TTS connection picker. - Manually check the honesty of the licence fields above. Change them if Tripo's terms for API credits should be read differently. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) `docs/agents/avatars.md` and `docs/connections/providers-reference.md` changed. The translation follow-up is #7624. No version or storage-format change: Tripo connections are rows in the existing connections table, and the model is stored like any imported VRM. ## UI evidence (if applicable) The e2e saves screenshots of the draft, the error state, the saved body-only model and the Tripo connection editor (`vrm-model-*.png`, `tripo-connection.png`), on desktop and on phones. I didn't upload them here, because public image uploads are blocked for this agent. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:08:03 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7843
No description provided.