+ separate = None
+ invert_channels = ""
+ for c in ("R", "G", "B"):
+ from_node, _ = get_linked_node_and_socket(self.node_tree, self.node.inputs[c])
+ if from_node.type=='MATH' and from_node.operation=='SUBTRACT' and not from_node.inputs[0].is_linked and from_node.inputs[0].default_value==1.0:
+ invert_channels += c
+ from_node, _ = get_linked_node_and_socket(self.node_tree, from_node.inputs[1])
+
+ if from_node.type=='SEPRGB' and (separate is None or from_node==separate):
+ separate = from_node
+ else:
+ return
+
+ self.type = 'INVERT'
+ self.data = invert_channels
+
+ return self.set_input_from_linked(separate.inputs["Image"])
+
+ def check_additive_blend(self):
+ if self.node.type=='ADD_SHADER':
+ from .util import get_linked_node_and_socket
+
+ for i in range(2):
+ shader, _ = get_linked_node_and_socket(self.node_tree, self.node.inputs[i])
+ if shader.type=='BSDF_TRANSPARENT':
+ self.type = 'ADDITIVE'
+ return self.set_input_from_linked(self.node.inputs[1-i])
+
+ def check_texture(self):
+ if self.node.type=='TEX_IMAGE':
+ self.type = 'TEXTURE'
+
+def get_unlit_inputs(node_tree, node, additive):
+ from .util import get_linked_node_and_socket
+
+ if node.type=='MIX_SHADER' and not additive: