Open Temdog007 opened 5 years ago
I vote for suggestion 3 since I still think it's the most consistent approach. ObjectLoader
can exactly restore the geometry objects which were previously part of your scene. From my point of view, this is the most expected result of a serialization/deserialization workflow.
a vote for suggestion 3. what else can i expect if i 'd like to serialize edgesGeometry in worker?
Any updates on this...? I am still seeing the following error when attempting to import EdgesGeometry in latest version (0.146.0)
"TypeError: Geometries[data.type].fromJSON is not a function"
I've mentioned this elsewhere but I believe it was a mistake to introduce EdgesGeometry
and WireframeGeometry
. Both are actually helpers (since they visualize other geometry data) and should be EdgesHelper
and WireframeHelper
.
The support for helpers in ObjectLoader
is tracked in #15714. You essentially need similar logic for EdgesGeometry
and WireframeGeometry
like for camera or light helpers since you have to deserialization other objects first before you can process helpers.
Description of the problem
Currently, there are geometries in THREE JS src that are not de-serializable.
EdgesGeometry
ParametricGeometry
TextGeometry
InstancedBufferGeometry
WireframeGeometry
There are 2 main reasons for this issue.
ObjectLoader
doesn't handle these types. Every geometry has atype
property which is the name of the geometry.ObjectLoader
uses this to determine how to de-serialize the JSON.parameters
property.Based on @Mugen87's comment, it sounds like increasing the complexity of
ObjectLoader
is undesirable. However, these geometries are currently serialized in a way where they can't be de-serialized.My suggestion would be one of the following:
Make these geometries serialize as normal
BufferGeometry
and send a warning saying such.};
ObjectLoader
handle these geometriesRelated #16026, #16087, #14357
Three.js version
Browser
OS