Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] Corona Goodies - User Contributions => Topic started by: Gabriel Sumner on 2015-05-24, 01:37:59

Title: Corona Mask Manager 1.0 Alpha
Post by: Gabriel Sumner on 2015-05-24, 01:37:59
Hi everybody,
a quick share of a script me and my bro were working on. It had to be a quick one, as I needed it asap in production.
What's the deal? Well, I haven't found an automated renderMask creation script for Corona so far, like AutoMatte for vray for instance (maybe i didn't search enough...)

First try was to create a wire color assign script, which was kindly provided by my brother (as well as the main window and ui programming).
While he was busy with this part, I delved deep into photoshop javascripting, i always find it fascinating to automate something :D
But not being a scripter at all (had just a bit of Java programming some years ago), i put together some pieces and made some really rough rapid prototyping of automatic mask extraction.
Soon I realized that wire color pass was leeding nowhere, as too much mask cleanup in photoshop would have been required.
So i turned to Mono Masks, and added this functionality as well.

(http://s11.postimg.org/60m3bzkmb/001_example_mask_Extraction.jpg) (http://postimg.org/image/k71u77vhb/full/)
wire color extraction in photoshop
(http://s16.postimg.org/x83wwrevp/002_wire_Color_Assigment.jpg) (http://postimg.org/image/ddhvamzo1/full/)
wireColor assigment
(http://s28.postimg.org/7p59yvyu5/003_resulting_Render_Elements.jpg) (http://postimg.org/image/bya01223d/full/)
resulting render elements

1) Maxscript: Corona Mask Manager 1.0 Alpha || Basic functions:
Install: just run the ".ms" file

2) Photoshop javascript: coronaMaskManagerExtractor_1_0_alpha.jsx || Basic functions:
   On the currently opened file perform automated wire color extraction, based on the predefined wire colors in maxscript. At  any time additional colors can be added to the predefined color array.
As I stopped using it and turned to "mono masking" i just provide very few info here: Install: drop both files from the "zip" archive in the same folder, then in photoshop open up an image you need the masks to be extracted on. Go to "File > Scripts > Browse..." and select the file "coronaMaskManagerExtractor_1_0_alpha.jsx"
 
Overall notice: I had to work quickly and very rough, so I took a lot of little snippets from the internet. So expect a lot of bugs, as there are probably a lot of situations for the scripts to fail.
The major credits are listed in the header, if somebody feels his / her name is missing let me know. The script is a prototyped tool, I provide it as is, hope somebody can make use of it :)  Please take note of know issues in the maxscript header.
Everyone is free to add / modify anything to their liking, I will be happy to see this thing evolve in time. My current road map is listed in the header as well, provided i get some spare time ;)

Download the files here:
http://www.mediafire.com/download/c278ztimq9u36b4/CMM_1_0_alpha.ms (http://www.mediafire.com/download/c278ztimq9u36b4/CMM_1_0_alpha.ms)
http://www.mediafire.com/download/43d6dxd5rmu1yz4/coronaMaskManagerExtractor_1_0_alpha.zip (http://www.mediafire.com/download/43d6dxd5rmu1yz4/coronaMaskManagerExtractor_1_0_alpha.zip)

CheerZ,
G.S.
Title: Re: Corona Mask Manager 1.0 Alpha
Post by: GestaltDesign on 2015-05-24, 10:22:37
Great stuff Gabriel, this will save me a lot of hassle on current projects!
Really appreciated, many thanks!
Title: Re: Corona Mask Manager 1.0 Alpha
Post by: Gabriel Sumner on 2015-05-24, 11:33:52
You're welcome! Be aware of bugs I didn't manage to sort out ;)
Title: Re: Corona Mask Manager 1.0 Alpha
Post by: sverlo on 2018-02-13, 07:28:50
 Hi, Gabriel, and is it possible to make a script which will create mono-Cmasks from a selected layer (all objects in it)? with the name of this layer?

Thanks,
Title: Re: Corona Mask Manager 1.0 Alpha
Post by: cjwidd on 2020-04-17, 08:21:17
@sverlo were you able to improve the script in the manner suggested?