Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Error when loading the json archive with Directional Light #28775

Closed
Stapxs opened this issue Jul 1, 2024 · 1 comment · Fixed by #28777
Closed

Editor: Error when loading the json archive with Directional Light #28775

Stapxs opened this issue Jul 1, 2024 · 1 comment · Fixed by #28777

Comments

@Stapxs
Copy link

Stapxs commented Jul 1, 2024

Description

PS: I'm not good at English.

I edited some content in editor and saved it, and some errors occurred when loading again. After some attempts, I found that when Directional Light exists, there will be an error related to light loading.

from: Menubar.File.js:126
Unhandled Promise Rejection: TypeError: this.light.target.updateWorldMatrix is not a function. (In 'this.light.target.updateWorldMatrix( true, false )', 'this.light.target.updateWorldMatrix' is undefined)

Reproduction steps

  • Create a Directional Light and add a cute little square
    image
  • Save JSON files
    image
  • Refresh the page and use the Open menu to reopen it
image

Code

This is the saved json for reference.
PS: In order not to make the issue very long, I didn't format it.

{"metadata":{},"project":{"shadows":true,"shadowType":1,"toneMapping":0,"toneMappingExposure":1},"camera":{"metadata":{"version":4.6,"type":"Object","generator":"Object3D.toJSON"},"object":{"uuid":"9f7c6aab-4458-4886-8465-1ab52badaa10","type":"PerspectiveCamera","name":"Camera","layers":1,"matrix":[0.9998000066665778,-4.336808689942018e-19,0.019998666693333174,0,0.005596813997585015,0.9600410097560497,-0.2798033867909052,0,-0.019199540166042257,0.2798593567965604,0.9598490079542865,0,-0.896677167456885,13.07028674480876,44.827880365645655,1],"up":[0,1,0],"fov":50,"zoom":1,"near":0.01,"far":1000,"focus":10,"aspect":1.3497536945812807,"filmGauge":35,"filmOffset":0}},"scene":{"metadata":{"version":4.6,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"3956dd09-81a0-4b7e-b0cb-35f3bd01cfe5","type":"BoxGeometry","width":1,"height":1,"depth":1,"widthSegments":1,"heightSegments":1,"depthSegments":1}],"materials":[{"uuid":"6f7e8e4b-9240-4256-8ff6-4a74a69b9ad5","type":"MeshStandardMaterial","color":16777215,"roughness":1,"metalness":0,"emissive":0,"envMapRotation":[0,0,0,"XYZ"],"envMapIntensity":1,"blendColor":0}],"object":{"uuid":"d3a8acfe-f4f8-4288-a8c4-c523f47f7828","type":"Scene","name":"Scene","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"up":[0,1,0],"children":[{"uuid":"c7d7da57-af95-47e1-b382-ae6f8548bbd5","type":"DirectionalLight","name":"DirectionalLight","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,5,10,7.5,1],"up":[0,1,0],"color":16777215,"intensity":1,"shadow":{"camera":{"uuid":"6ebd63bc-620b-425e-a1d9-7f39b32f4e3e","type":"OrthographicCamera","layers":1,"up":[0,1,0],"zoom":1,"left":-5,"right":5,"top":5,"bottom":-5,"near":0.5,"far":500}},"target":"19e1549e-34f7-4185-9a74-2a5457b4cfab"},{"uuid":"73a944ba-af2b-4f31-b1cd-ddc64c7058e8","type":"Mesh","name":"Box","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,2.0405986365459006,0,1],"up":[0,1,0],"geometry":"3956dd09-81a0-4b7e-b0cb-35f3bd01cfe5","material":"6f7e8e4b-9240-4256-8ff6-4a74a69b9ad5"}],"backgroundRotation":[0,0,0,"XYZ"],"environmentRotation":[0,0,0,"XYZ"]}},"scripts":{},"history":{"undos":[],"redos":[]},"environment":null}

Live example

Only need to test it in the officially provided Editor.

Screenshots

No response

Version

r166

Device

Desktop

Browser

Chrome

OS

MacOS

@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 1, 2024

Seems to be a regression of #28696. I have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants