Material Converter

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

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"
Clinton Reese

http://clintons3d.com
User avatar
Draise
Captain
Posts: 3200
Joined: 21 Sep 2009, 19:33
Type the number ten into the box: 0
Location: Bogota, Colombia

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: 5548
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: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

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: 5548
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: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

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: 5548
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: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

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: 5548
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 9027 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: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

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
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

I am guessing that the YafaRay materials went through a name change at some point?
D3D to YafaRay4tS libray not found.PNG
D3D to YafaRay4tS libray not found.PNG (4.09 KiB) Viewed 7132 times
Wrong name.PNG
Wrong name.PNG (5.34 KiB) Viewed 7132 times
This is the converter you released in the Yafaray4tS v0.9.0 thread. All though it is dated June 14, 2013
These are the names in the combo control:
Yafaray Rough Glass
Yaf_Coated_Glossy
Yaf_Glass
Yaf_Glossy
Yaf_Light_Material
Yaf_Shiny_Diffuse


The current YafaRay Material names:
Yafaray Rough Glass
YafaRay Coated_Glossy
YafaRay Glass
YafaRay Glossy
YafaRay Light_Material
YafaRay Shiny_Diffuse


Also a complied D3D material has to be converted to a D3D Shader before converting to a Yafaray material.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

trueBlue wrote: 03 Aug 2018, 20:51 I am guessing that the YafaRay materials went through a name change at some point?
...
Wrong name.PNG
This is the converter you released in the Yafaray4tS v0.9.0 thread. All though it is dated June 14, 2013
...
Also a complied D3D material has to be converted to a D3D Shader before converting to a Yafaray material.
Yep, the names changed.
Nope, that's your version of the material converter, mine never had the extra controls or the new panel. When you started making changes I thought you would take care of it, so if you didn't fix the names no one did. Should I add that to my list or will you be doing it?
Yep, compiled has to be converted to d3d first.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

Yes the pic shown is the one in the update.
This is the original one I referring to:
viewtopic.php?t=5446&hilit=d3d+ater ... 580#p52448
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

trueBlue wrote: 04 Aug 2018, 00:13 Yes the pic shown is the one in the update.
This is the original one I referring to:
viewtopic.php?t=5446&hilit=d3d+ater ... 580#p52448
That link doesn't show any material converter, goes to page 59 of the discussion for me

Edit: also tried pages 58 an 60 to see if it was off by 1 page - no luck
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

Interesting the link works for me. It is on page 59.
viewtopic.php?t=5446&hilit=d3d+ater ... 580#p52445
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

page59image.jpg
This is what the top of pg 59 using the link looks like for me. Does it look right?
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

Nope! How about you search for D3D material Converter
Thats how I found it.
It is in the Yafaray4tS v0.9.0 thread.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

July 2020 Update:

From previous updates persistent installer 2018, some bug fixes 2019

fix instancing script to work with materials from the FBX import scripts
smaller UI
installer clears recent files lists

http://clintons3d.com/plugins/truespace ... erter.html
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

Update #2, July 2020

bug: Instancing restores the original setting when complete
instancing is multi-selection aware
compiled to D3D is multi-selection aware

the only mode that uses a single selected item is the Indigo converter
yafaray is already multi-selection aware
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

Something is super wrong with this update!
I have 3 cubes in the scene
Nothing selected
I ran Convert with Instancing/Scene
SceneInstancingProblem.png
I took a peak at some of the scene materials and noticed materials from your Cube widget which was not even loaded.
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

trueBlue wrote: 16 Jul 2020, 23:39 Something is super wrong with this update!
I have 3 cubes in the scene
Nothing selected
I ran Convert with Instancing/Scene
SceneInstancingProblem.png
I took a peak at some of the scene materials and noticed materials from your Cube widget which was not even loaded.
I see. I suspect you had nothing selected then ran it with selected option. don't think I accounted for that.

Edit:
Yep, 87 changes here...

Edit:
I did take it into account. It's just wrong, fix is on the way...
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

Fixed

Properly handles no selection used with selected only option for the Compiled to D3D and Instancing scripts. Also caught rare bug of trying to instance materials before any materials have been created.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

This fix is only for the Unofficial Update version of the material converter.

Material Instance Converter was not working with objects that had several materials.
Fixed by moving the logic into a loop of command nodes.
Also added status feedback.

Run the attached script to install the fix. Fix will disappear after a context reset. Not permanent.
Attachments
Material Instance Script Updater.RsObj
(48.59 KiB) Downloaded 176 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

I found your ConstantAlpha shader using your Collada Importer
I have added this shader to your D3D Material Converter and got it working for Transparency
DiffuseStrength.png
DiffuseStrength.png (24.31 KiB) Viewed 3273 times
.
Now I see it is missing DiffuseStrength and SpecularStrength
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

