Custom shortcut

Next
 From:  Samuel Zeller
4559.1 
Hello,

I need a shortcut that does multiple things in this order

1. Hide the grid (including the axis)
2. Change the background color to #FFF
3. Capture the active view to file (I already have an Alt+S shortcut to do that)
4. Put back the original background color and show the grid

I currently use Alt+S to save the view to a PNG file but it also screenshot the grid
I use the grid + the default background color for modelling, but I want to take screenshots on white background without always going into the options everytime I need to take a screenshot :)

It would be even more awesome to have the screenshot directly copied in the clipboard so I can paste it into photoshop.

Thanks for the help in advance
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
4559.2 In reply to 4559.1 
Hi DesuDeus, see this previous post for a description on some various script methods that can be combined like that:
http://moi3d.com/forum/index.php?webtag=MOI&msg=1049.32

So one that does what you want would be like this:

script: /* Custom screenshot */ var prev_background = moi.view.viewportBackgroundColor; moi.view.viewportBackgroundColor = 0xFFFFFF; moi.view.lineWidth = 4; moi.grid.display = false; moi.grid.showXYAxes = false; moi.ui.getActiveViewport().renderToClipboard( 2560, 2560 ); moi.view.lineWidth = 1; moi.grid.display = true; moi.grid.showXYAxes = true; moi.view.viewportBackgroundColor = prev_background;


This one uses the renderToClipboard() method which generates an image of a custom resolution (2560x2560 in the above one) and places it directly in the clipboard.

Because it's going to a high resolution it also temporarily increases the line width of the display as well - if you take that part out you can get an effect of fainter lines if you then resize the image down.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All