MoI discussion forum
MoI discussion forum

Full Version: Save as script_screenshot with White background

Show messages: All  1-4  5-9

From: Michael Gibson
14 Jan 2020   [#5] In reply to [#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
From: phlatt5th (P5TH)
15 Jan 2020   [#6] In reply to [#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:
SaveAs 2.js

Image Attachments:
Screen Shot 2020-01-15 at 11.49.11 AM.png 


From: nameless
15 Jan 2020   [#7] In reply to [#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:
SaveAs.js


From: Michael Gibson
15 Jan 2020   [#8] In reply to [#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
From: phlatt5th (P5TH)
15 Jan 2020   [#9] In reply to [#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!

Show messages: All  1-4  5-9