-
Notifications
You must be signed in to change notification settings - Fork 135
Closed
Description
Problem
When migrating legacy materials, the migration code sets data.shader to 'blinn' instead of unsetting it. This causes a validation error in the collab-server because the shader field is not defined in the material data schema.
Error
C3 Validation Error at: data.shader
The operation tries to set data.shader from "phong" to "blinn", but the schema doesn't recognize this field.
Root Cause
In src/editor/assets/assets-migrate.ts, the comment says "remove shader" but the code actually sets it:
// remove shader since physical material is now the default
if (asset.has('data.shader')) {
const shader = asset.get('data.shader');
asset.set('data.shader', 'blinn'); // BUG: should be unset
...
}Compare this to how fresnelModel is correctly handled just below:
// remove fresnelModel since it is now always set to schlick
if (asset.has('data.fresnelModel')) {
const fresnelModel = asset.get('data.fresnelModel');
asset.unset('data.fresnelModel'); // Correct
...
}Fix
Change asset.set('data.shader', 'blinn') to asset.unset('data.shader') to be consistent with how other deprecated fields are handled.
Metadata
Metadata
Assignees
Labels
No labels