Seems to me that DiffuseStrength and SpecularStrength is like Intensity

Code: Select all

function OnComputeOutputs(params)
{
var SpecularStrength = params.ConValue('SpecularStrength');
var ColorIn = params.ConValue('ColorIn');
var Specular_Color = System.CreateDO('Common Data Package/Color Data');
Specular_Color.SetRed(ColorIn.GetRed() * SpecularStrength);
Specular_Color.SetGreen(ColorIn.GetGreen() * SpecularStrength);
Specular_Color.SetBlue(ColorIn.GetBlue() * SpecularStrength);

params.ConValue('Specular_Color') = Specular_Color;
}

function OnDefaultValue(params)
{
	var conName = params.Param('conName');
	switch (conName)
	{
	case 'SpecularStrength':
		params.Param('vtData') = 1.0;
		params.Param('bHandled') = true;
		break;
	}
}
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

D3D Material Converter
List of changes:
D3D material
SolidColorShader 'DiffuseStrength'
DefaultModelShader 'SpecularStrength'

ConstantAlpha 'Tansparency'
TextureAlpha 'Switch to Alpha X'

convert compiled to d3d script
Add
if(Node.ConExists(currentNode,"Transparency")) processTransparency(currentNode, d3dmat);
function processTransparency(currentNode, d3dmat)

Modified
function processDiffuseColor(currentNode, d3dmat)
function processShininess(currentNode, d3dmat)

Disabled
if(Node.ConExists(currentNode,"SpecularStrength")) processSpecular(currentNode, d3dmat)
function processSpecular(currentNode, d3dmat)

Missing
TextureShader - DiffuseStrength & DiffuseColor

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

Re: Material Converter

Post by trueBlue »

Got the VertexColorShade to work :bananamouse:
Looks like there needs to be more than one ModelShader
Also, would be better if the shaders included their Move and Scale attributes
User avatar
Finis
Captain
Posts: 5410
Joined: 21 May 2009, 18:26
Type the number ten into the box: 0
Location: America!

Re: Material Converter

Post by Finis »

Wow! AI spam? Even slaves in a spam center in India or China wouldn't be cheap enough to create reply text that is relevant to the post.

The spammer inserted links to whatever into the quoted post.
Saul wrote: 19 Aug 2023, 22:32 Hmmmm, wonder where those links go?
One goes to cracked software and hack tools. The other to something about free stuff in games.
Last edited by Finis on 20 Aug 2023, 01:06, edited 4 times in total.
I prefer dangerous freedom over peaceful servitude. -- Thomas Jefferson/Jean Jacques Rousseau
Saul
Senior Chief Petty Officer
Posts: 308
Joined: 22 May 2009, 16:50

Re: Material Converter

Post by Saul »

Hmmmm, wonder where those links go?
U3Dadmin_uno
Site Admin
Posts: 1
Joined: 13 Jan 2017, 18:45
Type the number ten into the box: 10

Re: Material Converter

Post by U3Dadmin_uno »

great catch Finis, I missed those links.
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

@Clinton
I was able to figure out how to add DiffuseStrength to the TextureShader using your Image Gamma from the Components - Compositing library

TextureShader
Add:
Image Gamma
DiffuseStrength


I was also able to figure out how to add the AlphaTestValue to the TextureAlphaShader and connect it to the Material - AlphaTestValue

TextureAlphaShader
Add:
AlphaTestValue

The only thing I can not figure out how to do is the Material - AlphaTest ComboControl
Any chance you could help with this?
EDIT: Just figured out how to do it :D
This is the last thing that is needed to convert all of the Compiled Material Attributes

I am using the InstancingMaterialTree as a test object
The tree on the right has been converted to shaders
As you can see with the Shadow, the AlphaTest ComboControl needs to change to Enable
AlphaTest.png
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

Update July 12 2024

new update uses the new load on demand style installation
added the changes that only existed in the UU except,
- removed clear history
- rewrote to use undo friendly util commands
- does not include the extra material functions that don't actually convert materials
new warning if try to convert a scene instanced material to a yafaray material, which does not support scene instancing


http://clintons3d.com/plugins/truespace ... erter.html
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

The Material Converter is missing a key component

The Base/Compiled D3D material
D3D material.png
.
Is it possible to create a TextureShader that has:
DifTexCoordMoveX
DifTexCoordMoveY
DifTexCoordScaleX
DifTexCoordScaleY

Similar to the TextueAlphaShader and NormalMapShader?
TextureShader.png
.
Edit: Does not look possible due to not being compatible with the UV Editor
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

