checks = [self.check_group,
self.check_scale,
+ self.check_tint,
self.check_gray,
self.check_extract,
self.check_normal,
self.data = self.node.inputs[i].default_value
return self.set_input_from_linked(self.node.inputs[1-i])
+ def check_tint(self):
+ if self.node.type!='MIX_RGB':
+ return
+
+ if self.node.blend_type=='MULTIPLY':
+ for i in range(2):
+ if not self.node.inputs[1+i].is_linked:
+ self.type = 'TINT'
+ self.data = self.node.inputs[1+i].default_value[:]
+ return self.set_input_from_linked(self.node.inputs[2-i])
+
def check_gray(self):
if self.node.type=='RGBTOBW':
self.type = 'GRAY'
self.texture = None
self.tex_channels = None
self.scale = 1.0
+ self.tint = None
def set_from_input(self, node_tree, input_socket, alpha_socket=None):
if self.keyword:
channels = ['~'+c if c in n.data else c for c in channels]
elif n.type=='SCALE':
self.scale = n.data
+ elif n.type=='TINT':
+ self.tint = n.data
elif n.type=='TEXTURE':
self.texture = n.node
n = n.input
self.type = "pbr"
base_color = self.create_property("base_color", (0.8, 0.8, 0.8, 1.0))
+ tint = self.create_property("tint", (1.0, 1.0, 1.0, 1.0))
metalness = self.create_property("metalness", 0.0)
roughness = self.create_property("roughness", 0.5)
normal = self.create_property("normal_map")
emission = self.create_property("emission", (0.0, 0.0, 0.0))
base_color.set_from_input(material.node_tree, from_node.inputs["Base Color"], from_node.inputs["Alpha"])
+ if base_color.tint:
+ tint.value = base_color.tint
metalness.set_from_input(material.node_tree, from_node.inputs["Metallic"])
roughness.set_from_input(material.node_tree, from_node.inputs["Roughness"])
normal.set_from_input(material.node_tree, from_node.inputs["Normal"])