Possible to modify MoI Save Screenshot script?

Next
 From:  ed (EDDYF)
9787.1 
Michael -

I've been using the Alt-S shortcut:

script:var img = moi.view.screenshot( 'viewpanel', false ); var name = img.getSaveFileName(); if ( name != '' ) img.save( name );

to save MoI screen shots as PNG.

However, the screenshot also includes the background color, a thin line border, grid lines, grid axes, viewport name, and axes indicator.

Is it possible to make a version of this script that captures just the geometry?

The reason is twofold: 1) Make clean images for documenting, and more importantly 2) Make clean images of a black surface for creating a B&W map for making a label (decal) in the render program. If a script can do this it would avoid opening a drawing app as an added step in the map creation.

Or maybe there is another option I'm not aware of?

Regards,

Ed Ferguson
  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
Next
 From:  Michael Gibson
9787.2 In reply to 9787.1 
Hi Ed, so the moi.view.screenshot() method takes a snapshot of the desktop image. There is a different method which will make a bitmap image and draw the viewport into that image. That can be good because you can generate a different resolution than your desktop screen and things like floating windows won't get captured in the image either.

Try this one, it will also change the viewport background color and turn off those different decorations, then generate the image and then reset those things.

script: 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 );

- 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

Previous
 From:  ed (EDDYF)
9787.3 In reply to 9787.2 
That works awesome Michael. Very clean output. Thank you!

Now I have two options for taking a screen shot. This will work well for making a label mask and opacity mask for the render program.

Ed Ferguson
  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