@Clinton
I think have a better working solution for the Material Converter's convert compiled to d3d script
Updates
Several Functions
Support for old/bad and new Material node
If the D3D material has Alpha or Normal Scale X or Y values greater than 1.000, remove the DefaultTexCoordShader node
Previous version was combing these values in the DefaultTexCoordShader which was negating Alpha and or Normals Scale X or Y
The only limitation is now, the DifCoordScaleX and Y are not being used, in the above scenario, but the conversion is much closer

Also, updated the Material node found in the Components - Inputs and compilers library

The BrikishTextureBump material, found in the Materials - Textures library is a good example to compare this version with the previous version
Previous version negated the Normals shader

Removed due to update
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

trueBlue wrote: 01 Aug 2024, 19:49 @Clinton
I think have a better working solution for the Material Converter's convert compiled to d3d script
Updates
Several Functions
Support for old/bad and new Material node
If the D3D material has Alpha or Normal Scale X or Y values greater than 1.000, remove the DefaultTexCoordShader node
Previous version was combing these values in the DefaultTexCoordShader which was negating Alpha and or Normals Scale X or Y
The only limitation is now, the DifCoordScaleX and Y are not being used, in the above scenario, but the conversion is much closer

Also, updated the Material node found in the Components - Inputs and compilers library

The BrikishTextureBump material, found in the Materials - Textures library is a good example to compare this version with the previous version
Previous version negated the Normals shader
ColorTextureUVsWrong.jpg
ColorTextureUVsWrong.jpg (35.23 KiB) Viewed 1902 times

Using the new Material Converter the color texture is wrong. Left is new material with the faint image of giant bricks. Right is the original base material.


KeepDefTexCoordShaderAdjustOthers.jpg
KeepDefTexCoordShaderAdjustOthers.jpg (46.24 KiB) Viewed 1902 times

The second image shows the corrected original material. The normalmap is set to 1 to adjust. So the DefaultTexCoordShader is set to the original value and then any alpha or normal coords would be adjusted to make it match up. Some math is needed.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

I saved the original compiled Diffuse and Normal images
Both are 16x16 24 bit
DifuuseBrick.png
DifuuseBrick.png (534 Bytes) Viewed 1898 times
NormalBrick.png
NormalBrick.png (724 Bytes) Viewed 1898 times
.
The original compiled D3D material's Diffuse and Normal's ScaleX & ScaleY are set to 20

So, I guess I am not following what is wrong
You have the Diffuse set at 20 and the Normal set to 1
Seems they should both be set as the original, which is 20

Not sure about tS's UV Editor, it only shows one image for both complied and shaders
.
Conversions.png
Left = original compiled
Middle = converted without DefaultTexCoordShader shader with the script I just uploaded
Right = converted with DefaultTexCoordShader shader
As you can see, the right does not show the Normal and does not look like the original
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

trueBlue wrote: 01 Aug 2024, 22:09 I saved the original compiled Diffuse and Normal images
Both are 16x16 24 bit
DifuuseBrick.png
NormalBrick.png
.
The original compiled D3D material's Diffuse and Normal's ScaleX & ScaleY are set to 20

So, I guess I am not following what is wrong
You have the Diffuse set at 20 and the Normal set to 1
Seems they should both be set as the original, which is 20

Not sure about tS's UV Editor, it only shows one image for both complied and shaders
.
Conversions.png
Left = original compiled
Middle = converted without DefaultTexCoordShader shader with the script I just uploaded
Right = converted with DefaultTexCoordShader shader
As you can see, the right does not show the Normal and does not look like the original
ColorTextureUVsWrong2.jpg

Here I replaced the brick color to show the difference more clearly. Left is new material right is the original base material. So now if I add a texture coordinate shader to the new material and set it to scale 20 and 20 the color will match, except now the normal map will multiply and give 400 and 400, so setting normal back to 1 and 1 will make it pick up the texture coord 20 and 20 resulting in both color and normal at 20 and 20. The single source of truth should come from the texture coordinate shader and the others should be adjusted for the desired result.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

"As you can see, the right does not show the Normal and does not look like the original"

Zoom in and you can see the tiny normal map.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

Okay, thanks!
I will not add code that removes the DefaultTexCoordShader node
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

Update Aug 11

base to d3d converter will read the base material alpha and normal texture coordinates
base to d3d converter will read the base material alpha test value

cleans out temp nodes after yafaray conversion is complete

internally the code has been updated to work with the new Material node, but the old Material node is still used in the conversion
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

One thing about the alpha test value. I just got a new laptop and the alpha wasn't working. I had to set it up so tS used the actual graphics card instead of the secondary intel graphics card.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

VertexColorNotMatching.jpg
VertexColorMatching.jpg
Top image shows conversion from base material to compound material using the Unofficial Update version of the D3D Material Converter.
The converted sphere on the right does not match the original on the left.

Bottom image adds the third sphere using the material converter from the website. This result looks the same as the original.

