def set_tg0_flavor(node_tree, switch_on): """Set zero texture generation flavor to this shader. :param node_tree: node tree of current shader :type node_tree: bpy.types.NodeTree :param switch_on: flag indication if flavor should be switched on or off :type switch_on: bool """ if switch_on and not tg0.is_set(node_tree): out_node = node_tree.nodes[DifSpecWeightMult2.GEOM_NODE] in_node = node_tree.nodes[DifSpecWeightMult2.UV_SCALE_NODE] in_node2 = node_tree.nodes[DifSpecWeightMult2.BASE_TEX_NODE] out_node.location.x -= 185 * 2 location = (out_node.location.x + 185, out_node.location.y) tg0.init(node_tree, location, out_node.outputs["Global"], in_node.inputs["Vector"]) tg0.init(node_tree, location, out_node.outputs["Global"], in_node2.inputs["Vector"]) elif not switch_on: tg0.delete(node_tree)
def set_tg0_flavor(node_tree, switch_on): """Set zero texture generation flavor to this shader. :param node_tree: node tree of current shader :type node_tree: bpy.types.NodeTree :param switch_on: flag indication if flavor should be switched on or off :type switch_on: bool """ if switch_on and not tg0.is_set(node_tree): out_node = node_tree.nodes[Dif.GEOM_NODE] in_node = node_tree.nodes[Dif.BASE_TEX_NODE] out_node.location.x -= 185 location = (out_node.location.x + 185, out_node.location.y) tg0.init(node_tree, location, out_node.outputs["Global"], in_node.inputs["Vector"]) elif not switch_on: tg0.delete(node_tree)