Save as with screen shot
All  1-2  3-7

Previous
Next
 From:  shayno
6249.3 
Thanks very much Michael

That works although it jumps the gun by saving the screenshot while the stl controls are still up



Cheers
shayne
Attachments:

  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
6249.4 In reply to 6249.3 
Hi shanye, try putting in a call to moi.ui.redrawViewports(); before the screenshot, does that help any?

- 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
Next
 From:  shayno
6249.5 
Fantastic thanks

// config: norepeat

var filename = moi.geometryDatabase.getSaveFileName();

if ( filename != '' )
{
moi.geometryDatabase.saveAs( filename );
moi.ui.redrawViewports();

var img = moi.view.screenshot( 'viewpanel', false );
img.save( filename.substring(0,filename.length-3) + 'jpg' );
}

shayne
  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:  moritzbock (MORITZ)
6249.6 In reply to 6249.5 
Hello shayne, hello Michael,

this script works perfect so far, it runs the SAVE-dialog correct and produces a .jpg-File - but the screenshot (the .jpg-File) is totally black.

I use Moi V3 beta Aug 1-2013 on a MAC Pro with OS X V10.9 Mavericks.

- Moritz
  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
6249.7 In reply to 6249.6 
Hi Moritz, this type of screenshot does not work on OSX yet, it's something that I will need to fix up.

The other kind of screenshot that generates a viewport image internally and puts it on the clipboard does work on OSX though. If you search here for "renderToClipboard" you can find that one.

The "renderToClipboard" method won't quite work as a drop-in replacement for this particular script though because it generates an image and puts it on the clipboard rather than generating an "image object" which can be saved directly to disk instead as this script is doing.

In the next v3 beta there will be a new .render() method that works similar to .renderToClipboard() in that it generates an image internally instead of just taking a capture of the current display screen and does return an image object that can then be saved to disk in the script, so that one that's coming in the next beta could work as a drop-in replacement instead of the .screenshot() method.

- 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

 

 
 
Show messages: All  1-2  3-7