Hi everyone. I decided to create material converter from Vray materials to corona.
So here is the first version.
Script converts all scene materials which are:
VrayMtl
VrayLightMtl
Vray2SidedMtl
MultiMaterial
Be carefull and save your scene before converting script may crash max. corona_scene_converter_1.0.mse (16.3 KB)
It would be nice if you could leave your code unencrypted. Related to their “TODO” naming, Corona Material maxscript functions will sure be changed somewhat soon and it would be much easier if such a converter could be improved by several people.
I started writing a converter too this weekend but there are 1 or 2 map slots which are not working properly and I’m not finished supporting finalRender and MentalRay materials. I also included converting maps (like vraydirt, vraycolor, etc) but there seem to be some native max maps which will lead to a crash with corona. I’m still trying to figure out which ones.
Very good If you could provide a little “before and after” naming scheme it would be really helpful for us to replace all those already used properties in our scripts.
Ok, I added some notes and versioning information to my Script for a first testrun.
I started with Vrays Scene converter script which delivered some good base-functions but there’s of course not much left now
MR ArchAndDesign material is not really tested yet, that would be a perfect job for Javadevil
Currently the Script is able to convert:
Standard mat
VrayMtl
VRayBlendMtl (just taking the basemat)
VRayLightMtl
VRay2SidedMtl (uses material 1 and sets translucency to values/maps from 2Sidedmtl)
MR_ArchAndDesign
Vray-specific maps
There are two available settings:
convert Specular settings from Standard Material to reflection in Corona
An experimental function to convert Vrays Glossy values to “more or less” similar looking glossys in Corona
RefractionIor mapslot is currently not wired correctly - Coronas map slot is pointing to the reflection ior slot, so I’m unable to convert this.
Be careful with Vray Light materials, it will try to convert those settings and generate an emission slot but this will crash 3dsmax when rendering (coronas emission slot bug). You might want to comment this out while the bug exists.
mhh… Never used any of these things. All my “bigger” Scripts are inhouse tools so I’ve never considered such things. Furthermore, I’m just a self-taught maxscripter, never done any serious programming yet
Btw, just finished fR_Advanced and fR_Architectural I just don’t have finalRender for 2012 installed, so I can’t test it until tomorrow. So prepare for another version But it will be the last one until the new maxscript function names will be released (unless there are some serious bugs of course)
I haven’t either, but it looks like good idea, and helps you to keep track of the releases/lets other download it easily. You should also specify a licence, so the scripts can be safely used. I recommend Apache licence, if you dont mind other making their own versions of the script
Ok, this should be a stable version. @Javadevil: Yes, I had swapped two commands here. It tried to convert the Ior value to a checkbox state @Keymaster: I will have a look on these license models. But, as this is a widely modified version of the VraySceneConverter I’m not sure if this is would be a “fair” thing to do. Anyway, I added a short comment at the beginning of the Script. @GroveR_GoL: Thanks! I learned a lot from other people’s scripts, so I try to always keep my code open to others
v0.04
supported materials:
Standard mat
VrayMtl
VRayBlendMtl
VRayLightMtl
VRay2SidedMtl
Vray-specific maps
MR_ArchAndDesign
fR_Advanced
fR_Architectural
changelog:
Added fR_Advanced
Added fR_Architectural
fixed ArchAndDesign problems: anisotropy spinner*10, use refractmap slot, removed alpha from reflectioncolor
added Debug conversion functions, will be removed or refined later
Blend material works now
Shellac will be converted to Blend (zero mix)
DoubleSided will be converted to Blend (zero mix)
There is a new radiobutton control in the UI:
all materials + maps , converting all materials and maps in the scene
sel. objects materials (Debug) , for debugging purposes: It will convert the material assigned to the selected object(s). Note: If the objects material is also in a Materialeditor slot it will only modify the one on the object. Materialeditor slot will stay untouched (resulting in loosing the connection to the sel. objects)
current Mat.editor slot (Debug) , same here vice versa. selected MatEditor slot will be changed, objects materials stay untouched
Removed blend Material conversion and added non-destructive shellac and DoubleSided conversion
on chkReflstandardMat changed state do
(
standardMatSpecToRefl = state
)
on chkConvVrayGloss changed state do
(
VrayConvertGlossyValues = state
)
on btnStartConverting pressed do
(
mtlsToCorona()
format "Converting unsupported maps...\n"
ReplaceUnsupportedMaps()
format "Done.\n"
)
)
on chkReflstandardMat changed state do(
standardMatSpecToRefl = state
)
on chkConvVrayGloss changed state do(
VrayConvertGlossyValues = state
)
on btnStartConverting pressed do(
mtlsToCorona()
format "Converting unsupported maps...\n"
ReplaceUnsupportedMaps()
format "Done.\n"
)
)
otherwise “toggle all folds” function does not work. Thanks.
One more question. How about Blend, Shellac, DoubleSided materials? Why you create empty corona material instead of them? Blend material works fine in corona, doesn’t it? What if convert Vray blend to simple blend with multi nesting.
The simple answer is: I didn’t test blend/shellac materials yet . Personally, i don’t use any of them, that’s why I didn’t spent time on these yet. If you need those you can simply comment their classes out (“-- Blend: CreateDefaultCoronaMtl orig_mtl”) - that will keep blend materials the way they are, submaterials should still convert properly.
updated v0.04, blend works now, shellac and doublesided are converted to blend materials.
Just ran it through a scene with some cars in it. They all had Mental ray car paint shaders.
Can the script convert them too ? just to default corona mats ?