Skip to content

Fix builtin effect loading for scene previews#768

Merged
star-e merged 6 commits into
cocos:mainfrom
bofeng-song:fix/preview-builtin-effects
Jul 20, 2026
Merged

Fix builtin effect loading for scene previews#768
star-e merged 6 commits into
cocos:mainfrom
bofeng-song:fix/preview-builtin-effects

Conversation

@bofeng-song

@bofeng-song bofeng-song commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add an internal scene EffectService that mirrors Creator's effect manager: query all cc.EffectAsset entries and load them through assetManager.loadAny before preview services initialize.
  • Move browser asset fallback setup before service initialization so the effect service can load internal/project effect assets in scene-editor preview.
  • Keep material and mesh preview guards so missing effect passes degrade gracefully instead of crashing.

Testing

  • git diff --check cli/main...HEAD
  • npx tsc -b --pretty false
  • npx jest src/core/scene/test/scene.middleware.test.ts src/core/preview/test/scripting-routes.test.ts src/core/scene/test/service-core/service-manager-forwarding.test.ts --runInBand

@bofeng-song bofeng-song added the pending Not ready yet label Jul 17, 2026
@bofeng-song
bofeng-song force-pushed the fix/preview-builtin-effects branch from b2ad971 to 04df163 Compare July 20, 2026 03:08
@bofeng-song
bofeng-song force-pushed the fix/preview-builtin-effects branch from 04df163 to 50f410b Compare July 20, 2026 03:11
@bofeng-song bofeng-song removed the pending Not ready yet label Jul 20, 2026
@bofeng-song
bofeng-song requested review from knoxHuang and star-e July 20, 2026 03:47
@star-e
star-e merged commit c4d8132 into cocos:main Jul 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants