Back to the Shapespark home page

2 action on one click possible?

wanted to have two actions happening when clicking on an object. Is that possible? I added two extensions, one opening an url when clicking on an armchair and another extension moving the camera to the armchair when clicking on it. Sadly that does not work. Shaespark viewer always only uses the first trigger and does not check for the same trigger which is next in the list.

Any ideas? Can this only be solved by a script extension?

Best regards,

1 Like

Unfortunately this isn’t possible. Without any triggers clicking an object moves the camera in this object directions. Extensions stop propagation of the click events no prevent this default action. The way the extensions are now structured, it is not possible to determine if there is any other extension with the same trigger object and to propagate the click event in such case.

Sad news. How can multiple events than be triggered?

1 Like

In your case a single script extension with a trigger should be able to do it. The script code would be something like:


1 Like

cool, will give that a try!

wasnt succesfull, what is wrong in my script:


The camera is named Sessel and I replaced the webadress to a simply adress to be sure that there is no error.

Any help appreciated,

Which kind of quotation marks do you use? Both "" and '' should work, but for example `` will fail.

I copied them from your reply… will reedit an use "

Sorry about this, looks like forum formatting replaced them.

Works great, thx a lot! If I wanna achieve a mouse over effect, I cant achieve that with an extension right?

I achieved the mouseover effect by adding a script in the body-end.html.

sorry one more question, if I want to open the webpage as an iframe and not as an extra tab, how must I modify your code?

iframe is more difficult. You would need to add and position a hiden iframe in your body-end.html and make it visible from the script extension. For this to be usable you would also need some close button for the user to be able to close the iframe, so it would be quite a bit of HTML, CSS and JavaScript work.

wow, that sounds too complicate for me, thx a lot for your help jan!

sorry it is me again. The thing with the two actions triggered by one click works great. Is it also possible to open a html label (I have prepared in the extensions) instead of a webpage?

Unfortunately HTML labels cannot be opened through the viewer API. You’d have to create your own HTML pop-up in body-end.html, and make it visible from the script - in a similar fashion that Jan descibed a few posts above for an iframe.

Could a 3D pop-up being a scene object with a texture, hidden by default, work for you? It would be easy to make the 3D pop-up visible in a script.

1 Like

Hi Wojtek,
thanks for your quick and constructive reply. Yes that could sometimes be a solution. How can I unhide and hide objects with such a script?

But this solution has some drawbacks. The good thing with html popups are that I can easily edit tham and if I change the design in the bodeyend.html all of them will be changed automatically, that would not be the case with 3D objects (with a text
texture on it?). Moreover everytime I want to add a text object I have to reexport the scene out of max, what results in loosing the light calculation which takes in my actual scene several hours.

Use node.hide() or methods, as described in: Hiding Object from html

Hi Wojtek, ok thanks a lot!

Hey, I’d like to move camera and trigger an audio file at the same time. I’m guessing the first part is


but how about the latter one?