Corona Material Automator

1 vote
Version: 
1.9.5
Date Updated: 
04/06/2024

 

it works for both Corona Physical and Corona Legacy Material. You can change most commonly used parameters, you can add round edges or remove them , you can change triplanar size etc... i've also added some randomnization over Roughness and colors, there is an option to create one material by objects so that you can randomly change their colors and roughness. there is also an option to populate both material editor with the selected objects materials. for those who have used or still use VrayAutomator from Metin Seven, this is highly inspired but for Corona Render. Install by drag and dropping in the viewport, then go to customize, customize user interface, tool bar, category "SimonScripts", create a new toolbar if you haven't got one already, then drag CoronaAutomator inside it. you can see some of my work on Arstation https://www.artstation.com/simon_bourgeois or on my portfolio https://simonbourgeois6.wixsite.com/monsite I hope you'll find this script useful :)

update 1.5 : added UvwRandomizer and updated the "populate material editor" part, for UvwRandomizer you can choose to create instanced float controller to link every settings except the input bitmap, very handy for pbr materials that needs to be randomized the same way on every textures. it will show if you right click the node and choose "Show All Additional Params".

The only limitation with Uvwrandomizer is when normal maps are used as bump, the random rotation doesn't work well...the only workaround i can think of, is to use greyscale bump instead.

 Update 1.6 added a lot of new feature, other Corona Render related script  have been included, UI has been reorganized and is now dockable , normal bump and displacement has been added. There is also a new part that creates materials by folder, meaning that every images in a folder will be converted to corona physical materials, it has some opacity options and also a PBR option that will automatically create PBR materials when it founds images named with PBR names,  it is compatible with most PBR, if textures aren't recognize rename images to  a more common naming convention or send me an example so that i could add a new naming profile.it also needs to have the same amount of every "kind" of images( same number of albedo images than the amount of roughness images etc...) i have tested with hundreds of materials, it worked but it uses a lot of ram, try on small amount of images first and increase incrementally to be safe...

 Update 1.6.6 : Bug fix, when applied to multiple objects sharing the same material the script was adding multiple times the same nodes

Update 1.6.8 : As requested by Pierre , you can now use "CoronaPhysicalMt copy material slot" across multiple materials.The first selected object material will be used as a reference for other objects materials, it will copy or instance any slot from one material to other selected objects materials.You can still use it to copy a slot to an other on multiple materials if the option is unchecked, all modification will happen within the materials not across them.

Update 1.6.9 :Bug fix

Update 1.7.2 :Bug fix + Upgrade Triplanar and UvwRandomizer with additional output support in corona 10 version.

Update 1.7.4: Bug Fix + code optimization (2500 line removed). A lot of new features in this update, you can now target material ID, the UI is now composed of three Tabs, the first Tab is focused on material, the second on Camera and  the third on Lights, most lights and camera settings can now be applied accross multiple objects. there is also some tools for lights and cameras, you can scatter lights, reinstance lights, set light target z position without changing light orientation, there is also a target distance offset that behave like the camera target distance. For Camera,you can convert Standard and Physical Camera to Corona Camera, there is an option to fix sketchup Imported Camera Field of view,  you can convert multiple static cameras to an animated camera, the camera will be animated depending on the cameras names, you can also do the opposite, converting an animated camera to multiple static cameras. There is also an automatic turnaround setup and a camera to path option to create a camera animation based on a path. you can also create static camera based on camera created with the above functions, it is quite handy to create cameras around an object.there is also an AutoFocus, the build-in object focus in camera works on object center , it is not well suited if you need to focus on a ground floor or any big object, the interactiv autofocus works only on picked object and is suited for static camera, for animated camera there is a bake focus option that will work on all displayed objects and will create animation keys on each frames, it also works on animated surfaces if it is not working , add an editpoly modifier to the animated objects.

Update 1.7.6: A few bug fixed and some new tools for proxies.

Update 1.7.7: More bug fixed

