Beispiel #1
0
    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)
Beispiel #2
0
    def set_aux0(node_tree, aux_property):
        """Set zero texture generation scale.

        :param node_tree: node tree of current shader
        :type node_tree: bpy.types.NodeTree
        :param aux_property: zero texture generation scale represented with property group
        :type aux_property: bpy.types.IDPropertyGroup
        """

        if tg0.is_set(node_tree):

            tg0.set_scale(node_tree, aux_property[0]['value'], aux_property[1]['value'])
Beispiel #3
0
    def set_aux0(node_tree, aux_property):
        """Set zero texture generation scale.

        :param node_tree: node tree of current shader
        :type node_tree: bpy.types.NodeTree
        :param aux_property: secondary specular color represented with property group
        :type aux_property: bpy.types.IDPropertyGroup
        """

        if tg0.is_set(node_tree):

            tg0.set_scale(node_tree, aux_property[0]['value'],
                          aux_property[1]['value'])
Beispiel #4
0
    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)