Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] General Discussion => Topic started by: GroveR_GoL on 2012-09-11, 13:20:16

Title: [DEPRECATED] Material Converter
Post by: GroveR_GoL on 2012-09-11, 13:20:16
This thread is for archive purposes only, use the convertor here: http://forum.corona-renderer.com/index.php/topic,126.0.html

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.
Title: Re: Material Converter
Post by: racoonart on 2012-09-11, 13:31:42
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.
Title: Re: Material Converter
Post by: Javadevil on 2012-09-11, 13:40:59



Dead Clown if you can convert Arch&Design to Corona that would be awesome !

I've converted so many scenes over the last couple of months and its a pain.

I've been after a material converter for months now.

I'm not to fussed about material settings, just mainly mapping paths.

Nice work GroveR, I'll test this out with the couple of Vray scenes I have.


thanks
Title: Re: Material Converter
Post by: GroveR_GoL on 2012-09-11, 13:45:08
Ok, here is unencrypted code:
Title: Re: Material Converter
Post by: racoonart on 2012-09-11, 13:56:40
Javadevil: I'll try to get Arch&Design mats done next weekend, currently there's no time for scripting ;)
GroveR_GoL: Thanks! :)
Title: Re: Material Converter
Post by: Ondra on 2012-09-11, 15:46:41
Hi,
this is great! If you need any support from my side, let me know. I can also distribute it bundled with future builds.

BTW: I'll be renaming and documenting all the parameters for the next build, so they have consistent meaningful names.
Title: Re: Material Converter
Post by: racoonart on 2012-09-11, 15:57:06
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.
Title: Re: Material Converter
Post by: racoonart on 2012-09-11, 17:38:09
[edit] v0.07: latest version here: http://forum.corona-renderer.com/index.php/topic,66.msg522.html#msg522 (http://forum.corona-renderer.com/index.php/topic,66.msg522.html#msg522)

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.
Title: Re: Material Converter
Post by: Ludvik Koutny on 2012-09-11, 17:40:00
My initial reaction:

(http://i.imgur.com/IfrBc.gif)
Title: Re: Material Converter
Post by: racoonart on 2012-09-11, 21:33:26
little update
- restructured conversion functions, much better now
- fixed translucency and anisotropy bugs in ArchAndDesign function
- added a sorted list of all material functions as a start point for other materials (at the end of the file)
Title: Re: Material Converter
Post by: Paul Jones on 2012-09-11, 22:51:27
fantastic work guys :)
Title: Re: Material Converter
Post by: Ondra on 2012-09-11, 23:32:58
Have you considered using more standard OSS tools, for example versioning & publishing the script somewhere like github or sourceforge?
Title: Re: Material Converter
Post by: racoonart on 2012-09-11, 23:47:47
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)
Title: Re: Material Converter
Post by: Ondra on 2012-09-12, 00:05:47
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 ;)
Title: Re: Material Converter
Post by: Javadevil on 2012-09-12, 00:35:33

Dead clown,


I'll add errors I get here.

Heres the first Exception.

1 - Unable to convert : 1.4 type boolean.


If you  add an option to convert a selection instead of the whole scene it would make it easier to find the material thats causing the exceptions.

@Rawalanche haha, thats pretty much how I felt.




Title: Re: Material Converter
Post by: GroveR_GoL on 2012-09-12, 11:22:11
Dead clown, your code is so cool, I've learned some new features from it. Thanks for sharing.
Title: Re: Material Converter
Post by: racoonart on 2012-09-12, 11:30:40
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:

 Removed blend Material conversion and added non-destructive shellac and DoubleSided conversion
Title: Re: Material Converter
Post by: GroveR_GoL on 2012-09-12, 11:34:05
Only one thing. Plaese put brackets like this

rollout CoronaConverter "Convert Materials to Corona" width:200 height:160
   (
      groupBox grp1 "standard Materials" pos:[8,8] width:184 height:40
      checkbox chkReflstandardMat "convert specular to reflection" pos:[16,24] width:168 height:16 checked:standardMatSpecToRefl
      groupBox grp2 "Vray Materials" pos:[8,56] width:184 height:56
      checkbox chkConvVrayGloss "convert glossy values (experimental)" pos:[16,72] width:168 height:32 checked:VrayConvertGlossyValues
      button btnStartConverting "Convert Mats + Maps" pos:[8,120] width:184 height:32
      
      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"
      )
   )

and not like this

rollout CoronaConverter "Convert Materials to Corona" width:200 height:160 (
      groupBox grp1 "standard Materials" pos:[8,8] width:184 height:40
      checkbox chkReflstandardMat "convert specular to reflection" pos:[16,24] width:168 height:16 checked:standardMatSpecToRefl
      groupBox grp2 "Vray Materials" pos:[8,56] width:184 height:56
      checkbox chkConvVrayGloss "convert glossy values (experimental)" pos:[16,72] width:168 height:32 checked:VrayConvertGlossyValues
      button btnStartConverting "Convert Mats + Maps" pos:[8,120] width:184 height:32
      
      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.
Title: Re: Material Converter
Post by: GroveR_GoL on 2012-09-12, 11:52:18
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.
Title: Re: Material Converter
Post by: racoonart on 2012-09-12, 12:01:57
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.

[Edit] updated v0.04, blend works now, shellac and doublesided are converted to blend materials.
Title: Re: Material Converter
Post by: Javadevil on 2012-09-12, 15:01:37

Thanks Deadclown,

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 ?

cheers
Title: Re: Material Converter
Post by: racoonart on 2012-09-12, 15:50:06
Javadevil:
I'll try to figure out an "intelligent" way to convert this car paint stuff... A lot of properties which will not easily transfer into an normal material. Anyways. I made a little code snippet which will convert car paint materials into a simple corona material with it's original base color (no reflections, sorry). Just paste this to your maxscript editor and evaluate it.
Code: [Select]
for mp in (getClassInstances Car_Paint_Material__mi) do(
r=CoronaMtl TODOdiffuse:mp.base_color
r.name="Corona "+mp.name
replaceInstances mp r
)
Title: Re: Material Converter
Post by: Javadevil on 2012-09-13, 12:59:15

Thanks Deadclown.

Title: Re: Material Converter
Post by: Ludvik Koutny on 2012-09-14, 23:06:29
I have not had time yet to test the script (recently moved and got a new job - yeah, i know, not an excuse, but still :P), so i could not try it on my own, but i wonder, how is conversion of glossiness values and maps in glossiness slot handled? Because Vray's glossiness curve and mapping of bitmap is quite different to Corona's, so i wonder if there is some re-mapping of these values going on, or if this part has to be done manually? :)
Title: Re: Material Converter
Post by: Ondra on 2012-09-14, 23:16:24
guys from vray were willing to share their curve, so its possible to do exact match. But Corona uses different BRDF model by default, so it still needs to be guessed :/
Title: Re: Material Converter
Post by: racoonart on 2012-09-15, 00:42:30
it's simply a guess ;) . the funny thing is, the original vray converter is doing a Finalrender glossy conversion by using this equation
Code: [Select]
fn sqr x = x*x
1.0-sqr (origMtl.reflectGlossy*0.01)

So, since Rawalanche said finalrender glossys would be far better fitting than vray glossys I just turned this principle around and do it by the square root: (origMtl would be vray material here)
Code: [Select]
(1.0 - sqrt(1.0 - origMtl.reflection_glossiness))
I know it doesn't fit coronas model but it's at least a bit better than no conversion at all ;) It works quite well with higher values but since i don't have any mathematical proof or something else I labeled it "experimental"
Title: Re: Material Converter
Post by: Ondra on 2012-09-16, 12:46:36
I've renamed the parameters in the newest build, so the script is temporarily broken, until somebody rewrites it.
Title: Re: Material Converter
Post by: racoonart on 2012-09-16, 13:36:36
I will do that asap. May take some time though ;)
Title: Re: Material Converter
Post by: Ondra on 2012-09-16, 13:40:38
ok, thanks, same goes for other converters (if they use any parameters)
Title: Re: Material Converter
Post by: racoonart on 2012-09-16, 14:06:58
seems like displacement mapslot has wrong naming. It has the same name as diffuse.
.texmapDiffuse (Diffuse_texture) : texturemap
.texmapDiffuse (Displace_texmap) : texturemap
Title: Re: Material Converter
Post by: Ondra on 2012-09-16, 14:16:24
right. I've fixed it. I can give you the build on skype, dropbox not working for me ATM.
Title: Re: Material Converter
Post by: racoonart on 2012-09-17, 12:25:25
new version: This one uses updated maxscript commands, so it will only work with builds after 16th Sept 2012. Old script will not work on current builds.

