Wraps toJSON so that the userData keys that start with __ (runtime state, like __isMainCamera) are not
saved, at every depth, like on clone. The keys that start with _ are saved in JSON (they are left out only in
glTF, see GLTFWriter2). See IObject3D.userData.
During the original toJSON, userData is replaced with the copy from copyUserData, so every part of
the output that comes from userData has no __ keys: object.userData from three.js Object3D.toJSON, and
userData from @serialize (like in PerspectiveCamera2). Children are saved through their own toJSON.
The object keeps its userData object.
Wraps
toJSONso that the userData keys that start with__(runtime state, like__isMainCamera) are not saved, at every depth, like on clone. The keys that start with_are saved in JSON (they are left out only in glTF, seeGLTFWriter2). See IObject3D.userData.During the original
toJSON,userDatais replaced with the copy from copyUserData, so every part of the output that comes fromuserDatahas no__keys:object.userDatafrom three.jsObject3D.toJSON, anduserDatafrom@serialize(like inPerspectiveCamera2). Children are saved through their owntoJSON. The object keeps itsuserDataobject.