Save as script_screenshot with White background

Next
 From:  phlatt5th (P5TH)
9643.1 
Happy New Year Michael and all in the forum! I am happily using Moi with dark mode on one of my computers. I have also been using the save as script Michael cooked up :) which enables a simultaneous screenshot when activated. I find it invaluable for quick identification in my folder. However, I am wondering if it is possible to set it up so that when triggered it defaults to a white background instead of dark gray allowing for saving ink when printing for quick mock ups.
Thanks in advance.
Cheers!
  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:  nameless
9643.2 In reply to 9643.1 
Happy new year to you too! That sounds like a really cool idea for identifying 3dm files- reminds me of how Smirnov's library works. This thread has my attention! :)
  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
9643.3 In reply to 9643.1 
Hi phlatt5th, Happy New Year!

Yes it should be possible to modify the script, can you please post the one you are using?

There is a similar "screenshot with white background" here also:
http://moi3d.com/forum/index.php?webtag=MOI&msg=9526.173

- 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:  phlatt5th (P5TH)
9643.4 In reply to 9643.3 
Hi Michael, thanks for getting back to me. Sorry for the delay been working on some pressing deadlines.I have attached the script.
I will also check out the link you posted.
Thanks.

EDITED: 14 Jan 2020 by P5TH

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
9643.5 In reply to 9643.4 
Hi phlatt5th, so to modify that script to make a white background you would insert this just before the call to vp.render() :

code:
var prev_background = moi.view.viewportBackgroundColor;
moi.view.viewportBackgroundColor = 0xFFFFFF;


So what that should do is save the current background color to a variable "prev_background" and then set the background color to white.

Then after the call to vp.render() put in this:

code:
 moi.view.viewportBackgroundColor = prev_background;


That should restore it after the image is generated.

- 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:  phlatt5th (P5TH)
9643.6 In reply to 9643.5 
Hello Michael, Sorry to bug you. I attempted to alter the script but was not successful. I must have missed an important step:(
I have attached the butchered script and error message.
Thanks again.
Attachments:

Image Attachments:
Size: 24.1 KB, Downloaded: 18 times, Dimensions: 321x195px
  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:  nameless
9643.7 In reply to 9643.6 
Sorry to interject to your discussion, this works wonders for me. You can now get visual feedback for your files, in the save directory.

I followed what Michael said and it seems to work here- I am attaching it below. Thank you for bringing this to my attention, super handy. ;)

ps. I replaced the default SaveAs command in the commands folder (After backing the original up with a rename).
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
9643.8 In reply to 9643.6 
Hi phlatt5th, your edited script seems fine. That error message looks like MoI cannot find any script named SaveAs in the commands folder. Did you possibly delete your original SaveAs.js file and only have a new one named "SaveAs 2.js" ?

If so rename it to just plain SaveAs.js (no "2" in it) so that the button or keyboard shortcuts that are trying to run the saveas command will be able to find it.

- 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:  phlatt5th (P5TH)
9643.9 In reply to 9643.8 
@ nameless thank you :)

I am glad that you find this useful. Moi has been incredibly valuable to me for several years, little additions like these make moi even more a of joy to use daily as a 2D and 3D tool. I am not even close to the amazing talented members on this esteemed forum. However, I have been on board since V1 Michael's great program Moi has made it possible for me (former ludite) to embrace working with 3D software with enthusiasm.

@ Michael, I made that change and all is well. I appreciate you and your brilliant work. Thank you for this great app and the consistent quality development over the years and most of all your willingness to help us all over the years.


Cheers!
  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