fast image from screen shot

Next
 From:  FiL (FILIPPOL)
6774.1 
Hi Michael,

Often I need to capture the screen image.
I normally work with a gray background, soft lighting and the active grid.
To capture the images I set the white background, impose lights with metallic effect and take off the grid.

Is it possible to do this automatically?
For example, I place my object and then a script captures the image with the required setting. But the working settings remain (without having to reset everything in order to work)?

Thanks

Filippo

_________________________

That's a brilliant day to design!

  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
6774.2 In reply to 6774.1 
Hi Filippo, yes it's possible to do that type of thing automatically with a script, the script can save the previous settings, change them to what you want, take the screenshot, and then restore the saved previous settings.

Check out here for an example of this:
http://moi3d.com/forum/index.php?webtag=MOI&msg=5381.1

I think the one in the first message of that thread does most of what you want already, with saving the previous viewport background, changing the viewport background to white, turning off the grid (there are separate things for the grid and the x/y axes of the grid), then taking the screenshot, then restoring things.

I guess it sounds like the main thing you want to add is the metallic lighting, what settings do you want for that, just the same as checking only the "metallic lighting" checkbox option or any other lighting parameters in addition to that?

The script code for turning on metallic lighting is this: moi.view.metallicLighting = true;

The script code for turning off metallic lighting is this: moi.view.metallicLighting = false;

So you'd just insert the "turn on" part before the screencapture, and insert the turn off part after it.

Does that get you set up?

- 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:  FiL (FILIPPOL)
6774.3 In reply to 6774.2 
Oh yes!!!

I've changed the script putting the light options:

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



Thank you!

Filippo

_________________________

That's a brilliant day to design!

  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:  FiL (FILIPPOL)
6774.4 In reply to 6774.2 
And ... the code for turning off/on the edges?
Is there it? In order to insert it in the script.


Filippo

_________________________

That's a brilliant day to design!

  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
6774.5 In reply to 6774.4 
Hi Filippo,

> And ... the code for turning off/on the edges?
> Is there it? In order to insert it in the script.

For that the script needs to go through objects and on each object get its edges and set the edges to be hidden or not.

That should go like this for hiding them:

code:
var breps = moi.geometryDatabase.getObjects().getBReps(); for ( var i = 0; i < breps.length; ++i ) { breps.item(i).getEdges().setProperty( 'hidden', true ); }



And for showing them the same thing, just passing false at the end instead like this:

code:
for ( var i = 0; i < breps.length; ++i ) { breps.item(i).getEdges().setProperty( 'hidden', false ); }



You can just insert those whole chunks of code before and after the screencapture just like the other ones.

- Michael

EDITED: 19 Jun 2014 by MICHAEL GIBSON

  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:  FiL (FILIPPOL)
6774.6 In reply to 6774.5 
Bene

I've done another step:

for turn on the high lights
moi.view.specularHighlights = true;

for turn off the high lights
moi.view.specularHighlights = false;



at work



script result



... humm... a script to take a coffee?



Thank you

Filippo

_________________________

That's a brilliant day to design!


  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
6774.7 
Hi Fillipo

The customui has a handy screen shot button left mouse click for grid right mouse click for no grid

using the lighting style chrome you easily get snapshots like this









Thats not easy to get the twist ends to match up

cheers
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:  Frenchy Pilou (PILOU)
6774.8 
Or use the PDF export! ;)
---
Pilou
Is beautiful that please without concept!
My Gallery
  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:  FiL (FILIPPOL)
6774.9 
>Shayne
The customui has a handy screen shot button left mouse click for grid right mouse click for no grid

Hi Shayne
Where I can find it?



> Pilou
Or use the PDF export!

Hi Pilou
I save little images in jpg, and I use them in a database

Filippo

_________________________

That's a brilliant day to design!

  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:  Frenchy Pilou (PILOU)
6774.10 In reply to 6774.9 
  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:  FiL (FILIPPOL)
6774.11 In reply to 6774.10 
Merci Pilou!

_________________________

That's a brilliant day to design!

  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