Skip to content

Builder drops scene dependencies referenced by SkinnedMeshRenderer.sharedMaterials and AnimationController.graph — assets missing from bundle, scene fails to load at runtime #631

@johngorat

Description

@johngorat

Version

  • cocos-cli 0.0.1-alpha.28 (repo checkout; scene authoring and build driven via the MCP server: scene-* commands, builder-build)
  • engine 4.0.0-alpha.20
  • Node 25.9.0, macOS arm64

Summary

The builder's scene dependency walker collects some component-referenced assets but not others. For a scene containing a skinned character, consistently across rebuilds (with temp/builder cleared each time):

Bundled correctly (same source .glb, same build — these serve as the positive control):

  • SkinnedMeshRenderer.mesh (glTF sub-asset)
  • SkinnedMeshRenderer.skeleton (glTF sub-asset)
  • SkeletalAnimation.clips / defaultClip (glTF sub-asset; useBakedAnimation: false)

Dropped (absent from every bundle's config.json uuids[], no file under import/):

  • SkinnedMeshRenderer.sharedMaterials — reproduced with BOTH a glTF sub-asset material (<uuid>@xxxxx) AND a plain .mtl file asset (referenced by nothing else)
  • cc.animation.AnimationController.graph — an .animgraph file asset

In all dropped cases the reference is serialized into the built scene JSON, so at runtime the engine requests the asset, gets a 404, and the scene load aborts on the missing dependency. Example failures from our run (full-form uuids, as they appear in this build's uuids[] — the bundled sub-assets of the same glb are listed there in full form too, so the absence is not a compressed-uuid search artifact):

404  assets/main/import/e0/e0bbe7b1-8180-4cea-b34c-59607307f0e1.json   (.animgraph)
404  assets/main/import/1f/1fabb4fd-5158-427a-83a7-374ba99514e0.json   (.mtl)

All dropped assets are healthy in the asset DB: imported: true, invalid: false, library JSON present, full records returned by asset-info queries.

Possibly related: on an earlier alpha (0.0.1-alpha.19) we observed cc.SkeletalAnimation clips not being bundled when useBakedAnimation: true (not filed at the time, and not re-confirmed on alpha.28) — it looks like the same dependency-collection layer, different component property.

Note: cc.MeshRenderer materials in another (non-skinned) scene of this project bundle fine, so the gap appears specific to certain component types/properties rather than to materials in general.

Steps to reproduce (as performed in our project; happy to build a minimal repro project on request)

  1. Import a skinned .glb (any source; ours was UE-exported). Create a new 3D scene; instantiate the glb's generated .prefab sub-asset (scene-create-node-by-asset on the slash-URL), unpack-prefab it.
  2. Set SkinnedMeshRenderer.sharedMaterials[0] to a .mtl asset referenced by no other scene. Add cc.animation.AnimationController on the host node and set graph to an .animgraph asset (ours contained a 2-state graph referencing one clip; we did not test whether an empty default graph also reproduces). Save the scene.
  3. Build web-desktop with the unmodified default build config (builder-query-default-build-config) with the repro scene included; clear temp/builder first.
  4. Check build/web-desktop/assets/*/config.json: the material and animgraph uuids are absent from every bundle's uuids[]; no corresponding files under import/. The glb's mesh/skeleton/clip sub-asset uuids from the same scene ARE present (positive control).
  5. Serve the build and load the scene: repeated 404s for those uuids (see above); the scene never finishes loading.

Expected

Every asset referenced by a scene component property is included in the bundle — or at minimum the build fails/warns about the dropped dependency, instead of producing a scene that cannot load.

Actual

Material and animation-graph references silently vanish from the bundle while remaining in the serialized scene → guaranteed runtime 404 + scene load failure.

Workaround

Move the affected assets under assets/resources/ — everything there is force-bundled. Verified end-to-end for the .animgraph and the .mtl: after the move the 404s disappear and the scene loads and animates.


This report was drafted with AI assistance and manually verified against our project before posting.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions