Automatic Add name of Scene in export 2D

Pleasy
put add name of Scene in export 2d .

For exemple, scene have name green… name file test.

to export to 2d, will have name test-scene-Green.jpg

to undestand, check picture.
thanks
Eder
Brazil

5 Likes

Yes, I agree this feature would be quite handy . I do lots of 2d export each day : (

1 Like

LayOut was invented to prevent having to do lots of 2d exports.

1 Like

Basically, exactly why this extension was created.

2 Likes

LayOut will recognize scene names if you have a standard way of naming your scenes in SketchUp and match it with a template with the same named-views in LayOut, so you can do more than one SketchUp view per page. The only issue is the camera position on the model used to create your template versus the new model you send to LayOut: it may need a slight adjustment to adjust zoom between models.

Nope…

I’ve thought of this too. Since the default name shown in the Save As-dialog is just a default and nothing you are forced to use this feature doesn’t even need it’s own user setting; it can be permanently enabled.

When making a proper presentation or drawings and the like Layout really is the best way to go, no questions about it, but for fast export of simple 2D images, e.g. to mail to a client, native SketchUp is faster.

1 Like

We use InDesign to make the pages on which scene exports go because they are just a portion of what could be a 100 page document. I do everything in my power to avoid using LayOut, a finicky and imprecise document tool that, for us, is a cumbersome middle-man.

I use Export > Animation to get all my scenes as jpegs in one go, and the only problem is the images are exported as 0001, 0002, etc. instead of scene name. So if you reorder scenes or add new ones, re-exporting scenes this way won’t line up.

There doesn’t seem to be a reason not to allow pro users to just export an image set from SketchUp with a simple naming convention like “Model - SceneName”. There are extensions that do this, but it should be a native feature.

2 Likes

We get it both ways: if we did this instead of using LayOut, then people would ask why we’re duplicating effort for behavior that’s already in LayOut.

1 Like

@Barry
Unless I’m mistaken, this is not a feature in LayOut either? LayOut recognizes scene titles to make viewport windows, but exporting LO files as a pdf/jpg/png doesn’t include the scene title in the file name in it either. Multipage exports have the same Name_01, Name_02, etc. behavior.

Again, if I can avoid LO I will. It has every bell and whistle we don’t need and is missing every bell and whistle we do need (including having scene titles in the file name). If the added feature has to go to LO instead of SU fine, but please implement it somewhere.
[/quote]

1 Like

Naming LO pages after SU scenes makes little sense as a page can have any number of viewports showing any number of scenes.

I agree though that images exported from SU could include scene name, and that SU’s 2D export in general could get some attention. LayOut is good when you actually want to make a layout. SketchUp’s own 2D export should in my view be sufficient when you only want simple exports. I don’t think users who don’t want to add custom labels, dimensions, title blocks etc in LayOut should have to take a de-tour though LayOut.

4 Likes

it is relatively easy to do using a Ruby script…

model  = Sketchup.active_model
scenes = model.pages
@view  = model.active_view
def scene_img(name)
keys = {
  :filename => "/tmp/#{name}.png",
  :width => 640,
  :height => 480,
  :antialias => false,
  :compression => 0.9,
  :transparent => true
}
  @view.write_image keys
  Sketchup.send_action('pageNext:')  ## Next Scene

end

scenes.length.times do |s|
  name = scenes.selected_page.name
  scene_img(name)
end

you will need to set transition Time and delay to none/zero, and alter the path to your local drive, etc…

john

1 Like

Like you said, this is not for people who need to do something in Layout. I only suggested that because @Barry mentioned LO, which I had to clarify doesn’t do what this feature request is asking for.

@john_drivenupthewall THANK YOU! Based on what I can see the code does exactly what this thread is getting at. I’ll test it out later today.

here’s a variation that avoids the send action [which is frowned upon by some]…

model  = Sketchup.active_model
scenes = model.pages
@view  = model.active_view

def scene_img(name)
	keys = {
		:filename => "/tmp/scenes/#{name}.png",
		#:width => 640,
		#:height => 480,
		:antialias => false,
		:compression => 0.9,
		:transparent => true
	}
  @view.write_image keys
end

scenes.each do |s|
  scenes.selected_page = s
  name = s.name
  scene_img(name)
end
3 Likes

John, I assume one can edit the width and height as needed. Is there a way to code it so the export size is proportional to the viewport size and only the width need be specified like the default image exporter works?

My penny’s worth… I would welcome this option.

95% of my Sketchup use is for landscape and architectural illustrations. I export 2D png files named like the following examples: BlaaBlaa SC1 Edges, BlaaBlaa SC1 Shadows, and BlaaBlaa SC1 Colour selection, where SC1 is ‘scene number one’. This is pretty standard… It allows use of the edges and shadows as separate layers in a drawing photo editing software (Photoshop, Affinity Photo etc…) and the selection of areas of the drawing to be masked using the colour selection.

This would save time for sure. In fact if the export 2D options could have tick boxes for ‘include file name’ AND/OR ‘include scene name’ this would be even better…

5 Likes

if you comment them out [as in my second example] it uses your viewport sizes…

you need none or both to keep the ratio…

with extra code you can upscale etc…

		:width => @view.vpwidth*2,
		:height => @view.vpheight*2,

and add a button. menu item, shortcut key, …

john

2 Likes

I added a chosen_folder prompt for flexibility

model  = Sketchup.active_model
scenes = model.pages
@view = model.active_view
@path = chosen_folder = UI.select_directory(title: "Select Export Folder")	

def scene_img(name)
  keys = {
    :filename => "#@path/#{name}.png",
    :antialias => true,
    :compression => 0,
    :transparent => true
  }
  @view.write_image keys
end

scenes.each do |s|
scenes.selected_page = s
name = s.name
scene_img(name)
end
4 Likes

Hi John! I just found out your script and I am amazed with the results. The only thing is that I can’t code and when I try to add your extra code to control the dimensions of the output I get a warning. Where exactly should I place it? And how can I say that I want my export to be 4000 px wide?

I figured it out:

model  = Sketchup.active_model
scenes = model.pages
@view = model.active_view
@path = chosen_folder = UI.select_directory(title: "Select Export Folder")	

def scene_img(name)
  keys = {
    :filename => "#@path/#{name}.png",
    :width => 3000,
    :height => 1688,
    :antialias => true,
    :compression => 0,
    :transparent => false
  }
  @view.write_image keys
end

scenes.each do |s|
scenes.selected_page = s
name = s.name
scene_img(name)
end
1 Like