[Plugin] Snapshot – (1.0.1) — updated 09.10.2012

[Plugin] Snapshot – (1.0.1) — updated 09.10.2012

Postby Aerilius » Tue Oct 02, 2012 7:12 pm

Off-Topic:
This plugin is superseded by the extension "Toolbar Editor".
It allows to create your own toolbar buttons for whatever function you want, in exactly the way you want.
You can achieve the snapshot function by pasting into the code field:

Code: Select all
filepath = UI.savepanel
view = Sketchup.active_model.active_view
keys = {
  :filename => filepath,
  :width => view.vpwidth,
  :height => view.vpheight,
  :antialias => true,  # or false
  :compression => 0.9, # Only for jpeg
  :transparent => true # Only for png
}
view.write_image(keys)


This plugin allows to take large snapshots for SketchUp files with configurable one-click buttons.
screenshot_toolbar.png

You can set it up to save automatically an image of a model whenever it is saved, or by clicking on a toolbar button. Click the gear button to add more toolbar buttons or change for each the image export settings.

ae_Snapshot_1_0_2.rbz


Version: 1.0.2

Date: 25.10.2012

Usage:
View → Toolbars → Snapshot

screenshot_dialog.png


History:
version 1.0.2: 25.10.2012
- improving height of webdialog
- toolbar buttons take most setting changes
version 1.0.0: 08.10.2012
- stable release
version 0.3.1: 07.10.2012
- bug fixes
version 0.3.0: 07.10.2012
- bug fixes
version 0.3.0: 06.10.2012
- toolbar buttons are fully customizable and each have their own settings
version 0.2.0: 05.10.2012
- added more options
version 0.1.1: 03.10.2012
- fixed a bug to make it work in all SketchUp versions
version 0.1.0: 02.10.2012
- first release
0
Last edited by Aerilius on Tue Nov 11, 2014 11:09 am, edited 10 times in total.

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby glro » Wed Oct 03, 2012 9:11 am

i couldn' select a custom folder to store the thumbnails, through the "select" button, but i did it by typing th whole name of the folder

i couldn't either remove the '+' and '-' buttons, even un checking the option in the snapshot settings

but these are minor problems

because this plugin might fulfil a basic need, something i have been missing in my daily experience of sketchup: the need to retrieve a model lost among thousands of files.

This is how i imagine to proceed:

> i store all the thumbnails in a specific folder, always the same

> when i look for a sketchup model, i browse this folder, viewing big thumbnails

> when i have found the thumbnail i am looking for, i copy the file name (without suffix), move to the folder i think the sketchup file should be, and paste it in the "search file" windows

> windows file browser will find it

An extension to the plugin might be a button that would open a specific file browser (like Xnview) and by looking through the thumbnails, would open the sketchup model by clicking on the thumbnail
0

glro 
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby simon le bon » Wed Oct 03, 2012 9:59 am

Dear Aerilius,
Thank you so much and "bravo" for this wonderful plugin that I'm sure people are going to use intensively :thumb: :thumb: :thumb: :ecstatic:

The start of the discussion begins here:
[Request]Snapshot With File Name button

As this above thread is now closed, may I post here the last post I had made !



simon le bon wrote:
glro wrote:i don't understand the meaning of "save the name-1" and "save the name "+1"..


That means that you can take not only one but a series of snapshots of the same model. They take the same file name + an incrementation. Basically you are going to use "save the name "+1"

Aerilius_Snapshot.skp is then accompanied with
Aerilius_Snapshot1.png
Aerilius_Snapshot2.png
Aerilius_Snapshot3.png

The "save the name-1" is less evident. Previously I thought it was adding at the end of the file name a decrementation -1 -2 -3 etc..
This was very foxy, using it with an already incremental set of skp

if this was the skp set,
Aerilius_Snapshot.skp
Aerilius_Snapshot1.skp
Aerilius_Snapshot2.skp
Aerilius_Snapshot3.skp

The Snapshots set was

Aerilius_Snapshot-1.png
Aerilius_Snapshot-2.png

Aerilius_Snapshot1-1.png
Aerilius_Snapshot1-2.png
Aerilius_Snapshot1-3.png

Aerilius_Snapshot2-1.png
Aerilius_Snapshot2-2.png

etc...

But "save the name-1" don't work this way. It decrements an existing incrementation. And when there is no digit at the end of the file:

