Serializing any Object3D with nested NodeMaterial throws error
See original GitHub issueDescribe the bug
As the toJSON
method on a THREE Node expects a nodes
field in the meta object, it throws an error if the meta comes from an Object3D which never supplies that field.
To Reproduce
Steps to reproduce the behavior:
- Setup a simple THREE project
- Add a mesh to the scene with a NodeMaterial
- Serialize scene using
scene.toJSON()
Live example
Expected behavior
Object3D should serialize just fine. Solution would be to include a nodes
field in the default meta-object.
Platform:
- Device: [Desktop, Mobile]
- OS: [Windows, MacOS, Linux, Android, iOS]
- Browser: [Chrome, Firefox, Safari, Edge]
- Three.js version: 0.125.2
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
C# Invalid Option Error deserializing nested dynamic object ...
1 Answer 1 ... Wait, you want to go from an object to a string? That's serialization, no deserialization. Also, if you read...
Read more >Error loading Node Material that contains VectorMergeBlock
I'm getting a exception thrown when loading a Node Material either using loadFromSerialization or loadAsync.
Read more >https://ondoc.logand.com/d/7164/txt
This includes datatype conversion, error checking, state tracking, ... Structured clone is roughly equivalent to serializing an object to JSON and then ...
Read more >Untitled
Contribute to timoxley/threejs development by creating an account on GitHub. ... all of the morph frames into my geometry, I'm having trouble getting...
Read more >Bug - Recursive Nested Serialization does not work with ...
I get an error must be a non-nullable type when using nested serialization with network variables. Expected: Nested serialization works per ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Mugen87 Thanks for clarifying. I managed to get an alternative workflow up and running using the NodeMaterialLoader. However, TypeScript definitions for NodeMaterialLoader seem to be missing. Let me know if you want me to track that separately.
Merging this issue into #16440.