Material Converter

free scripts, plugins, models, textures
User avatar
clintonman
Captain
Posts: 4259
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Material Converter

Post by clintonman »

Just finished a material converter script. It has 4 functions

Convert material instancing to None, Object or Scene
Convert a compiled material to a BlankDX(D3D) style
Convert BlankDX(D3D) material to Yafaray material
Convert BlankDX(D3D) material to Indigo material

It will convert basic colors and texture maps. Workspace procedural materials are not supported.

The instancing converter is useful for Indigo because it requires scene instanced materials.

Conversion to the BlankDX(D3D) style is useful because most exporter scripts I've written use this type of material and the Yafaray and Indigo converters listed above need the materials in this format. It will convert the Lightworks materials that are automatically converted to compiled materials when they cross the bridge and it will convert many(most?) of the materials from the Materials-DX9 and Materials-Textures libraries.

The conversion to Indigo needs to have the existing materials already scene instanced.

Be sure to save your scene before converting. Materials in trueSpace are not one consistent scheme and I could easily have missed a case or two that might give an unpredictable conversion.

Find the script here, middle of the page:

http://www.clintons3d.com/plugins/trues ... index.html" onclick="window.open(this.href);return false;
Clinton Reese

http://clintons3d.com

User avatar
Draise
Captain
Posts: 3173
Joined: 21 Sep 2009, 19:33
Type the number ten into the box: 0
Location: Bogota, Colombia
Contact:

Re: Material Converter

Post by Draise »

GREAT! This is awesome, I am starting to do pass shading in WS and sometimes loading object instances then needing to copy and paste and convert shaders to Scene instances for the pass script is quite tedious! Instance converter sounds amazing!

I will try this out and see how it will works!

User avatar
trueBlue
Captain
Posts: 3727
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

This is an awesome script!
With regards to converting compiled materials:
I guess there is no D3D material equivalent for DiffuseStrength, SpecularStrength, Transparency, VertexColorStrength?

User avatar
clintonman
Captain
Posts: 4259
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Material Converter

Post by clintonman »

trueBlue wrote:
05 May 2018, 23:24
This is an awesome script!
With regards to converting compiled materials:
I guess there is no D3D material equivalent for DiffuseStrength, SpecularStrength, Transparency, VertexColorStrength?
The D3d material has transparency in the form of alpha value. I'm guessing the various "strengths" are for lightworks rendering.
Clinton Reese

http://clintons3d.com

User avatar
trueBlue
Captain
Posts: 3727
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

I was looking at the Blinn material. Wonder if that would work? That is if it does not interfere with your exporters.
Looking at other components it looks like Color has an Alpha = W

User avatar
clintonman
Captain
Posts: 4259
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Material Converter

Post by clintonman »

trueBlue wrote:
06 May 2018, 00:34
I was looking at the Blinn material. Wonder if that would work? That is if it does not interfere with your exporters.
Looking at other components it looks like Color has an Alpha = W
Where can I find the blinn material?
Clinton Reese

http://clintons3d.com

User avatar
trueBlue
Captain
Posts: 3727
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

I remember Jack Edwards suggesting that this should be the Default Material.

It is in the 'Materials - DX9' library and also in the 'Shaders - Model Shaders' library.
As you mentioned it is using the Alpha Test which has to be Enabled and set the Opacity.
Take a peek inside the material at the Alpha_shader and Model_shader (which has Diffuse and Specular)

As for Transparency, I was experimenting with the Object Render Attributes, Surface Opacity.

User avatar
clintonman
Captain
Posts: 4259
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Material Converter

Post by clintonman »

ModelShaders.jpg
I see, no it wouldn't work with the existing blinn model shader. The blinn shader would have to be altered to accept a color or some translation of color and then a second version would be needed to accept a texture or maybe both color and texture could be added at once.
I'm sure it can be done with some work. To work with the converter the blinn model shader would need to have the inputs for color, texture and shininess and it might have to be renamed to "DefaultModelShader" to fool the converter code and any exporters that depend on it, not sure about that.
Clinton Reese

http://clintons3d.com

User avatar
trueBlue
Captain
Posts: 3727
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

With your plugin, are you able to set a material in the Vray Material Editor?
If so do you set the string to the material in the library?
What is the Varible?
Capture.PNG
Capture.PNG (5.89 KiB) Viewed 3643 times
Could you set a component of a material as in a Shader?
Trying to reset the shaders in the Vray Material Editor.
Vray.ResetMaterialEditorShader('Color');
The above command causes an error running Vray in tS761Std.

User avatar
clintonman
Captain
Posts: 4259
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: Material Converter

Post by clintonman »

I don't know. I don't have v-ray so I've never done anything with it.
Clinton Reese

http://clintons3d.com

Post Reply