Aerilius_Snapshot.skp gives
Aerilius_Snapshot-1.png and after "save the name-1" overwrite this picture.. :?: :roll:

_____________________________________________________


About incrementation, there is the classic method and a better foxy one, developed here into the forums, but impossible to me to find it back (I was sure I had bookmarked it :( )

*>The Classic one consists to save your WIP model with an incrementation. The most up to date one takes the higher number.
Basically it is the set I was using above

Aerilius_Snapshot001.skp
Aerilius_Snapshot002.skp
Aerilius_Snapshot003.skp

disadvantages are: you can never be sure what really is the last file. Perhaps you worked in the office and at home, perhaps you have some files stored in another folder, perhaps a collaborator has worked on a new version, etc. ..

*>The foxy method works with the file option " Save a copy as "

This option offers to save the file you are working on with an incrementation but without updating the name of your model on screen.

Using this option, the last and most updated model can be always the first one :!: :!: :mrgreen: :ugeek:

Aerilius_Snapshot_00.skp is saved and also a "Save a copy as" is saved
Aerilius_Snapshot_001.skp

At the next step of the drawing, as you are always working on the "00" one, another "Save a copy as" is saved:
Aerilius_Snapshot_002.skp

etc..

Very clever indeed no ?

@Aerilius

What I can regret is that this "Save a copy as" doesn't generates a Snapshot when Autosave is checked.


:) simon
0
User avatar
simon le bon 
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby simon le bon » Wed Oct 03, 2012 10:07 am

~~ content outdated --> erased ~~~
0
Last edited by simon le bon on Tue Oct 09, 2012 11:31 pm, edited 1 time in total.
User avatar
simon le bon 
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby Aerilius » Wed Oct 03, 2012 11:17 am

It now works also in SketchUp 7 (there was a very small error that prevented that completely). The toolbars can only be changed when SketchUp is opened again (we cannot do anything about that).


glro wrote:An extension to the plugin might be a button that would open a specific file browser (like Xnview) and by looking through the thumbnails, would open the sketchup model by clicking on the thumbnail

That would require to know from a thumbnail's name where the skp file is located, but it's difficult if all thumbnails are in the same folder. Better would be to integrate the large thumbnails in the operating system's thumbnail system (but I don't know how to do that on Windows, as far as I understand it would require C programming).


simon le bon wrote:The "save the name-1" is less evident. Previously I thought it was adding at the end of the file name a decrementation -1 -2 -3 etc..

Sorry, I had understood it would decrease the number (to redo older images). So instead of a minus button, you would prefer something like "increase primary version number" and "secondary version number"?


simon le bon wrote:What I can regret is that this "Save a copy as" doesn't generates a Snapshot when Autosave is checked.

That would be good! Unfortunately the SketchUp Ruby API tells us only what model is saved, not where. So I can get the location of the working model, not of "Save as". Good request for a next SketchUp version!
Tell me when you find out more about the "The foxy method"...
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby driven » Wed Oct 03, 2012 1:47 pm

Works on mac,

to attach to the skp file...
Take your picture,
then >> right-click on the SU title >> select the containing folder >> select the new png >> right-click >> services >> create icon and preview [need GraphicConverter installed] >> click on same_name.skp >> right click >> more info >> drag the same_name.png icon onto the more info box icon [top left] >> close more info.

enjoy in coverflow.
john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby glro » Wed Oct 03, 2012 1:49 pm

thumbnails must all be in the same folder, to create a data base from which the user can search for a skp file

C, or java programming would be needed, yes; to create a special file browser hat would add a meta data (the link to the skp file)

Xnview can add meta dat, but the link tothe file is not active
0

glro 
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby glro » Wed Oct 03, 2012 2:04 pm

Aerilius wrote:
glro wrote:An extension to the plugin might be a button that would open a specific file browser (like Xnview) and by looking through the thumbnails, would open the sketchup model by clicking on the thumbnail

That would require to know from a thumbnail's name where the skp file is located, but it's difficult if all thumbnails are in the same folder. Better would be to integrate the large thumbnails in the operating system's thumbnail system (but I don't know how to do that on Windows, as far as I understand it would require C programming).
...


maybe just a shortcut to the skp file, created by the pluging when the picture is taken, and stored in the same folder
is it possible to create a shortcut to a file using ruby?
0

glro 
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby Aerilius » Wed Oct 03, 2012 2:41 pm

