Embedded 3D Warehouse iframe events


I am embedding 3D warehouse models on my web site using the iframe embed code. This works superbly. I would like to be able to advance the scene of the embedded model programmatically with javascript when the user scrolls through some accompanying text. Unfortunately because of same-origin policies (my website is naturally not hosted on 3dwarehouse.sketchup.com), I cannot simulate a click of scene menu buttons programmatically, and because the 3D warehouse model javascript is minified, I cannot tell if there are exposed event handlers that would permit me to call a method cross-origin that changes the scene (I suspect not). Is there any way to get some API information about the iframe javascript code? Is whoever made that part of the SketchUp team?


@rchanley (ping Roy)

Hi @calocan. Sorry for the delay.

I took a look at the embedded viewer code, and right now, unfortunately, there’s no publicly-accessible way of changing scenes outside of our provided UI. :frowning:

I have documented this in a feature request ticket, though. That’s no guarantee that it will ever be completed, but it is in the system now. :slight_smile:

Hi Roy,

Thanks so much for answering this question. I’ll have to try to get around the problem some other way. I get the feeling that my.sketchup will make programmatic interaction with the 3D models on the web all the more relevant, so I hope the embed code continues to receive updates. I’m already thrilled that it so accurately depicts my Sketchup models. One other thing I’ve noticed in the lately is that the embed code doesn’t properly change layer visibility when you switch scenes by clicking (maybe the layers are all combined). I take advantage of hiding layers when I switch scenes, so I’d appreciate it if you could add a ticket for that as well.