Material Converter

free scripts, plugins, models, textures
User avatar
clintonman
Captain
Posts: 5422
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: 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: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

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

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 121 times
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5208
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 756 times
.
Now I see it is missing DiffuseStrength and SpecularStrength
User avatar
trueBlue
Captain
Posts: 5208
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: 5208
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: 5208
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: 5256
Joined: 21 May 2009, 18:26
Type the number ten into the box: 0
Location: North Venezuela or West Korea
Contact:

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.
Mice die in traps because they don't know why the cheese is free. -- seen on a bumper sticker
Saul
Senior Chief Petty Officer
Posts: 296
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.
Post Reply