supported materials:
- Standard
- VrayMtl
- VRayBlendMtl
- VRayLightMtl
- VRay2SidedMtl
- Vray-specific maps
- MR_ArchAndDesign
- fR_Advanced
- fR_Architectural

changelog:
v0.06
v0.05

[edit] sorry guys, fixed a little typo which caused an error when converting a standardmaterial with selfillum, please re-load 0.06.ms :S
Title: Re: Material Converter
Post by: michaltimko on 2012-09-17, 13:23:09
Thanks a lot Martin
Title: Re: Material Converter
Post by: Javadevil on 2012-09-17, 14:41:16

Great stuff Deadclown !!

Any chance of converting thea materials ?
Title: Re: Material Converter
Post by: racoonart on 2012-09-17, 15:02:46
Thanks guys!
Uhm.. concerning converting thea materials: I can do that but the question is: which materials do we want to support? Others may ask for maxwell materials, Fryrender, nox, etc ;). It's not a big problem to implement but it may lead to requests for many other materials. I don't have thea render, so you might have to help me out with maxscript commands :)
Title: Re: Material Converter
Post by: Javadevil on 2012-09-17, 15:11:48

Okay, I'm guessing the only way to find the commands is watch the thea creation material in the listener ?

cheers
Title: Re: Material Converter
Post by: racoonart on 2012-09-17, 15:33:56
there are two things you need to do, first assign a Thea material to the first(!) slot of the material editor.
then paste this command to the listener:
Code: [Select]
classof meditmaterials[1]That will show me the class of the material which is important for the creating part

then type:
Code: [Select]
show meditmaterials[1]
This will list all the properties the material has.
I don't know how those materials work, so a screenshot of the interface could be helpful too :)
Title: Re: Material Converter
Post by: racoonart on 2012-09-17, 17:53:29
sorry guys, fixed a little typo which caused an error when converting a standardmaterial with selfillum, please re-load 0.06.ms :S
Everything else should work fine. Converted some hundreds of materials now and this is the first error. But there may - of course - be other typos or errors in parts which are called very seldom.
Title: Re: Material Converter
Post by: Javadevil on 2012-09-18, 00:12:45

Here you go Deadclown, its quite a complex shader, 3 layering and 3 blending modes.
Don't put to much effort into it, I just need the diffuse and bump bitmap paths copied to corona mat.
Reflection and the rest I can fix myself.

Code: [Select]
classof meditmaterials[1]
Thea_Material

show meditmaterials[1]
  .mat1 : material
  .mat2 : material
  .mat3 : material
  .mat4 : material
  .mat5 : material
  .mat6 : material
  .Percent1 : integer
  .Percent2 : integer
  .Percent3 : integer
  .Percent4 : integer
  .Percent5 : integer
  .Percent6 : integer
  .mask1 : texturemap
  .mask2 : texturemap
  .mask3 : texturemap
  .mask4 : texturemap
  .mask5 : texturemap
  .mask6 : texturemap
  .exported : boolean
  .twoSided : boolean
  .shadow_only : boolean
  .repaintable : boolean
  .dirt : boolean
  .dirt_amount : float
  .dirt_tex : texturemap
  .perc_level : float
  .minblur : integer
  .maxblur : integer
  .bitm_preview : string
  .use_file : boolean
  .filemat : filename
  .mtlroom : integer
  .clip_enabled : boolean
  .clip_tex : texturemap
  .clip_th : integer
  .soft : boolean
  .disp_enabled : boolean
  .disp_tex : texturemap
  .disp_subdiv : integer
  .disp_micro : integer
  .disp_height : float
  .disp_center : float
  .disp_bounds : boolean
  .disp_smooth : boolean
  .emit_enabled : boolean
  .emit_tex : texturemap
  .emit_color : RGB color
  .emit_kelvin : integer
  .emit_color_scale : integer
  .use_ies : boolean
  .ies_file : filename
  .power : float

Title: VrayCompTex update
Post by: GroveR_GoL on 2012-09-18, 11:52:44
Hi. I often use VrayCompTex. So here is little code to convert it right to CompositeTexturemap.
Please replace old code

Code: [Select]
try(
for mp in (getClassInstances VRayCompTex) do(
replaceInstances mp mp.sourceA
)
)catch()

by this new one

Code: [Select]
for mp in (getClassInstances VRayCompTex) do
(
temp_CompositeTexturemap = CompositeTexturemap name:#(mp.name) mapList: #(mp.sourceA,mp.sourceB)
temp_CompositeTexturemap.mapList = #(mp.sourceA,mp.sourceB)
--temp_CompositeTexturemap.mapEnabled = #(true,true)
temp_CompositeTexturemap.blendMode = case mp.operator of
(
0:#(0, 2)
1:#(0, 3)
2:#(0, 19)
3:#(0, 5)
4:
(
temp_CompositeTexturemap.mapList[2] = Color_Correction map:mp.sourceB rewireMode:2
#(0, 10)
)
5:#(0, 4)
6:#(0, 8)
default:#(0, 2)
)
replaceInstances mp temp_CompositeTexturemap
)

Thanks.
Title: Re: Material Converter
Post by: racoonart on 2012-09-18, 12:25:58
Javadevil: What are those materials in the layers? It seems like these could be anything? O_o
GroveR_GoL: I will have a look at it and try to implement it in the next version, please give me some details if you want to be named in the header for your input :)
Title: Re: Material Converter
Post by: Javadevil on 2012-09-18, 13:47:36
Code: [Select]
Okay heres commands the mats in the layers.

[code  .Diffuse : RGB color
  .diffuse_tex : texturemap
  .reflectance : RGB color
  .reflectance_tex : texturemap
  .Translucent : RGB color
  .translucent_tex : texturemap
  .absorption_val : float
  .absorption_col : RGB color
  .IOR : float
  .extinction : float
  .trace_refl : boolean
  .exported : boolean
  .sigma : float
  .sigma_tex : texturemap
  .roughness : float
  .roughness_tex : texturemap
  .anisotropy : float
  .anisotropy_tex : texturemap
  .aniso_rot : float
  .aniso_rot_tex : texturemap
  .bump : integer
  .bump_tex : texturemap
  .normal : boolean
  .reflectance90 : RGB color
  .reflectance90_tex : texturemap
  .fresnel_curve_values : float array
  .use_custom_curve : boolean]
Title: Re: Material Converter
Post by: Tom Zamorin on 2012-09-18, 17:40:39
Converter don`t work for me... on legacy CPU version
http://imageshack.us/a/img684/9277/pic21ya.jpg
Title: Re: Material Converter
Post by: Ondra on 2012-09-18, 17:43:58
You have an old version of Corona with incompatible parameter names. There are versions of the script earlier in this thread that work with the older version.

I'm sorry for this temporary incompatibility, soon there will be Alpha v3 as the main build, where the latest version will work
Title: Re: Material Converter
Post by: Tom Zamorin on 2012-09-18, 18:05:36
ааа ) ok.
Thank, very wait.
Title: Re: Material Converter
Post by: Paul Jones on 2012-09-19, 12:09:30
Great script guys! ANyone got a script for deleting FOREVER materials that are not assigned to any object from Slate?
Title: Re: Material Converter
Post by: racoonart on 2012-09-19, 21:23:09
PaulJones: Unfortunately not, I had a quick look on the maxscript helpfiles and it should be possible, but no "one line solution" ;)
Javadevil: I downloaded the TheaRender demo and made a function for converting but... all those maxscript commands seem to be broken. I can get a list of all the commands I need but they are not accessible, or to be more precise, it does not recognize them when I try to read values ("Unknown property: "Diffuse" in...") Those materials and the whole exporter is a pain in the a** anyways... They really want 40 euros for that?!
Title: Re: Material Converter
Post by: Javadevil on 2012-09-20, 03:06:59

Javadevil: I downloaded the TheaRender demo and made a function for converting but... all those maxscript commands seem to be broken. I can get a list of all the commands I need but they are not accessible, or to be more precise, it does not recognize them when I try to read values ("Unknown property: "Diffuse" in...") Those materials and the whole exporter is a pain in the a** anyways... They really want 40 euros for that?!

Okay, I just remembered,  I'm using the beta plugin which is different to the free demo.
I'm guessing they have change the names of the commands.

The maxscript part of the exporter is temporary.
The plugin is slowly being re-written in C++.
Its pretty much the reason I don't use Thea often.

cheers
Title: Re: Material Converter
Post by: GroveR_GoL on 2012-09-20, 10:35:16
DeadClown what about translucency in vray material? I have not found any conversion of it.
maybe do something like this:
Code: [Select]
if vrmat.translucency_on != 0 then
(
cormat.TODOGlassMode = 1
cormat.TODOtranslucencyMult = amin #(1,vrmat.translucency_thickness/100.)
)
else
(
cormat.TODOGlassMode = 0
)
Title: Re: Material Converter
Post by: GroveR_GoL on 2012-09-20, 10:48:58
And this is about Vray2Sided material:
r=origMtl.frontMtl   
      try
      (
         trcolor = origMtl.translucency
         r.levelTranslucency = (trcolor.r+trcolor.g+trcolor.b)/765.
         r.colorTranslucency = origMtl.Translucency  -- translucency color
         r.texmapTranslucency = origMtl.texmap_translucency  -- translucency map
         r.texmapOnTranslucency = true
         r.texmapAmountTranslucency = origMtl.texmap_translucency_multiplier/100.
         if   (origMtl.backMtl == undefined)then
         (
            r.texmapTranslucency = origMtl.frontMtl.texmapDiffuse
            r.texmapAmountTranslucency = 0.5
         )
         
         
         r.GlassMode = 1
         
      )
      catch()
Title: Re: Material Converter
Post by: racoonart on 2012-09-20, 13:20:41
I will have a look at translucency from VrayMtl, but I need to figure out how different those two behave. I made some major fixes on the converter script today and there is a lot to keep in mind - so i will need some time to do that.
Title: Re: Material Converter
Post by: racoonart on 2012-09-20, 13:35:44
Ok, big improvements here, Some MAJOR fixes for finalrender and all of the other materials. Since it is possible to set corona material values above the spinner-ranges there is a lot of error catching needed. I added a internal debugmode which can be activated in the script by setting "CorConvDEBUGmode = false" to "CorConvDEBUGmode = true" right at the beginning. It will print out properties which will not fit into the corona material specs. If there are any things that are printed out please report it here.
I also added VrayCarpaint- and a very basic MR Carpaint conversion (blend material with base and coat mats). Since MR carpaint is quite different from Corona materials there is not that much conversion happening ;) If anyone has a better scheme to convert those materials please tell me :)
It's a very important update so you should replace the old script with this one.

This script uses updated maxscript commands, so it will only work with builds after 16th Sept 2012.

supported materials:
- Standard
- VrayMtl
- VRayBlendMtl
- VRayLightMtl
- VRay2SidedMtl
- VRayCarPaintMtl
- Vray-specific maps
- MR_ArchAndDesign
- MR_Carpaint (basic)
- fR_Advanced
- fR_Architectural

changelog:
*v0.075
*v0.07
Title: Re: Material Converter
Post by: nowastar on 2012-09-23, 16:31:07
when I run the script writes an error
Title: Re: Material Converter
Post by: racoonart on 2012-09-23, 21:14:57
Since "enable_emission" was always written like that from the beginning i suggest this is not happening due to a incompatible version, but to clarify that: which corona build are you using and which script version did you run here?
Title: Re: Material Converter
Post by: Javadevil on 2012-09-24, 01:26:11
Here's an error,
using the latest script 07.
Title: Re: Material Converter
Post by: Ludvik Koutny on 2012-09-24, 09:38:16
I too experience same error as Javadevil :)
Title: Re: Material Converter
Post by: racoonart on 2012-09-24, 10:10:44
arghhh... Sorry guys. That was a nasty typo. I thought I tested this before posting the new version. Anyways, edited the last post, 0.075 is definitely working now!
Title: Re: Material Converter
Post by: Javadevil on 2012-09-24, 13:35:54
Thanks Deadclown, I'll try that.

Also one more request, can you add a reset material editor to corona materials ?

cheers


Title: Re: Material Converter
Post by: racoonart on 2012-09-24, 13:59:15
I'm not sure if this should really be in a material converter script, since it's not converting anything... but I it's a wish i will add a button in the next version ;)
Meanwhile you can use this simple script to do it :):
Code: [Select]
for i = 1 to 24 do(
meditmaterials[i] = CoronaMtl name:((formattedPrint i format:".2d") + " - CoronaMtl")
)
Title: Re: Material Converter
Post by: Javadevil on 2012-09-24, 23:47:43
Sweet, I can't believe how simple that script is !!!

I really have to look into scripting

Thanks
Title: Re: Material Converter
Post by: Ludvik Koutny on 2012-09-28, 23:15:09
I just tried the script and there is one thing that could be done better. In case of converting MR Arch&Design material, if A&D material has translucency, which in MR is done as a part of refraction, refraction in CoronaMTL that is created is set up too, but translucency in Corona works different.

If it is possible, I would add some checking mechanism, and in case translucency in A&D material would be enabled, converted CoronaMTL would always have refraction level set to 0.

Title: Re: Material Converter
Post by: racoonart on 2012-09-28, 23:20:59
aaah, didn't know that. I will check this - shouldn't be a problem to add that :)
Title: Re: Material Converter
Post by: Ludvik Koutny on 2012-09-28, 23:38:52
If you want to do it correctly so user doesn't need to fix materials manually at all, then IF translucency is active THEN you should translate refraction (transparency) value of Arch&Design material to translucency fraction value. If translucency in A&D is disabled, then you translate refraction (refraction is called transparency in A&D material) value to refraction level in CoronaMTL.

Hope it helps :)
Title: Re: Material Converter
Post by: Ludvik Koutny on 2012-10-06, 10:04:27
I created an image explaining how to properly convert translucent Arch&Design materials so we don't have to fix them manually. In case A&D material doesn't have translucency enabled, then proceed usual way and convert transparency to refraction level. Behavior described on image should occur only if source A&D material has translucency enabled. :)

Title: Re: Material Converter
Post by: Javadevil on 2012-10-31, 05:05:59

HI Deadclown,

Whats the latest version of the script ?

It would be a good idea to have the latest script in the first post.
hmm just had a look, your not the first post in this thread.

cheers
Title: Re: Material Converter
Post by: racoonart on 2012-10-31, 09:48:03
There is a new "sticky" Thread, cleaned and formatted ;) All new versions are accessible via the first post : http://forum.corona-renderer.com/index.php/topic,126.0.html (http://forum.corona-renderer.com/index.php/topic,126.0.html)
Title: Re: Material Converter
Post by: Javadevil on 2012-10-31, 09:53:24
There is a new "sticky" Thread, cleaned and formatted ;) All new versions are accessible via the first post : http://forum.corona-renderer.com/index.php/topic,126.0.html (http://forum.corona-renderer.com/index.php/topic,126.0.html)

Aaaah thanks, missed that one.

cheers
Title: Re: Material Converter
Post by: herbap on 2013-03-27, 15:17:44
any chance for promaterials? :)
Title: Re: Material Converter
Post by: racoonart on 2013-03-27, 18:52:22
again, there is a NEW THREAD!
Please do not use this old thread - since some people might be misleaded, load an old version and complain about that it's not working ;)

There is a new "sticky" Thread, cleaned and formatted ;) All new versions are accessible via the first post : http://forum.corona-renderer.com/index.php/topic,126.0.html

Title: Re: [DEPRECATED] Material Converter
Post by: herbap on 2013-03-28, 13:17:45
really sorry...