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

Object3D: Unify .userData check in toJSON(). #25026

Merged
merged 4 commits into from
Dec 6, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/core/Object3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,9 @@ class Object3D extends EventDispatcher {
if ( this.visible === false ) object.visible = false;
if ( this.frustumCulled === false ) object.frustumCulled = false;
if ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder;
if ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData;

// eslint-disable-next-line no-unused-vars
for ( const key in this.userData ) { object.userData = this.userData; break };
Hoodgail marked this conversation as resolved.
Show resolved Hide resolved

object.layers = this.layers.mask;
object.matrix = this.matrix.toArray();
Expand Down