Update 1.7.8:Added an option for pbr material naming requested by busseynova, you can now enter a number of character to remove from the albedo map name, the remaining name will be used as a base name for the material. For a map named Wood_02_8K_Albedo if the spinner is set to 10 you will create a material called Wood_02, the diffuse will be called Wood_02_Color, the roughness, Wood_02_Roughness "etc...

 Update 1.7.9:More bug fixed and added a new option requested by brr, It is a first version of this new feature, for now it targets the selected material nodes,you can target a material in a layered material or multiple Mat IDs in one action, add randomizer or triplanar etc..exactly as older version but with more flexiblility.
In futur updates, i will try to unable the control of colorcorrection nodes at any location of the materials, now it works only for the nodes in first position in the material, i had to restrict to the first node because the new triplanar and randomizer system makes it more difficult to keep track of nodes but the SME selection could make any node available, i just need to rethink the all colorcorrect part of the script... :)

Update 1.8: Small bug fix update, camera autofocus was crashing when backing was applied on a specified object to focus on, it was working well when object wasn't picked...i also added a button to unload the picked object and camera, it was automatically unload when the button was pressed but it was annoying to reload them multiple times if needed.

Update 1.8.3 : Light scatter tool has been updated

Update 1.8.4 : BugFix, Randomizer and Triplanar with multioutput wasn't working well when the material didn't have any diffuse texture. An other Bug was that, while on SME selection mode the removed nodes where deleted from the SME, in other modes (ID selection and All Mat IDs) the deleted nodes were still present in the Slate Material Editor, they where disconnected from the materials but still in the editor.

Update 1.8.5 : fixed material by folder non-PBR option, memory wasn't flushed properly between material generation, so it was creating the new material as well as the previously generated materials.

Update 1.8.6 : Added a new option in light scatter tool, you can now scatter lights around your selected objects, those lights will be  oriented toward selected objets, you can add some randomization to the lights target position

Update 1.8.7: BugFix, light scatter on shape area was broken, it was scattering on selected shape boundingbox instead...

Update 1.8.8: New functions in self-illumination tab, Screen G-Buffer set a given G-Buffer value to materials that has a map in self-illumination texture slot. Auto Screen Material creates a screen material, it works on selected materials in both material editors, it will move diffuse map to Self-illumination slot and put it in a Tonemapcontrol, the illumination color will be set to black to allow the image visibility in viewport.

Update 1.8.9: Auto Screen Material was crashing the script when applied to a material without diffuse map, it still require a diffuse map to unable the self illumination but it doesn't crash anymore. you can select material without diffusemap, they will be ignored.

Update 1.9.0: Bug fix, Updating material settings on large objects selection was very slow even if they share the same material

Update 1.9.1: Bug fix, The Proxy Creation Tool is meant to replace selected objects aswell as their instances, it was messing up scaling of the instances if they had different scaling value.

Update 1.9.2 : Bug fix, and some new options for lights intensity, you can now multiply or divide lights intensity by a given factor and also add or substract value to lights intensity on selected lights

Update 1.9.3 : Bug fix

Update 1.9.4 :More Bug fix, The Slate Material selection was broken...New option for Corona Color Correction, you can now select any texture nodes and add or delete Corona Color Correction nodes.

Update 1.9.5 :Bug fix and a little bit of code cleanup...

Link to Corona 10 version:

https://www.mediafire.com/file/jnbxlrszny6zezk/SimonScripts-Corona_Mater...

Corona 9 Version won't be update anymore, link to the last Corona 9 version:

https://www.mediafire.com/file/73y43o2lz95grob/SimonScripts-Corona_Mater...

 

Version Requirement: 
tested on 3dsmax2024 and Corona 10
Other Software Required: 
Corona Render v10

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
SimonBourgeois's picture

Thanks

Thanks,i am Glad you like it :)
Are you using the corona 9 version?
I had to stop updating this version, it was giving me too much work to update both version...
Since corona 10 the Randomizer and Triplanar has a multioutput option that made the linked controllers obsolete, all the maps are now connected into one node only, this is why i had to split the script into multiple versions, if you are using corona 9 you should update to v10 or even v11, the script has gone through major updates where i've been rewriting almost everything, and it also have a lot of new features. I still have one tab to write that will handle bitmaps related stuff, i will add the linked controller for tilling in next update ;)
thx for your feedback
Cheers