Both scene files are attached below.
Attachments
Space3D_VertColorCorrect.RsScn
(666.75 KiB) Downloaded 34 times
Space3D_VertColor.RsScn
(597.94 KiB) Downloaded 34 times
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

Update Aug 25

convert from base to compound will use the DiffuseStrength
convert from base to compound will use the SpecularStrength with values greater than 1, before only used values less than or equal to 1

https://clintons3d.com/plugins/truespac ... erter.html
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

Update Aug 25 again

convert from base to compound will use diffuse strength with diffuse texture
convert from base to compound will read transparency value
convert from base to compound option to convert material as metallic

When converting as metallic the specular color will be taken from the diffuse color. Texture material will use the texture as the specular color.
Non-metallic conversion will continue to use white/shades of gray for the specular color.

There is no way for script to tell if a base material is metallic or not. So it uses the all or nothing checkbox to control the conversion.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

Here is a TexCoord.RsObj
Changed TCMoveX connector from Float to TCMoveX
Attachments
TexCoord.RsObj
(19.97 KiB) Downloaded 38 times
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

trueBlue wrote: 27 Aug 2024, 16:13 Here is a TexCoord.RsObj
Changed TCMoveX connector from Float to TCMoveX
How did you change it?
When I looked at the original the label is "TCMoveX" but when hover over the connection it is "Float" and the scripts see "Float".
I tried changing it but nothing I did worked.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

clintonman wrote: 27 Aug 2024, 16:57
trueBlue wrote: 27 Aug 2024, 16:13 Here is a TexCoord.RsObj
Changed TCMoveX connector from Float to TCMoveX
How did you change it?
When I looked at the original the label is "TCMoveX" but when hover over the connection it is "Float" and the scripts see "Float".
I tried changing it but nothing I did worked.
I add a script inside the TexCoord.RsObj with a number attribute named TCMoveX
Removed the Float connector
Exported the script's TCMoveX connector
Hooked up the TCMoveX to the Input
Removed the script
Hook it up.png
.
Renaming the Float to TCMoveX does not really work, especially when trying to animate it, it shows a Float
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

trueBlue wrote: 27 Aug 2024, 17:03
clintonman wrote: 27 Aug 2024, 16:57
trueBlue wrote: 27 Aug 2024, 16:13 Here is a TexCoord.RsObj
Changed TCMoveX connector from Float to TCMoveX
How did you change it?
When I looked at the original the label is "TCMoveX" but when hover over the connection it is "Float" and the scripts see "Float".
I tried changing it but nothing I did worked.
I add a script inside the TexCoord.RsObj with a number attribute named TCMoveX
Removed the Float connector
Exported the script's TCMoveX connector
Hooked up the TCMoveX to the Input
Removed the script
Hook it up.png
.
Renaming the Float to TCMoveX does not really work, especially when trying to animate it, it shows a Float
Thanks, good to know. I think I'll make a script based on those steps.
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5548
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: Material Converter

Post by trueBlue »

A better way would be to create an OnComputeOutputs Map
So, you can set Default values and use more mean full names
OnComputeOutputs Map.png
You could make individual Maps for Alpha and Normal
Alpha and Normal Maps.png
.
That way it would make animating attributes much easier
Attribute Browser.png
.
Attachments
AlphaTexCoord.RsObj
(24.74 KiB) Downloaded 34 times
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

trueBlue wrote: 27 Aug 2024, 17:57 A better way would be to create an OnComputeOutputs Map
So, you can set Default values and use more mean full names
OnComputeOutputs Map.png
You could make individual Maps for Alpha and Normal
Alpha and Normal Maps.png
.
That way it would make animating attributes much easier
Attribute Browser.png

.
When I said I would write a script I didn't mean for the Material Converter.
The new release does have some new code in place for using uv move and scale if the Alpha and Normal nodes already have them. It just needs some small changes to make it work.
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

Aug 27 2024 update


added ALPHAMAP usage required for the tS collada exporter, also some other usage values set
fixed UV move XY for alpha and normal
convert to yafaray light material, if constant color will use it instead of diffuse color
base to compound, if base has Name copy it
fix - only add normal and alpha tex coords nodes if needed when converting base to compound. thats to say only add extra nodes if normal uv or alpha uv doesn't match the diffuse uv
Clinton Reese

http://clintons3d.com
User avatar
clintonman
Captain
Posts: 5659
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California

Re: Material Converter

Post by clintonman »

March 2025 Update

There was a bug in the scene instance conversion.
A mesh with multiple materials will have a material node order when created. When one of the materials is replaced this can change the order the material node connections. The instanced converter couldn't handle the reordered nodes. The fix ignores the order of the material nodes and only looks at the material indices.

https://clintons3d.com/plugins/truespac ... erter.html
Clinton Reese

http://clintons3d.com

Return to “Repositorium”