Ejemplo n.º 1
0
    def set_paint_flavor(node_tree, switch_on):
        """Set paint 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
        """

        diff_col_n = node_tree.nodes[UnlitTex.DIFF_COL_NODE]
        diff_mult_n = node_tree.nodes[UnlitTex.TEX_MULT_NODE]

        if switch_on:

            for node in node_tree.nodes:
                if node.location.x > diff_col_n.location.x:
                    node.location.x += 185

            location = (diff_mult_n.location.x - 185,
                        diff_mult_n.location.y + 50)
            paint.init(node_tree, location, diff_col_n.outputs["Color"],
                       diff_mult_n.inputs[0])

        else:
            paint.delete(node_tree)
Ejemplo n.º 2
0
    def set_paint_flavor(node_tree, switch_on):
        """Set paint 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
        """

        diff_col_n = node_tree.nodes[Dif.DIFF_COL_NODE]
        diff_mult_n = node_tree.nodes[Dif.DIFF_MULT_NODE]

        if switch_on:

            location = (diff_mult_n.location.x - 185, diff_mult_n.location.y + 50)
            paint.init(node_tree, location, diff_col_n.outputs["Color"], diff_mult_n.inputs["Color1"])

        else:
            paint.delete(node_tree)