Ejemplo n.º 1
0
    def process(self):

        # end early?

        if not self.activate:
            return
        ng = self.get_bpy_data_from_name(self.nodegroup_name, bpy.data.node_groups)
        if not ng:
            return
        node = self.get_bpy_data_from_name(self.node_name, ng.nodes)
        if not node:
            return

        named_input = node.inputs.get(self.input_idx)
        
        if ng.bl_idname == 'ScNodeTree':
            # sorcar node tree it needs pure number
            data = self.inputs[0].sv_get()[0][0]
            if self.input_Sc == 'prop_float':
                ng.set_value(node.name,'prop_float', data)
            elif self.input_Sc == 'prop_int':
                ng.set_value(node.name,'prop_int', data)
            elif self.input_Sc == 'prop_angle':
                ng.set_value(node.name,'prop_angle', radians(data))

        elif named_input:
            data = self.inputs[0].sv_get()
            if 'value' in named_input:
                # [ ] switch socket type if needed (AN)
                assign_data(named_input.value, data)
            elif 'value_prop' in named_input:
                # for audio nodes for example
                # https://github.com/nomelif/Audionodes
                named_input.value_prop = data[0][0]
Ejemplo n.º 2
0
    def process(self):
        if not self.activate:
            return

        node_group = bpy.data.node_groups.get(self.nodegroup_name)
        if node_group:
            node = node_group.nodes.get(self.node_name)
            if node:
                named_input = node.inputs.get(self.input_idx)
                if named_input:
                    # [ ] switch socket type if needed
                    data = self.inputs[0].sv_get()
                    assign_data(named_input.value, data)
Ejemplo n.º 3
0
    def process(self):
        if not self.activate:
            return

        node_group = bpy.data.node_groups.get(self.nodegroup_name)
        if node_group:
            node = node_group.nodes.get(self.node_name)
            if node:
                named_input = node.inputs.get(self.input_idx)
                if named_input:
                    # [ ] switch socket type if needed
                    data = self.inputs[0].sv_get()
                    assign_data(named_input.value, data)
Ejemplo n.º 4
0
    def process(self):
        if not self.activate:
            return

        node_group = bpy.data.node_groups.get(self.nodegroup_name)
        if node_group:
            node = node_group.nodes.get(self.node_name)
            if node:
                named_input = node.inputs.get(self.input_idx)
                if named_input:
                    data = self.inputs[0].sv_get()
                    if 'value' in named_input:
                        # [ ] switch socket type if needed
                        assign_data(named_input.value, data)
                    elif 'value_prop' in named_input:
                        # for audio nodes for example
                        # https://github.com/nomelif/Audionodes
                        named_input.value_prop = data[0][0]
Ejemplo n.º 5
0
    def process(self):
        if not self.activate:
            return

        node_group = bpy.data.node_groups.get(self.nodegroup_name)
        if node_group:
            node = node_group.nodes.get(self.node_name)
            if node:
                named_input = node.inputs.get(self.input_idx)
                if named_input:
                    data = self.inputs[0].sv_get()
                    if 'value' in named_input:
                        # [ ] switch socket type if needed
                        assign_data(named_input.value, data)
                    elif 'value_prop' in named_input:
                        # for audio nodes for example
                        # https://github.com/nomelif/Audionodes
                        named_input.value_prop = data[0][0]