driven wrote:Works on mac

Great! I think there was once a discussion about integrate better thumbnails on OS X, as far as I remember that would require XCode and Objective C (?). I couldn't do it and can't test it.
If GraphicsConverter has a command line interface, that would make it much easier!

glro wrote:C, or java programming would be needed, yes; to create a special file browser hat would add a meta data (the link to the skp file)

That would be almost reinventing the wheel ;-) . I would prefer using the system's thumbnailing (Windows Vista+ uses a thumbnail folder and a database). We would need to register a thumbnail to the database. As far as I know, there are only APIs for C(++, # ...) and I have not enough experience. I will see if someone else can help me, or if we can get equivalent improvements into SketchUp.

glro wrote:is it possible to create a shortcut to a file using ruby?

That might be a the easiest solution! I'll try it!
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby ken » Wed Oct 03, 2012 3:22 pm

Aerilius

Would it be possible to make the selection to save, such that I can save in a "custom folder" and the "same Folder as skp" at the same time. This way I would have the master png's in my custom folder and work related png's at the skp's folder.

If I know the work related folder, I would just browse at that location, if I wasn't sure or was looking for something that I haven't worked on for some time, I could go to the custom folder.

Also, I could print out a contact sheet for the custom folder for a hard copy.

So this morning, I have been opening and saving skp files to get my master folder up to date.

Thank you for this very helpful plugin.

Ken
0
Fight like your the third monkey on Noah's Ark gangway.
User avatar
ken 
Premium Member
Premium Member
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby driven » Wed Oct 03, 2012 3:43 pm

Aerilius wrote:If GraphicsConverter has a command line interface, that would make it much easier!

It does, and it's free[if your scint], you can also use it to extract the SU thumbnails from the .skp, but it's a bit random when Sketchup saves that, unless you want the silly 'styled' frame you get with 'save thumbnail'

I'll dig out the command line flags. an applescript wrapper might swap the icons...

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby bagatelo » Wed Oct 03, 2012 6:09 pm

There should be an option to enter the date and time automatically in the file name.
Thanks for this great tool.
0
While the cat's away, the mice will play
User avatar
bagatelo 
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby glro » Wed Oct 03, 2012 6:33 pm

Aerilius wrote:
driven wrote:Works on mac

Great! I think there was once a discussion about integrate better thumbnails on OS X, as far as I remember that would require XCode and Objective C (?). I couldn't do it and can't test it.
If GraphicsConverter has a command line interface, that would make it much easier!

glro wrote:C, or java programming would be needed, yes; to create a special file browser hat would add a meta data (the link to the skp file)

That would be almost reinventing the wheel ;-) . I would prefer using the system's thumbnailing (Windows Vista+ uses a thumbnail folder and a database). We would need to register a thumbnail to the database. As far as I know, there are only APIs for C(++, # ...) and I have not enough experience. I will see if someone else can help me, or if we can get equivalent improvements into SketchUp.

glro wrote:is it possible to create a shortcut to a file using ruby?

That might be a the easiest solution! I'll try it!


There is a simple way: creating a batch file, for example:
"@ECHO OFF
call F:\000_experience.sauvb\programmation\ruby\essai_plateforme.skp
end"

this opens the console
to avoid opening the console, write a second file

"var WindowStyle_Hidden = 0
var objShell = WScript.CreateObject("WScript.Shell")
var result = objShell.Run("cmd.exe /c shortcut.bat", WindowStyle_Hidden)"

both are text files, easy to write in ruby...
0

glro 
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby simon le bon » Thu Oct 04, 2012 10:02 am

Aerilius wrote:It now works also in SketchUp 7


That's great :thumb: :thumb:

Aerilius wrote:
simon le bon wrote:The "save the name-1" is less evident. Previously I thought it was adding at the end of the file name a decrementation -1 -2 -3 etc..

Sorry, I had understood it would decrease the number (to redo older images). So instead of a minus button, you would prefer something like "increase primary version number" and "secondary version number"?

It seems to me that "save the name+1" already "increase secondary version number" :roll:

nameFile_000.skp
when it is saved gives: (autosave checked)
nameFile_000.png
"save the name+1" become:
nameFile_0001.png
nameFile_0002.png
nameFile_0003.png
...

nameFile_001.skp
when it is saved gives:
nameFile_001.png
& "save the name+1" become:
nameFile_0011.png
nameFile_0012.png
nameFile_0013.png

