Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: M_SON on 2019-04-23, 18:08:26

Title: .MTL file
Post by: M_SON on 2019-04-23, 18:08:26
Hi guys,
I have an object only with .mtl file and I really don't know how to make it work, I tried with user paths, import but doesn't work. How should I use this .mtl file?
Thank you!
Title: Re: .MTL file
Post by: romullus on 2019-04-23, 19:04:30
MTL is just a text file that defines most basic parameters of object's materials. It is completely useless on its own and only make sense when there's accompanying OBJ file.
Title: Re: .MTL file
Post by: M_SON on 2019-04-23, 20:03:31
MTL is just a text file that defines most basic parameters of object's materials. It is completely useless on its own and only make sense when there's accompanying OBJ file.

but I have that object file, still doesn't work. I imported that file but useless.
Title: Re: .MTL file
Post by: romullus on 2019-04-23, 20:09:22
Make sure that import materials is checked in import dialog. That should import object with standard material(-s) applied and textures assigned if such exist. You can open MTL file in notepad and see what it is written there, sometimes it contains no useful information, just a software name in which it was created :]
Title: Re: .MTL file
Post by: M_SON on 2019-04-23, 20:18:53
Make sure that import materials is checked in import dialog. That should import object with standard material(-s) applied and textures assigned if such exist. You can open MTL file in notepad and see what it is written there, sometimes it contains no useful information, just a software name in which it was created :]

It was checked import materials, this is the .mtl file in notepad, but I don't have a clue if just useless text or not

Title: Re: .MTL file
Post by: romullus on 2019-04-23, 21:37:30
Materials are there, so you should have an object with standard materials assigned after import. What do you get? An object without any material? Does 3ds max shows warning about missing MTL file on import?
Title: Re: .MTL file
Post by: Njen on 2019-04-24, 08:35:36
That's a pretty simple material file, and you could recreate those materials in just a few minutes. In fact it's so simple, you don't even need it, as you will want to use Corona materials anyway, instead of standard Max materials. But if you did want to recreate it, there are really only a few lines you need to care about:

'Ka' is 'constant ambient', which is the ambient colour of a standard Max material (in linear float format).
'Kd' is 'constant diffuse', which is the diffuse colour of a standard Max material (in linear float format).
'Ks' is 'constant specular', which is the specular colour of a standard Max material (in linear float format).

All you need to do is find a simple calculator to convert linear float numbers into sRGB integer numbers, there are plenty online. Takes me back to my Renderman shader writing days, where I would code shader files in a text editor.
Title: Re: .MTL file
Post by: romullus on 2019-04-24, 10:20:20
You don't even need a calculator, just use Corona colour picker.