WIP: MaterialX addon #104594

Closed
Bogdan Nagirniak wants to merge 34 commits from BogdanNagirniak/blender-addons:materialx-addon into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit 5a9ceb92dc - Show all commits

View File

@ -9,10 +9,6 @@ from ..utils import get_mx_node_input_types
from . import log from . import log
SSS_MIN_RADIUS = 0.0001
DEFAULT_WHITE_COLOR = (1.0, 1.0, 1.0)
def enabled(val): def enabled(val):
if val is None: if val is None:
return False return False
@ -108,7 +104,7 @@ class ShaderNodeBsdfPrincipled(NodeParser):
if enabled(specular): if enabled(specular):
result.set_inputs({ result.set_inputs({
'specular': specular, 'specular': specular,
'specular_color': DEFAULT_WHITE_COLOR, 'specular_color': base_color,
'specular_roughness': roughness, 'specular_roughness': roughness,
'specular_IOR': ior, 'specular_IOR': ior,
'specular_anisotropy': anisotropic, 'specular_anisotropy': anisotropic,
@ -118,7 +114,7 @@ class ShaderNodeBsdfPrincipled(NodeParser):
if enabled(transmission): if enabled(transmission):
result.set_inputs({ result.set_inputs({
'transmission': transmission, 'transmission': transmission,
'transmission_color': DEFAULT_WHITE_COLOR, 'transmission_color': base_color,
'transmission_extra_roughness': transmission_roughness, 'transmission_extra_roughness': transmission_roughness,
}) })
@ -133,14 +129,14 @@ class ShaderNodeBsdfPrincipled(NodeParser):
if enabled(sheen): if enabled(sheen):
result.set_inputs({ result.set_inputs({
'sheen': sheen, 'sheen': sheen,
'sheen_color': DEFAULT_WHITE_COLOR, 'sheen_color': base_color,
'sheen_roughness': roughness, 'sheen_roughness': roughness,
}) })
if enabled(clearcoat): if enabled(clearcoat):
result.set_inputs({ result.set_inputs({
'coat': clearcoat, 'coat': clearcoat,
'coat_color': DEFAULT_WHITE_COLOR, 'coat_color': base_color,
'coat_roughness': clearcoat_roughness, 'coat_roughness': clearcoat_roughness,
'coat_IOR': ior, 'coat_IOR': ior,
'coat_anisotropy': anisotropic, 'coat_anisotropy': anisotropic,