That's not bad to consider snapshots incrementation.

it would decrease the number (to redo older images)


Redo older image is not (IMO) a very necessary option. And in facts don't work pretty good.
If you have a png set made with "save the name+1"
nameFile_0001.png
nameFile_0002.png
nameFile_0003.png
Then you want to redo basically the last one: nameFile_0003.png , if you use "save the name-1" It is nameFile_0002.png that is overwrited !!

May be only one button would be necessary which would make a clear proper incrementation:

nameFile_001.skp
when saved gives:
nameFile_001.png
& "save the name + increment"
nameFile_001_001.png
nameFile_001_002.png
nameFile_001_003.png

Just idea (as Jean Lemire always says ;) )

Simon

PS:
_ Sorry that "save a copy as" can't autosave a snapshot. We can take few seconds to save the snapshot name manually after all.
_ "The foxy method" is lost for me. I have tried with the search engine in vain. May be Gaieus knows something about it! ;)
0
User avatar
simon le bon 
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby glro » Thu Oct 04, 2012 3:12 pm

Aerilius wrote:
driven wrote:
glro wrote:is it possible to create a shortcut to a file using ruby?

That might be a the easiest solution! I'll try it!


i added some code to yours at the end of "self.save_as(filepath)" method


Code: Select all
filepath2 = (filepath.split("/")[0..-2]).join("/")
nom_model = m.title
# name of the text file to put the shortcut in
nom_bat = filepath2 + "/" + nom_model + ".bat"
   
#open this file
aFile = File.new(nom_bat,"w")

pathmodel = m.path

#write the file shortcut
aFile.puts("call "+pathmodel)
aFile.puts("end")
aFile.close


a black cmd window is opened... must be closed manually, unless you embed the .bat file in a .js file...
it is basic but it works...
0

glro 
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby simon le bon » Fri Oct 05, 2012 9:50 am

Sorry to disturb the coding discussion :?

Ae_Snapshot tested with Su7 : love this plug :thumb: :thumb:
(Png transparent background option still don't work - - )

simonlebon
0
User avatar
simon le bon 
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby Aerilius » Fri Oct 05, 2012 11:55 am

I forgot to mention: the transparent png option has only been added to SketchUp 8.
I'm working on a new version!
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [beta][Plugin] Snapshot – (0.1.0) — 02.10.2012

Postby glro » Fri Oct 05, 2012 3:51 pm

glro wrote:
Aerilius wrote:
driven wrote:
glro wrote:is it possible to create a shortcut to a file using ruby?

That might be a the easiest solution! I'll try it!


i added some code to yours at the end of "self.save_as(filepath)" method


Code: Select all
filepath2 = (filepath.split("/")[0..-2]).join("/")
nom_model = m.title
# name of the text file to put the shortcut in
nom_bat = filepath2 + "/" + nom_model + ".bat"
   
#open this file
aFile = File.new(nom_bat,"w")

pathmodel = m.path

#write the file shortcut
aFile.puts("call "+pathmodel)
aFile.puts("end")
aFile.close


a black cmd window is opened... must be closed manually, unless you embed the .bat file in a .js file...
it is basic but it works...


Doesn't work if there is a white space in the file address

additional code is needed
Code: Select all
nom_bat2 = nom_bat.to_s

if nom_bat2.count(nom_bat2, " ") != 0
UI.messagebox("no white space in the file address")
fail
end
0

glro 
 

Re: [beta][Plugin] Snapshot – (0.3.0) — 06.10.2012

Postby Aerilius » Sat Oct 06, 2012 2:17 am

I updated the plugin. I think it will now fit all your needs because you can now make your own buttons ;-)
@glro, can you test if the shortcuts work as expected?
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [beta][Plugin] Snapshot – (0.3.0) — 06.10.2012

Postby glro » Sat Oct 06, 2012 7:59 am

Aerilius wrote:I updated the plugin. I think it will now fit all your needs because you can now make your own buttons ;-)
@glro, can you test if the shortcuts work as expected?


i tested, but there might be a problem

no box is opened on my scree when i check "ae snapshot" in the menu

it might come from the html file

in the pop up windows you show in the first message of this thread, i read "create a shortcut"

but when i click on the html file in "ae_snapshot" folder, i don't see the same things
0

glro 
 

