MoI discussion forum
MoI discussion forum

Full Version: Grid showing with snap shot

Show messages: All  1-2  3-12

From: Tim (TIMM)
2 Aug   [#3] In reply to [#2]
Hi Michael,
Thanks for responding.
I am using the "Snapshot" camera icon as in this screen shot of my workspace. This post image to a folder on my mac. Setup by James Elliot I guess. Now sure how to find the script linked to the icon. How do I get that?
Thanks
Tim



Image Attachments:
Screenshot 2024-08-02 at 21.11.03.png 


From: Mip (VINC)
2 Aug   [#4]
Hi Tim,

Here is the script I use for screenshots :
I set "Ctrl+Alt+S" as shortcut

script: /*Photo écran fond blanc 4000, 2500 linewidth : 4 */var prev_background = moi.view.viewportBackgroundColor; moi.view.viewportBackgroundColor = 0xFFFFFF; moi.view.lineWidth = 4; moi.grid.display = false; moi.grid.showXYAxes = false; moi.view.showAxisIcon = false; moi.view.showViewTitles = false; var img = null; try { img = moi.ui.getActiveViewport().render( 4000, 2500 ); } catch(e){} moi.view.lineWidth = 1; moi.grid.display = true; moi.grid.showXYAxes = true; moi.view.showAxisIcon = true; moi.view.showViewTitles = true; moi.view.viewportBackgroundColor = prev_background; var name = img.getSaveFileName(); if ( name != '' ) img.save( name );

You can change the render size to your convenience by entering different values in "render(4000,2500)"

I don't remember the emplacement of the script under the camera button though since I do not use this environment setup anymore.

I hope this can be useful to you.
From: Michael Gibson
2 Aug   [#5] In reply to [#3]
Hi Tim, yes so that is some customized UI.

I think the script for it is probably located in this folder:
~/Library/Application Support/Moi/startup/

And probably called something like "84 Snapshot.js", do you see it there? If it's an older version it might be in a different spot though.


What happens if you right click on the button instead of left click? I think that particular script may have been set up to show grid on left click and hide it on right click.

Also if you hold down Ctrl and/or shift when you click it will also do a slightly different size or color variation.

- Michael
From: Tim (TIMM)
5 Aug   [#6] In reply to [#5]
Hi Michael,
Double click has got rid of the grid, many thanks.
Screen shot prints onto a grey background and I would prefer a white background for printout. The "hold down Ctrl and/or shift" did nothing thjat I could tell, still grey background.

I could not find the Moi sub folder in the Applications support folder.

Thanks
Tim
From: Michael Gibson
5 Aug   [#7] In reply to [#6]
Hi Tim, the "Library" folder is hidden by default so it can be a bit tricky.

From the Mac finder try going to the "Go" menu on the top menu bar and pick the "Go to folder" menu item then put in ~/Library/Application Support/Moi

Is there a "startup" folder inside there and a file named "snapshot" in it?

- Michael
From: Tim (TIMM)
6 Aug   [#8] In reply to [#4]
Hi Mip
Thanks for the script...not too familiar with script usage, so will have to work out how to insert.
Many thanks for reply anyhows
Tim
From: Michael Gibson
6 Aug   [#9] In reply to [#8]
Hi Tim, for using the script in Mip's message above, go to Options > Shortcut keys and push the "Add" button and then press what key combination you want to trigger it. Then paste in the script code for the "Command" value of the shortcut key.

- Michael
From: Tim (TIMM)
26 Oct   [#10] In reply to [#4]
Hi Mip
Thanks for this, worked a treat.
T
From: Tim (TIMM)
26 Oct   [#11] In reply to [#9]
Hi Michael,
Thanks for this, managed to paste in script and use OK. One thing though, my screen put the grid on after using the script, had to go into Options to remove the grid. I was using short cut key as Mip had used Ctrl, Alt, S. Any idea why grid appeared back on screen?
thanks
Tim
From: Michael Gibson
26 Oct   [#12] In reply to [#11]
Hi Tim,

re:
> Any idea why grid appeared back on screen?

It's just what the script does - it turns off the grid, takes the snapshot, then turns on the grid.

Try this variation which will save the current grid display state and restore it instead of just turning it off and on:


script: /* Generate viewport image white background 4000, 2500 linewidth : 4 */ var prev_background = moi.view.viewportBackgroundColor; moi.view.viewportBackgroundColor = 0xFFFFFF; var prev_linewidth = moi.view.lineWidth; moi.view.lineWidth = 4; var prev_griddisplay = moi.grid.display; moi.grid.display = false; var prev_showxyaxes = moi.grid.showXYAxes; moi.grid.showXYAxes = false; var prev_showaxisicon = moi.view.showAxisIcon; moi.view.showAxisIcon = false; var prev_showviewtitles = moi.view.showViewTitles; moi.view.showViewTitles = false; var img = null; try { img = moi.ui.getActiveViewport().render( 4000, 2500 ); } catch(e){} moi.view.lineWidth = prev_linewidth; moi.grid.display = prev_griddisplay; moi.grid.showXYAxes = prev_showxyaxes; moi.view.showAxisIcon = prev_showaxisicon; moi.view.showViewTitles = prev_showviewtitles; moi.view.viewportBackgroundColor = prev_background; var name = img.getSaveFileName(); if ( name != '' ) img.save( name );


- Michael

Show messages: All  1-2  3-12