I’m looking for a way to export all the scenes in my model at once, with predefined parameters (size, line scale multiplier, anti-aliasing and jpg compression), and using the scene names as file names. I don’t understand why such a basic feature isn’t standard in Sketchup.
I’ve heard of the Eneroth Scene exporter plugin, but I can’t find it.
I tested the s4u Export Scenes plugin, I thought it was free as indicated on the warehouse extension, but it’s not.
I tested with the script below, but the jpg compression doesn’t seem to work and the script doesn’t export all the scenes. I do get the success message at the end, informing me that all the scenes have been exported, but that’s not the case, I’m missing half of them.
model = Sketchup.active_model
path = UI.select_directory(title: "Select Folder for Export") # Choisit le dossier de destination
if path
model.pages.each do |page|
file_name = File.join(path, "#{page.name}.jpg") # Définit le nom du fichier avec l'extension .jpg
options = {
:filename => file_name,
:width => 5120, # Largeur de l'image exportée
:height => 2590, # Hauteur de l'image exportée
:scale_factor => 0.5, # Multiplicateur d'échelle de ligne
:antialias => true, # Active l'anticrénelage
:compression => 8 # Niveau de compression JPEG (8 sur une échelle de 1 à 10)
}
model.pages.selected_page = page # Sélectionne chaque scène
model.active_view.write_image(options) # Exporte l'image de la scène avec les options définies
end
UI.messagebox("Exportation terminée!")
else
UI.messagebox("Aucun dossier sélectionné!")
end
Thanks for the plugin, it works well, but unfortunately it doesn’t allow you to choose some export parameters, like image size or line scale multiplier which is important for me.
However, i realized that i had the same problem with this plugin as with the ruby script (see my first post) : not all scenes export ! I’ve got 14 scenes in my 3D model, but only the first 8 export, whether with the script or the plugin.
Idea:
If you have screen text that appears on that particular scenes and you did not answered “Yes”
for : “Prompt for each scene?”. Or that particular scenes are not Include in animation (aka: the Scene name in the scene tab is between parenthesis), perhaps it will not exported.
(BTW. You can put similar options to sceneExporter.rb )
Unfortunately, this is a professional project and i don’t have permission to share the model.
I don’t have any text in the scenes, and they’re all in animation. In fact, when i export all the scenes via File > Export > Animation, in jpeg, with a frame rate of 1/sec, i have all the scenes exported. This solution has worked fine for me up to now, it’s just that i now need to have the scene names as file names.
Once again, like so many other things, i don’t understand how something so basic isn’t integrated into Sketchup by default !
How do i set similar options with sceneExporter.rb ? When i go to View > Export scenes to JPG, i have no choice.
I tested your plugin, very nice work ! and the ideas are very interesting. Maybe the jpeg compression is missing and setting the line scale multiplier to 0.5 doesn’t work.
However, i have the same problem as with the other plugin or with the ruby script in my first message : of the 14 scenes in my model, only the first 8 export. I do get the success message at the end. Only by going to File > Export > Animation do all the scenes export. I don’t get it !
Edit : i’ve just tested it with other models with more than 10 scenes, and everything works fine. The export problem comes from my file, but i can’t see what’s preventing the last scenes from being exported.