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

2012-09-11, 13:20:16

GroveR_GoL

  • Active Users
  • **
  • Posts: 28
    • View Profile
    • www.gg3dcg.ru
This thread is for archive purposes only, use the convertor here: http://corona-renderer.com/forum/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.
« Last Edit: 2013-03-28, 11:05:02 by Keymaster »

2012-09-11, 13:31:42
Reply #1

DeadClown

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

2012-09-11, 13:40:59
Reply #2

Javadevil

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



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

2012-09-11, 13:45:08
Reply #3

GroveR_GoL

  • Active Users
  • **
  • Posts: 28
    • View Profile
    • www.gg3dcg.ru
Ok, here is unencrypted code:

2012-09-11, 13:56:40
Reply #4

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1439
    • View Profile
    • racoon-artworks
Javadevil: I'll try to get Arch&Design mats done next weekend, currently there's no time for scripting ;)
GroveR_GoL: Thanks! :)
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-11, 15:46:41
Reply #5

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 8895
  • Turning coffee to features since 2009
    • View Profile
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.
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-11, 15:57:06
Reply #6

DeadClown

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

2012-09-11, 17:38:09
Reply #7

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1439
    • View Profile
    • racoon-artworks
[edit] v0.07: latest version here: http://corona-renderer.com/forum/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.
« Last Edit: 2013-03-27, 16:53:12 by DeadClown »
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-11, 17:40:00
Reply #8

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2562
  • Just another user
    • View Profile
    • My Portfolio

2012-09-11, 21:33:26
Reply #9

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1439
    • View Profile
    • racoon-artworks
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)
« Last Edit: 2013-03-27, 16:53:21 by DeadClown »
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-11, 22:51:27
Reply #10

Paul Jones

  • Active Users
  • **
  • Posts: 169
    • View Profile
fantastic work guys :)

2012-09-11, 23:32:58
Reply #11

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 8895
  • Turning coffee to features since 2009
    • View Profile
Have you considered using more standard OSS tools, for example versioning & publishing the script somewhere like github or sourceforge?
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-11, 23:47:47
Reply #12

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1439
    • View Profile
    • racoon-artworks
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)
« Last Edit: 2012-09-11, 23:55:45 by DeadClown »
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-12, 00:05:47
Reply #13

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 8895
  • Turning coffee to features since 2009
    • View Profile
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 ;)
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-12, 00:35:33
Reply #14

Javadevil

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

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.





2012-09-12, 11:22:11
Reply #15

GroveR_GoL

  • Active Users
  • **
  • Posts: 28
    • View Profile
    • www.gg3dcg.ru
Dead clown, your code is so cool, I've learned some new features from it. Thanks for sharing.

2012-09-12, 11:30:40
Reply #16

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1439
    • View Profile
    • racoon-artworks
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
« Last Edit: 2013-03-27, 16:52:46 by DeadClown »
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-12, 11:34:05
Reply #17

GroveR_GoL

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

2012-09-12, 11:52:18
Reply #18

GroveR_GoL

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

2012-09-12, 12:01:57
Reply #19

DeadClown

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

2012-09-12, 15:01:37
Reply #20

Javadevil

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

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

2012-09-12, 15:50:06
Reply #21

DeadClown

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

2012-09-13, 12:59:15
Reply #22

Javadevil

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

Thanks Deadclown.


2012-09-14, 23:06:29
Reply #23

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2562
  • Just another user
    • View Profile
    • My Portfolio
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? :)

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

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 8895
  • Turning coffee to features since 2009
    • View Profile
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 :/
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-15, 00:42:30
Reply #25

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1439
    • View Profile
    • racoon-artworks
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"
« Last Edit: 2012-09-15, 00:45:13 by DeadClown »
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-16, 12:46:36
Reply #26

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 8895
  • Turning coffee to features since 2009
    • View Profile
I've renamed the parameters in the newest build, so the script is temporarily broken, until somebody rewrites it.
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-16, 13:36:36
Reply #27

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1439
    • View Profile
    • racoon-artworks
I will do that asap. May take some time though ;)
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-16, 13:40:38
Reply #28

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 8895
  • Turning coffee to features since 2009
    • View Profile
ok, thanks, same goes for other converters (if they use any parameters)
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-16, 14:06:58
Reply #29

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1439
    • View Profile
    • racoon-artworks
seems like displacement mapslot has wrong naming. It has the same name as diffuse.
.texmapDiffuse (Diffuse_texture) : texturemap
.texmapDiffuse (Displace_texmap) : texturemap
Any sufficiently advanced bug is indistinguishable from a feature.

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

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 8895
  • 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: 1439
    • 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: 273
  • 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: 360
    • 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: 1439
    • 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: 360
    • 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: 1439
    • 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: 1439
    • 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: 360
    • 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: 1439
    • 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: 360
    • 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: 8895
  • 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.