Re: [beta][Plugin] Snapshot – (0.3.0) — 06.10.2012

Postby Aerilius » Sat Oct 06, 2012 12:30 pm

I first thought it might have to do with upgrading the settings (because the previous version is much different). But I just tested it from 0.1.1 to 0.3.0 and it works for me.

You mean the settings dialog does not appear when you click the gear icon on the toolbar (there is no ae snapshot menu). Can you open the Ruby Console, click the gear button and give me the error messages if there are any.
Then copy&paste "AE::Snapshot.options={}" into the console and press the gear button again. Does it then work?
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [beta][Plugin] Snapshot – (0.3.0) — 06.10.2012

Postby glro » Sat Oct 06, 2012 1:17 pm

Aerilius wrote:I first thought it might have to do with upgrading the settings (because the previous version is much different). But I just tested it from 0.1.1 to 0.3.0 and it works for me.

You mean the settings dialog does not appear when you click the gear icon on the toolbar (there is no ae snapshot menu). Can you open the Ruby Console, click the gear button and give me the error messages if there are any.
Then copy&paste "AE::Snapshot.options={}" into the console and press the gear button again. Does it then work?


yes, the setting dialog does not appear;
the gear icon does'nt appear either...
just a small reactangle where i cannot click ...

how do you explain the differences between the setting dialog window i get when i double click directly on the file "settings_dialog.htm" and the one you pasted in you message?

my guess is that it is linked to the problem
0

glro 
 

Re: [beta][Plugin] Snapshot – (0.3.0) — 06.10.2012

Postby srx » Sat Oct 06, 2012 2:22 pm

Very useful! Thank you very much.
0
www.saurus.rs
User avatar
srx 
 

Re: [beta][Plugin] Snapshot – (0.3.0) — 06.10.2012

Postby Aerilius » Sat Oct 06, 2012 2:28 pm

@glro: Does "Sketchup.write_default("Plugins_ae", "Snapshot", "{}")" on the Ruby Console and restarting help?
(There are no relevant differences in the htm file.)
(By the way, you don't need quote the message, I know it's on the same page one above ;-) )
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [beta][Plugin] Snapshot – (0.3.0) — 06.10.2012

Postby glro » Sat Oct 06, 2012 3:46 pm

OK

yes it helps

when i close and open sketchup again, the icon and snapshot settings windows appear on the screen

but i cannot save the parameters (clicking on "OK" doesnt change anything)

i notice the lines you added to create a file shortcut; since this is the only option i am interested in, i'll try to add them to the previous version, that worked perfectly on my computer

thank you
0

glro 
 

Re: [beta][Plugin] Snapshot – (0.3.0) — 06.10.2012

Postby Aerilius » Sat Oct 06, 2012 4:14 pm

glro wrote:yes it helps

That is good!

glro wrote:clicking on "OK" doesnt change anything

Toolbar changes can only take effect after restarting SketchUp. (Maybe that's not so obviously written.)
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [beta][Plugin] Snapshot – (0.3.0) — 06.10.2012

Postby glro » Sat Oct 06, 2012 5:16 pm

when i launch sketchup again, i get "wrong number of arguments (0 for 1)"

The plugin does take a shot when i click on the button

but i cannot get the snapshot settings windows on the screen anymore

it may be because of my computer, if i am the only one to have this problem...
0

glro 
 

Re: [beta][Plugin] Snapshot – (0.3.0) — 06.10.2012

Postby Aerilius » Sat Oct 06, 2012 8:35 pm

I am very sure it's not your computer. I couldn't find anything on my own.
"wrong number of arguments (0 for 1)"

This error was on the Ruby Console? Can you tell me what was before or after that? There should be a line number and a line number is very much helpful!
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [beta][Plugin] Snapshot – (0.3.0) — 06.10.2012

Postby glro » Sat Oct 06, 2012 9:20 pm

no, nothing in the ruby console

it is an error message when sketchup loads all the plugins

no numbers
0

glro 
 

Re: [beta][Plugin] Snapshot – (0.3.0) — 06.10.2012

Postby Aerilius » Sat Oct 06, 2012 9:35 pm

Ok, SketchUp does not tell us much about load errors. In such a case we need to reload the plugin manually in the Ruby Console to see more details. Can you do:
load "ae_Snapshot/Snapshot.rb"
0

Aerilius 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: Arash_Shah, pobi and 14 guests

Visit our sponsors: