Author Topic: [DEPRECATED] Material Converter  (Read 36602 times)

2012-09-16, 14:16:24
Reply #30

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 8904
  • Turning coffee to features since 2009
    • View Profile
right. I've fixed it. I can give you the build on skype, dropbox not working for me ATM.
Rendering is magic.
Private scene uploader | How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2012-09-17, 12:25:25
Reply #31

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1444
    • View Profile
    • racoon-artworks
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
  • added support for emission converting: standard material, MR_ArchAndDesign, fR_Advanced, fR_Architectural
  • Switched to new maxscript properties naming (valid for builds after 16th Sept 2012)
  • added "corona" prefix checkbox
  • code clean-ups, little enhancements
  • fixed anisotropy conversion from (fR+Mr)arch materials
v0.05
  • converted maps keep original name
  • added mode for converting VrayBlend to multilayerd blend materials

[edit] sorry guys, fixed a little typo which caused an error when converting a standardmaterial with selfillum, please re-load 0.06.ms :S
« Last Edit: 2013-03-27, 16:52:21 by DeadClown »
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-17, 13:23:09
Reply #32

michaltimko

  • Active Users
  • **
  • Posts: 286
  • Coronaut (c)
    • View Profile
Thanks a lot Martin
Coronaut!(c)2011

Supporting Corona in commercial projects since pre-alpha

2012-09-17, 14:41:16
Reply #33

Javadevil

  • Active Users
  • **
  • Posts: 372
    • View Profile

Great stuff Deadclown !!

Any chance of converting thea materials ?

2012-09-17, 15:02:46
Reply #34

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1444
    • View Profile
    • racoon-artworks
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 :)
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-17, 15:11:48
Reply #35

Javadevil

  • Active Users
  • **
  • Posts: 372
    • View Profile

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

cheers

2012-09-17, 15:33:56
Reply #36

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1444
    • View Profile
    • racoon-artworks
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 :)
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-17, 17:53:29
Reply #37

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1444
    • View Profile
    • racoon-artworks
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.
« Last Edit: 2012-09-17, 18:03:16 by DeadClown »
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-18, 00:12:45
Reply #38

Javadevil

  • Active Users
  • **
  • Posts: 372
    • View Profile

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


2012-09-18, 11:52:44
Reply #39

GroveR_GoL

  • Active Users
  • **
  • Posts: 28
    • View Profile
    • www.gg3dcg.ru
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.

2012-09-18, 12:25:58
Reply #40

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1444
    • View Profile
    • racoon-artworks
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 :)
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-18, 13:47:36
Reply #41

Javadevil

  • Active Users
  • **
  • Posts: 372
    • View Profile
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]

2012-09-18, 17:40:39
Reply #42

Tom Zamorin

  • Active Users
  • **
  • Posts: 83
    • View Profile
    • my gallery
Converter don`t work for me... on legacy CPU version
http://imageshack.us/a/img684/9277/pic21ya.jpg

2012-09-18, 17:43:58
Reply #43

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 8904
  • Turning coffee to features since 2009
    • View Profile
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
Rendering is magic.
Private scene uploader | How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2012-09-18, 18:05:36
Reply #44

Tom Zamorin

  • Active Users
  • **
  • Posts: 83
    • View Profile
    • my gallery
ааа ) ok.
Thank, very wait.