You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constmesh=newTHREE.Mesh(newTHREE.BoxGeometry(),newTHREE.MeshPhysicalMaterial())console.log(mesh.material.attenuationDistance);// Infinity (correct)constjson=JSON.stringify(mesh.toJSON())constx=newTHREE.ObjectLoader().parse(JSON.parse(json))console.log(x.material.attenuationDistance);// null, but it should be Infinity
Describe the bug
Live example
Expected behavior
Serializing and deserializing should preserve the material appearance.
Probably we should avoid exporting
attenuationDistance
when it's equal to Infinity (the default value).Related issue: #24622
Screenshots
I noticed this issue by exporting and re-importing a MeshPhysicalMaterial from the editor.
Attenuation distance is
NaN
after importing model.json with MeshPhysicalMaterial (with transmission = 1, roughness ~=0)Platform:
The text was updated successfully, but these errors were encountered: