Script to replace difuse

Started by Crocq, January 24, 2017, 07:14:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Crocq

Hello guys,

I'm am a new user of Keyshot and i am looking a way to make a script to get a proper relfection map
I would replace all diffuses maps of my scene by a black map.
I there a command line to Get/Set the diffuse map in a material or any workaround?

Thank you

LayC42

you can add a new scene set to switch between original material and "black" material. Then apply the new black material from your library to the top group in your scene tree to change any material to the black one.
That's all - no script needed!

hope that helps

Crocq

 Thank LayC42,

I would like to keep roughness, specular and bump informations of each materials.
I could make multiple render with different materials overdrive and using the clown pass to use them, but it's not really an elegant solution.

Thank you for your input anyway.

DMerz III

I think LayC42 was on the right track. If you would like to not change the specular channel, but just the diffuse color, you could make a separate scene-set. And go to your Library menu > colors > Black and drag that over your scene tree to your high level parts. In theory, it should change JUST the diffuse color of everything within. No script needed.

In fact, this is how we make all "white diffuse" renders on our team, although with the added step of right clicking the high level part folder and selecting change material type to diffuse. Drag white on the folder, and viola, everything is white diffuse but all the bumps are still in tact.

hope this helps?


DMerz III

To backup my theory, I just did a quick test.
Simply dragged over the "black" color swatch from the library onto the top level folder in the scene tree.

There is one caveat, if you're using an image texture map in the diffuse channel, it will not override that unless you toggled down the diffuse channel and check the box that says BLEND WITH COLOR. This color will be black, and if the box is checked, the object will turn black.

Changed this entire scene in 10 seconds with this method.

Crocq

#5
Thats cool thank you!
But is it removing textures if there is already a diffuse map (jpg/png) ?

LayC42

The textures will not be removed if you hold the alt key (and/or shift for labels) while applying the material from the lib.
(sorry, short in time!)