Save image from MOI
 1-8  9-28  29-38

Previous
Next
 From:  pitrak
1049.29 In reply to 1049.28 
Michael, on pushpullbar we would say CRACQUER!

Great, thanks a lot for implementing this. I'm already looking forward to the next beta!

Thanks a lot,
patrick
  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)
1049.30 In reply to 1049.29 
"Craqueur" is the good Belgian / French word but it's a neologism ;)
Meaning is something like "to merit clapping for the amazing tricky work"
  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:  Ambimind
1049.31 
Have just realised the potential of rendering with MOI while reading this thread. While experimenting with the script I thought that it would be useful if we could also:
1 - Hide grid only in the rendering
2 - Hide hidden lines only in the rendering
3 - Change the background color only in the rendering(I'm thinking to black or green to use as an alpha channel)
4 - Enable 'constant' shading only in the rendering(that is, without shadowing) - this has the side effect of allowing accurate bitmap to vector conversion.
5 - Increase meshing resolution only in rendering
Thanks,

Ambimind
  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
1049.32 In reply to 1049.31 
Hi Ambimind, yup I think all that should be possible - note how the script already increases the line width just for the rendering and then puts it back to normal after the snapshot is taken - that's the part of the script that says moi.view.lineWidth = 4; and moi.view.lineWidth = 1;


The grid is made up of 2 parts - the regular grid lines and the darker xy axis lines.

To hide the grid would use this script:

moi.grid.display = false; moi.grid.showXYAxes = false;

and to restore it, say = true instead of = false. These would go sandwiched around the call that does the snapshot just like setting the line width currently.


Hidden line display is controlled in script by:

moi.view.showHiddenLines = true;


Setting the background color is controlled by the moi.view.viewportBackgroundColor property, which takes a 24-bit number made up of 3 bytes packed together, the 3 bytes contain the red, green, and blue values. So something like this should work to set it to red = 25, green = 51, blue = 255:

moi.view.viewportBackgroundColor = (25 << 16) | (51 << 8) | 255;


Constant shading can be done by setting high value for light intensities of the custom light levels under Lighting options, see here:
http://moi3d.com/forum/index.php?webtag=MOI&msg=3135.3

To set the lighting style in script, you can use:

moi.view.lightingStyle = 'CustomLevels';

and to restore to default:

moi.view.lightingStyle = 'Default';

You can use the following values for lightingStyle: 'Default', 'MoreFill', 'LessFill', 'KeyOnly', 'CustomLevels', 'Hemispheric', and 'Headlight' - each of these corresponds to an entry in the dropdown that you see in the lighting options dialog.

Then for custom levels to set the levels to a high value, use:

moi.view.customKeyLightLevel = 100.0;
moi.view.customFillLightLevel = 100.0;


You may run into some problems increasing meshing resolution, because that can consume quite a large amount of memory setting that to a tighter value. If you do want to try it, it's settable from script by:

moi.view.meshAngle = 10.0;


So anyway these are the various script calls that you can use to adjust the settings you are asking about - to assemble the script you build it up as one long line of text and put one setting to the left side of the snapshot and the restoring part to the right side of the snapshot.


Let me know if any of these doesn't work as expected.

- 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:  Ambimind
1049.33 In reply to 1049.32 
Fantastic, thank you!

For anyone else interested, here is the script that produces the type of rendering visible in the following image:

script:var v = moi.ui.getActiveViewport(); if ( v != null ) { moi.view.lineWidth = 3; moi.grid.display = false; moi.view.meshAngle = 5.0; moi.grid.showXYAxes = false; moi.view.showHiddenLines = false; moi.view.lightingStyle = 'CustomLevels'; moi.view.customKeyLightLevel = 100.0; moi.view.customFillLightLevel = 100.0; v.renderToClipboard(2048, 2048 ); moi.view.lineWidth = 1; moi.grid.display = true; moi.view.meshAngle = 10.0; moi.view.lightingStyle = 'Default'; moi.grid.showXYAxes = true; moi.view.showHiddenLines = true; }


BTW, I found that the default grey background works perfectly when using "Magic Wand" with a 1px tolerance - so as to mask the background(image below is .png so as to show this):


EDITED: 2 Jul 2011 by AMBIMIND

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:  BurrMan
1049.34 In reply to 1049.33 
Very nice Ambimind, Me likey!! Thanks for sharing it.
  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:  rosto
1049.35 In reply to 1049.20 
This is a wonderful thing - changing the line thickness!
Is there a solution to change the line tips to rounded like in Illustrator?
What would not appear gaps at the corners.
Image Attachments:
Size: 57 KB, Downloaded: 14 times, Dimensions: 300x188px
  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
1049.36 In reply to 1049.35 
Hi rosto,

re:
> Is there a solution to change the line tips to rounded like in Illustrator?

Not with this particular method since it's using the realtime viewport display engine which is heavily oriented for speed.

But you should get rounded line tips if you generate a drawing by exporting to PDF, AI, or SVG formats instead of using this screen display capture 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

Previous
Next
 From:  Rudl
1049.37 
This is a screenshot of a pyramid with a lot of stones. Can I avoid the interferences with a pdf and how are the settings.

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
 From:  Michael Gibson
1049.38 In reply to 1049.37 
Hi Rudl, I'm not sure if PDF export will have less of a Moiré pattern but it would be worth a try. Give it a try with default settings.

You may need to adjust the image in an image processing program to reduce that kind of pattern, search for something like "Moire pattern removal" to get some information on that.

- 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:  1-8  9-28  29-38