Hi,
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?
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.
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.
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.
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.