-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
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
LightProbe: Add support for serialization/deserialization. #18966
Conversation
@@ -26,7 +28,6 @@ LightProbe.prototype = Object.assign( Object.create( Light.prototype ), { | |||
Light.prototype.copy.call( this, source ); | |||
|
|||
this.sh.copy( source.sh ); | |||
this.intensity = source.intensity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intensity
is already copied in Light.copy()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a FYI, seems like @WestLangley is thinking of removing that inheritance. #18371 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sharing, good to know! Should I keep the code as it is now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so -- for now.
I forgot I did that. 👴 |
@@ -36,7 +46,7 @@ LightProbe.prototype = Object.assign( Object.create( Light.prototype ), { | |||
|
|||
var data = Light.prototype.toJSON.call( this, meta ); | |||
|
|||
// data.sh = this.sh.toArray(); // todo | |||
data.object.sh = this.sh.toArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data.object.sh
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, check out Light.toJSON()
:
Line 44 in df2b31f
data.object.intensity = this.intensity; |
Thanks! |
After 21e3eab, serialization/deserialization is now easy to add.