Material and scene info

Hi,

I have several questions considering the data which can be extracted from API.

1.a) When we set the Material picker for an object, is it possible to somehow get the information about how many times users clicked on certain material?
1.b) Same question goes for Scenes. Is there a way to get info about how many times users clicked on certain scene?
2. Other related question is can we get the info about last users settings (materials selected by Material picker for each object and/or last clicked Scene)?

If there is any way to do these please provide some instructions how it can be done. We couldn’t figure it out form this documentation GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene.

Thanks!

1a. This is not documented but you can use the following code Detect which material was selected by the material picker · GitHub to be notified about material selection.

2b. I understand that by Scenes you refer to Views from the Shapespark editor. Is this the case? The onViewSwitchStarted function from the API documentation: GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene. allows to detect when the user clicks on a view.

Based on these two callback you would need to implement own counting logic to gather information how many times each material/view was selected. The same applies to 2, if you would like to store the last user selection, you would need to implement the storing logic based on the information from the two callbacks.

Thanks Jan! We will try that and see how it works.

p.s. Yes, I meant Views.

1 Like