[Solved] What is Object3D type used for?

Hi. I would like to understand what exactly is Object3D type used for?

I have looked at the doc page of Object3D, but there’s no mention of it.

I’m extending Object3D (and Mesh) to create my own subtypes of objects and would like to understand if it’s safe to overwrite that value, just like SkinnedMesh does for instance?

Thanks :slight_smile:

It is relevant for serialization/deserialization. ObjectLoader uses this property at various places, e,g

1 Like

Perfect, thank you! :slight_smile: I guess I should stay away from touching it then :smiley:

If you don’t need serialization/deserialization, just ignore it.

Thanks @Mugen87 ! I think I’ll actually try making use of serialization. I’m working on a diagramming tool and using THREE for the graphics. I initially thought I’d have to come up with my own JSON format and then found THREE already has that. So with little luck I should be able to leverage that for project saving/restoring \o/

It should probably be in the docs - I added this in for most other objects but but must have missed this one.

By the way, there are other times you might want to use the isXXX properties.In the FBXLoader example isMesh is used enable shadows for any child meshes:

Hi @looeee ,

Aren’t these two things different though? To be precise, I was asking about the objectInstance.type member field.

Have a nice day!

Oh, you’re correct. Sorry!