Back to the Shapespark home page

Switch Object - API access

Hi,

We would like to create a 3D model where users can select the object they want to see in the space. E.g. toilets

We check that is possible to use switch object extension:

Does Shapespark API allow to switch objects from an external interface like a sidebar menu?
Also not possible to integrate an external 3D objects database with shapespark model by API?

Thanks in advance

The Switch Objects extension itself doesn’t have an API, but it’s built on top of the API functions described in: Hiding Object from html - #2 by wojtek.

It’s not possible to integrate external 3D objects. All the objects must be imported to Shapespark from the 3D modeling tool.

Hi @wojtek

Wondering if there has been any update regarding using the API to allow to switch objects from an external interface like a sidebar menu? And also to integrate an external 3D objects database with shapespark model by API?

Another question I have regarding the object switch is about the shadows, is using “isolate shadows”, the current recommend method to bake a scene with switch object situations?

Thanks

We don’t have any new API function in this area. However, as shown in Hiding Object from html - #2 by wojtek you can use the existing API functions underlying the Switch Objects extension to switch objects from an external interface.

Unfortunately, this is not possible, because the Shapespark viewer doesn’t support dynamic loading of 3D objects. All the objects must already be in the scene.

Yes, if the switchable objects occupy the same space, it’s recommended to bake them with “Isolate shadows” option enabled. Otherwise, the objects would shadow one another, or leave shadows that don’t match the scene.

@wojtek another question I have related to the switch object feature is if the hidden objects affect the performance? For example if we would have lets say 100 tables to choose from would the hidden tables affect performance or just loading times or neither?

We are running our own tests about this matter but would like to get your input also please.

Hidden objects will increase the download time and the memory consumption, so a scene with 100 tables may not open on some devices due to lack of memory. However, the hidden objects will not affect the frame-rate.

1 Like