Scene Exporter extension for Visualizer for Sketchup

Please check out VSE_VisualizerSceneExporter a new free extension on the warehouse. It provides a way to save Visualizer renders of Sketchup files with multiple scenes. You simply specify the amount of render time and the extension figures out where the Visualizer saves its images, renaming them with the scene titles. All the scenes in your file are automatically rendered.

Visualizer1.3 is the simplest way to create realistic photos with Sketchup and is also free. Just search for “visualizer” on the warehouse and you will find both extensions. VSE_VisualizerSceneExporter requires Visualizer for Sketchup to be already installed.

Happy rendering.

@LesterP, @ChrisFullmer
great idea, but…
Extensions that don’t run on a mac, shouldn’t be installable on a mac via the Extension Warehouse…
this should be part of the Trimble approval process that the register extension script does an OS check, inform the user of the issue and abort…
john

Agreed … There is a OS compatibility list in the extension page description so at least there is some indication.
Knowing it could be installed, I added a message dialog letting Mac users know the extension doesn’t work on OSX, but not allowing installation would be a better solution.

I ran into some technical issues on the Mac that causes unreliable results.
If there is enough interest from Mac users I can try harder to resolve them.

I use this on a couple of mine…

if (RUBY_PLATFORM =~ /darwin/i) > 0

  Sketchup.register_extension( add_icons_on_mac, true )

else

  UI.messagebox(
  "This code is for Mac only!" + "\n" +
  "It will not run on Windows or Linux" + "\n" +
  "Loading will now abort" + "\n" +
  "Contact the Author if you wish to port the source"
  )

end

The reason I looked at yours is I’m working on a similar idea, and hoped you had saved me the effort…
The binary options are available from SU ruby on a mac but they ‘may’ differ in the windows port…

I have another plugin that saves a set of pages [in a set of styles] for post composition and was going to add the Visualizer output to the mix, it’s mac only at the moment…

PM me at SketchUcation [username driven] if you want to discuss issues you had…
john

if (RUBY_PLATFORM =~ /darwin/i) > 0

  Sketchup.register_extension( add_icons_on_mac, true )

else

  UI.messagebox(
    "This code is for Mac only!" + "\n" +
    "It will not run on Windows or Linux" + "\n" +
    "Loading will now abort" + "\n" +
    "Contact the Author if you wish to port the source"
  )

end

I need to take issue with the above. It stops the SketchUp load process in it’s tracks, and displays a message that doesn’t really tell the user what plugin is causing the error message.

Better to either just raise some exception like LoadError (or your own subclass of it,) … or display the message in a non-modal WebDialog.

P.S.: the =~ method returns nil if no match is found, not 0 (which is a valid match at the beginning of the string.) It looks a bit awkward as you’ve shown it.

I’ve been switching to use the !~ method as it always returns true || false. I read the !~ as “does not contain”. Ie:

unless RUBY_PLATFORM !~ /darwin/i
  # load the Mac plugin
else
  # WebDialog Messagebox
end

or

if RUBY_PLATFORM !~ /darwin/i
  # WebDialog Messagebox
else
  # load the Mac plugin
end

For Windows only, I use the last form, and put all the Extension Registration initialization between the if and else. Then after the else, I usually just puts a (UI.start_timer delayed) message to $stdout (after calling for the console to open,) that the plugin is Windows Only.

It would be nice if the UI module had a nice non-modal error messagebox we could use during the application startup cycle.

@DanRathbun, that code is inside the plugins .rbz…
i.e. the user needs to deliberately load it, so should realise which plugin it is…
for EW I think it should be a server screening, it can’t be that hard to know what os version of SU is requesting the instal…

I like the not include code…
john

I know this,… but it will run each and every time SketchUp loads, in order to register the SketchupExtension instance object with the C side of SketchUp.
It does not run only the first time it is installed.

So, the next day, etc., if they do not manually remove it, they will get a message that says “this code”. I am just saying it should say “Plugin SuchandSoForth is Windows only. Please uninstall.”

I thought that it did. If the install is being done via the EW WebDialog within SketchUp, then it should not install. (Dumb if it does!)

The extension warehouse should prevent installs on incompatible OSs, but it doesn’t so I added in a message that it only works on Windows. Even though users could catch that in the page description its still a waste time to install only to realize after that fact that it doesn’t work. Luckily its a tiny application and takes seconds to install.

There are two unresolved issues on the Mac version.
One was that webdialogs, which require back and forth communication between ruby and the dialog, behaved erratically on Mac compared to windows. There has been discussions on using jquery as the message passing api to resolve the webdialog asynchronous behavior but I have not explored that approach.
Also Visualizer uses user defaults to store the latest image name path. Unfortunately defaults are synchronized to disk intermittently so I could not reliably get the current path string. The link below describes the issue.

user defaults can be force updated on a mac by calling a ‘read’ from ruby, so if you ‘write’ a new one, call ‘read’ then it’s updated…

equally, there is a lot of misinformation regarding WebDialogs on mac…
passing info back and forth does not require a js library, I think it’s contour productive…
all the possible versions of IE are harder to accommodate…

There are a few users as this point.
Any suggestions for improvements?

thanks