busseynova's picture

renaming

That's great, thanks, it worked! Awesome script, especially the UVW Randomiser with linked controllers. Would be great to be able to add linked controller to bitmap tilling/real world size as with you UVW Randomizer utility.

SimonBourgeois's picture

Sorry

Sorry, i missguided you, in fact its 9 characters without extention
it was to remove "8k_" or "_4k_".
if you had "019_larch-antique-2_2600x1000_8k_albedo.jpg"
it would leave only "019_larch-antique-2_2600x1000_"
in your case you can set the lines "ColorFileName = substring ColorFiles 1 (ColorFiles.count - 9)" to
"ColorFileName = substring ColorFiles 1 (ColorFiles.count - 7)" if you want to get rid of "albedo"and the underscore.

busseynova's picture

PBR names

Thanks, that's closer, but it seems to be taking 12 characters now.

e.g:

texture file: 019_larch-antique-2_2600x1000_albedo.jpg
bitmap node: 019_larch-antique-2_2600x10_COLOR
material: 019_larch-antique-2_2600x10

did I do something wrong or is it a case of just editing that value?

edit, can't find those lines, do you mean

(	if numColorFiles >= 1 and numAlbedoFiles <= 1 do
								(
								ColorFile =  filteredcolorFiles[i]
								ColorFileFullPath = newpath  + ColorFile
								ColorFiles = getFilenameFile ColorFile
								ColorFileName = substring ColorFiles 1 (ColorFiles.count - 9)
								)
 
								if numColorFiles <= 1 and numAlbedoFiles >= 1 do
								(
								ColorFile =  filteredAlbedofiles[i]
								ColorFileFullPath = newpath  + ColorFile
								ColorFiles = getFilenameFile ColorFile
								ColorFileName = substring ColorFiles 1 (ColorFiles.count - 9)
								)
 
								if numColorFiles >= 1 and numAlbedoFiles >= 1 do
								(
								ColorFile =  filteredAlbedofiles[i]
								ColorFileFullPath = newpath  + ColorFile
								ColorFiles = getFilenameFile ColorFile
								ColorFileName = substring ColorFiles 1 (ColorFiles.count - 9)
								)
SimonBourgeois's picture

PBR Names

The naming is based on the albedo map name and it remove 9 characters(the extension +"albedo") from the file name but as it takes any file that has "_COLOR","_BaseColor","_diffuse","_COL_",etc... as an albedo map,it ends up removing too much....
I'll try to change that in the next update.
if you need to have accurate naming, you can either rename your diffusemap to "albedo" (you can use bulk rename utility for batch renaming)
or you can change the number of character you need to remove in line 3656,3666,3676 (change"9"to what ever you need).

busseynova's picture

PBR batch naming

What determines the character count for the PBR importer? There appears to be some inconsistent rules in terms of the number of characters it'll display. I have different versions of each material so the first part of the name would stay the same. Here's some examples of the shortened names it's giving me in the materials:

026_oak-coppe
045_yew-europea
040_whiteantiqu
028_oak-ol
019_larch-antiqu

busseynova's picture

PBR batch naming

---------double post--

SimonBourgeois's picture

Hello

Hello Pierre,

thx for the feedback :)

i am currently very busy, but if i find some time i'll add this feature in the next version, if i understood correctly, you need to add instanced float controller across multiple materials on any slot in this case roughness , by that i think you mean to the roughness bitmap parameter like tilling offset rotation etc...am i correct or do you need to add instanced float controller only to the roughness value?

cotentin's picture

float controller instanced

Hello,
Thank you for this amazing script !
Is it possible to add an instanced float controller in a slot asthe roughness for example?
I tried with the coronaPhysicalMt copy material slot, I succeeded with one material but not with several
Thank you
Pierre

cotentin's picture

float controller instanced

Hello,
Thank you for this amazing script !
Is it possible to add an instanced float controller in a slot asthe roughness for example?
I tried with the coronaPhysicalMt copy material slot, I succeeded with one material but not with several
Thank you
Pierre

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.