Is it possible to track clicks on material picker extensions and override their behavior?

Hi team,

I’m working on a customized Shapespark integration embedded in an iframe. My goal is to have full control over the material selection process so that I can integrate it seamlessly with my own UI logic.

Specifically, I would like to:
:white_check_mark: Detect when a user clicks a material picker extension provided by Shapespark (for example, the default material spheres that appear when a material is editable).
:white_check_mark: Optionally prevent the default material picker options menu to open up on clicking the material picker icon.
:white_check_mark: Instead, handle the selection event myself.

Questions:

  1. Is there any way to track or listen to clicks on the material picker extensions (the built-in material picker extension in the UI)?
  2. Is there any supported mechanism to override or disable the default behavior and replace it with custom logic?
  3. If not directly supported, are there any recommended workarounds for achieving this level of control?

Any advice, examples, or best practices would be much appreciated.

Thank you!

For full control building a custom material picker might be easier than customizing the built-in one.

To detect object clicks you can use onNodeTypeClicked, see: GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene..

To detect material clicks you can use onMaterialClicked, see: 'findmaterial' script doesn’t work.,,, ㅜ - #2 by kamil, provided that the material is marked as editable, see: GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene.

To change a material on an object you can use setMaterialForMesh, see: How to emulate the Material picker via the API