2012-09-19, 12:09:30
Reply #45

Paul Jones

  • Active Users
  • **
  • Posts: 169
    • View Profile
Great script guys! ANyone got a script for deleting FOREVER materials that are not assigned to any object from Slate?

2012-09-19, 21:23:09
Reply #46

DeadClown

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

2012-09-20, 03:06:59
Reply #47

Javadevil

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

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

2012-09-20, 10:35:16
Reply #48

GroveR_GoL

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

2012-09-20, 10:48:58
Reply #49

GroveR_GoL

  • Active Users
  • **
  • Posts: 28
    • View Profile
    • www.gg3dcg.ru
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()
« Last Edit: 2012-09-20, 14:57:24 by GroveR_GoL »

2012-09-20, 13:20:41
Reply #50

DeadClown

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

2012-09-20, 13:35:44
Reply #51

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1439
    • View Profile
    • racoon-artworks
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
  • fixed nasty Vray Error
*v0.07
  • added VRayCarPaintMtl
  • added basic MR_Carpaint
  • added better VrayCompTex conversion by gover_gol
  • Clamped several levels spinners (important fix)
  • added inversion of negative bump values (important fix)
  • Fixed several FinalRender Material issues (important fix)
  • changed selection conversion methods to instancing (removed debug)
  • added advanced debug mode for internal use (off by default)
« Last Edit: 2013-03-27, 16:50:02 by DeadClown »
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-23, 16:31:07
Reply #52

nowastar

  • Active Users
  • **
  • Posts: 13
    • View Profile
when I run the script writes an error

2012-09-23, 21:14:57
Reply #53

DeadClown

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

2012-09-24, 01:26:11
Reply #54

Javadevil

  • Active Users
  • **
  • Posts: 360
    • View Profile
Here's an error,
using the latest script 07.

2012-09-24, 09:38:16
Reply #55

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2562
  • Just another user
    • View Profile
    • My Portfolio
I too experience same error as Javadevil :)

2012-09-24, 10:10:44
Reply #56

DeadClown

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

2012-09-24, 13:35:54
Reply #57

Javadevil

  • Active Users
  • **
  • Posts: 360
    • View Profile
Thanks Deadclown, I'll try that.

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

cheers



2012-09-24, 13:59:15
Reply #58

DeadClown

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

2012-09-24, 23:47:43
Reply #59

Javadevil

  • Active Users
  • **
  • Posts: 360
    • View Profile
Sweet, I can't believe how simple that script is !!!

I really have to look into scripting

Thanks

2012-09-28, 23:15:09
Reply #60

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2562
  • Just another user
    • View Profile
    • My Portfolio
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.


2012-09-28, 23:20:59
Reply #61

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1439
    • View Profile
    • racoon-artworks
aaah, didn't know that. I will check this - shouldn't be a problem to add that :)
Any sufficiently advanced bug is indistinguishable from a feature.

2012-09-28, 23:38:52
Reply #62

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2562
  • Just another user
    • View Profile
    • My Portfolio
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 :)

2012-10-06, 10:04:27
Reply #63

Ludvik Koutny

  • VIP
  • Active Users
  • ***
  • Posts: 2562
  • Just another user
    • View Profile
    • My Portfolio
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. :)


2012-10-31, 05:05:59
Reply #64

Javadevil

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

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

2012-10-31, 09:48:03
Reply #65

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1439
    • View Profile
    • racoon-artworks
There is a new "sticky" Thread, cleaned and formatted ;) All new versions are accessible via the first post : http://corona-renderer.com/forum/index.php/topic,126.0.html
Any sufficiently advanced bug is indistinguishable from a feature.

2012-10-31, 09:53:24
Reply #66

Javadevil

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

Aaaah thanks, missed that one.

cheers

2013-03-27, 15:17:44
Reply #67

herbap

  • Active Users
  • **
  • Posts: 22
    • View Profile
any chance for promaterials? :)

2013-03-27, 18:52:22
Reply #68

DeadClown

  • Global Moderator
  • Active Users
  • ****
  • Posts: 1439
    • View Profile
    • racoon-artworks
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://corona-renderer.com/forum/index.php/topic,126.0.html

Any sufficiently advanced bug is indistinguishable from a feature.

2013-03-28, 13:17:45
Reply #69

herbap

  • Active Users
  • **
  • Posts: 22
    • View Profile
really sorry...