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

AttributeNode: Fix serialization/deserialization. #28944

Merged
merged 1 commit into from
Jul 23, 2024
Merged

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jul 23, 2024

Related issue: #28943

Description

The serialization/deserialization of node materials relying on AttributeNode fails at the moment.

Fiddle for reproduction: https://jsfiddle.net/anqx4whk/

The PR overwrites Node.serialize() and Node.deserialize() and honors the missing properties.

@sunag Is this the right approach? When I understand the code in the upper class correctly, private properties and properties holding primitive values are not honored so far and must be handled in the sub class.

Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
684 kB (169.4 kB) 684 kB (169.4 kB) +0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
460.9 kB (111.2 kB) 460.9 kB (111.2 kB) +0 B

@sunag
Copy link
Collaborator

sunag commented Jul 23, 2024

@sunag Is this the right approach? When I understand the code in the upper class correctly, private properties and properties holding primitive values are not honored so far and must be handled in the sub class.

Exactly, it serializes only public nodes by default.

@sunag sunag added this to the r167 milestone Jul 23, 2024
@sunag sunag merged commit 6b4af05 into mrdoob:dev Jul 23, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants