Ejemplo n.º 1
0
    def mode_change(self, context):

        if not (self.items_ == self.current_op):
            self.label = self.items_
            self.update_outputs_and_inputs()
            self.current_op = self.items_
            updateNode(self, context)
Ejemplo n.º 2
0
    def mode_change(self, context):

        if not (self.selected_hyper == self.current_hyper):
            self.label = self.selected_hyper
            self.update_outputs_and_inputs()
            self.current_hyper = self.selected_hyper
            updateNode(self, context)
Ejemplo n.º 3
0
    def mode_change(self, context):
        # just because click doesn't mean we need to change mode
        mode = self.mode
        if mode == self.current_mode:
            return

        if mode == 'VERTEX':
            n = 2 if "Vert A" in self.inputs else 1
            while len(self.inputs) > n:
                self.inputs.remove(self.inputs[-1])
            if n == 1:
                self.inputs.new('VerticesSocket', "Vert A", "Vert A")

        if mode == 'AXIS':
            n = 2 if "Vert A" in self.inputs else 1
            if n == 2:
                while len(self.inputs) > n:
                    self.inputs.remove(self.inputs[-1])
                self.inputs.new('VerticesSocket', "Vert B", "Vert B")
            else:
                while len(self.inputs) > n:
                    self.inputs.remove(self.inputs[-1])
                self.inputs.new('VerticesSocket', "Vert A", "Vert A")
                self.inputs.new('VerticesSocket', "Vert B", "Vert B")

        if mode == 'PLANE':
            while len(self.inputs) > 1:
                self.inputs.remove(self.inputs[-1])
            self.inputs.new('MatrixSocket', "Plane", "Plane")

        self.current_mode = mode
        updateNode(self, context)
Ejemplo n.º 4
0
    def mode_change(self, context):
        # just because click doesn't mean we need to change mode
        mode = self.mode
        if mode == self.current_mode:
            return

        if mode == 'VERTEX':
            n = 2 if "Vert A" in self.inputs else 1
            while len(self.inputs) > n:
                self.inputs.remove(self.inputs[-1])
            if n == 1:
                self.inputs.new('VerticesSocket', "Vert A", "Vert A")

        if mode == 'AXIS':
            n = 2 if "Vert A" in self.inputs else 1
            if n == 2:
                while len(self.inputs) > n:
                    self.inputs.remove(self.inputs[-1])
                self.inputs.new('VerticesSocket', "Vert B", "Vert B")
            else:
                while len(self.inputs) > n:
                    self.inputs.remove(self.inputs[-1])                
                self.inputs.new('VerticesSocket', "Vert A", "Vert A")
                self.inputs.new('VerticesSocket', "Vert B", "Vert B")

        if mode == 'PLANE':
            while len(self.inputs) > 1:
                self.inputs.remove(self.inputs[-1])
            self.inputs.new('MatrixSocket', "Plane", "Plane")

        self.current_mode = mode
        updateNode(self, context)
Ejemplo n.º 5
0
    def mode_change(self, context):

        if not (self.items_ == self.current_op):
            self.label = self.items_
            self.update_outputs_and_inputs()
            self.current_op = self.items_
            updateNode(self, context)
Ejemplo n.º 6
0
 def update_value(self, context):
     if self.float_ < self.minim:
         self.float_ = self.minim
         return  # recursion protection
     if self.float_ > self.maxim:
         self.float_ = self.maxim
         return  # recursion protection
     updateNode(self, context)
Ejemplo n.º 7
0
 def update_value(self, context):
     if self.int_ < self.minim:
         self.int_ = self.minim
         return
     if self.int_ > self.maxim:
         self.int_ = self.maxim
         return
     updateNode(self, context)
Ejemplo n.º 8
0
 def update_value(self, context):
     if self.float_ < self.minim:
         self.float_ = self.minim
         return  # recursion protection
     if self.float_ > self.maxim:
         self.float_ = self.maxim
         return  # recursion protection
     updateNode(self, context)
Ejemplo n.º 9
0
 def update_value(self, context):
     if self.int_ < self.minim:
         self.int_ = self.minim
         return
     if self.int_ > self.maxim:
         self.int_ = self.maxim
         return
     updateNode(self, context)
Ejemplo n.º 10
0
 def reload(self):
     if self.textmode == 'CSV':
         self.reload_csv()
     elif self.textmode == 'SV':
         self.reload_sv()
     elif self.textmode == 'JSON':
         self.reload_json()
     # if we turn on reload on update we need a safety check for this
     # too work.
     updateNode(self, None)
Ejemplo n.º 11
0
 def reload(self):
     if self.textmode == 'CSV':
         self.reload_csv()
     elif self.textmode == 'SV':
         self.reload_sv()
     elif self.textmode == 'JSON':
         self.reload_json()
     # if we turn on reload on update we need a safety check for this
     # too work.
     updateNode(self, None)
Ejemplo n.º 12
0
    def mode_change(self, context):

        # just because click doesn't mean we need to change mode
        mode = self.mode
        if mode == self.current_mode:
            return

        self.inputs[-1].prop_name = {'LAZYRANGE': 'stop_'}.get(mode, 'count_')

        self.current_mode = mode
        updateNode(self, context)
Ejemplo n.º 13
0
    def mode_change(self, context):

        # just because click doesn't mean we need to change mode
        mode = self.mode
        if mode == self.current_mode:
            return

        if mode == 'FRANGE':
            self.inputs[1].prop_name = 'stop_'
            self.inputs[2].prop_name = 'step_'
        elif mode == 'FRANGE_COUNT':
            self.inputs[1].prop_name = 'stop_'
            self.inputs[2].prop_name = 'count_'
        else:
            self.inputs[1].prop_name = 'step_'
            self.inputs[2].prop_name = 'count_'

        self.current_mode = mode
        updateNode(self, context)
Ejemplo n.º 14
0
    def mode_change(self, context):
        if self.mode == 'XYZ':
            while len(self.inputs) > 2:
                self.inputs.remove(self.inputs[-1])
        if self.mode == 'DIST':
            while len(self.inputs) > 2:
                self.inputs.remove(self.inputs[-1])
            self.inputs.new('VerticesSocket', 'Base Point', 'Base Point')

        if self.mode == 'AXIS':
            while len(self.inputs) > 2:
                self.inputs.remove(self.inputs[-1])
            self.inputs.new('MatrixSocket', 'Mat')

        if self.mode == 'USER':
            while len(self.inputs) > 2:
                self.inputs.remove(self.inputs[-1])
            self.inputs.new('StringsSocket', 'Index Data', 'Index Data')

        updateNode(self, [])
Ejemplo n.º 15
0
    def mode_change(self, context):
        if self.mode == 'XYZ':
            while len(self.inputs) > 2:
                self.inputs.remove(self.inputs[-1])
        if self.mode == 'DIST':
            while len(self.inputs) > 2:
                self.inputs.remove(self.inputs[-1])
            self.inputs.new('VerticesSocket', 'Base Point', 'Base Point')

        if self.mode == 'AXIS':
            while len(self.inputs) > 2:
                self.inputs.remove(self.inputs[-1])
            self.inputs.new('MatrixSocket', 'Mat')

        if self.mode == 'USER':
            while len(self.inputs) > 2:
                self.inputs.remove(self.inputs[-1])
            self.inputs.new('StringsSocket', 'Index Data', 'Index Data')

        updateNode(self, [])
Ejemplo n.º 16
0
    def mode_change(self, context):
        # just because click doesn't mean we need to change mode
        mode = self.mode
        if mode == self.current_mode:
            return

        while len(self.inputs) > 1:
            self.inputs.remove(self.inputs[-1])

        if mode == 'AXIS':
            self.inputs.new('VerticesSocket', "Center", "Center")
            self.inputs.new('VerticesSocket', "Axis", "Axis")
            self.inputs.new('StringsSocket', "Angle", "Angle").prop_name = "angle_"
        elif mode == 'EULER' or mode == 'QUAT':
            self.inputs.new('StringsSocket', "X", "X").prop_name = "x_"
            self.inputs.new('StringsSocket', "Y", "Y").prop_name = "y_"
            self.inputs.new('StringsSocket', "Z", "Z").prop_name = "z_"
            if mode == 'QUAT':
                self.inputs.new('StringsSocket', "W", "W").prop_name = "w_"

        self.current_mode = mode
        updateNode(self, context)
Ejemplo n.º 17
0
    def mode_change(self, context):
        # just because click doesn't mean we need to change mode
        mode = self.mode
        if mode == self.current_mode:
            return

        while len(self.inputs) > 1:
            self.inputs.remove(self.inputs[-1])

        if mode == 'AXIS':
            self.inputs.new('VerticesSocket', "Center", "Center")
            self.inputs.new('VerticesSocket', "Axis", "Axis")
            self.inputs.new('StringsSocket', "Angle",
                            "Angle").prop_name = "angle_"
        elif mode == 'EULER' or mode == 'QUAT':
            self.inputs.new('StringsSocket', "X", "X").prop_name = "x_"
            self.inputs.new('StringsSocket', "Y", "Y").prop_name = "y_"
            self.inputs.new('StringsSocket', "Z", "Z").prop_name = "z_"
            if mode == 'QUAT':
                self.inputs.new('StringsSocket', "W", "W").prop_name = "w_"

        self.current_mode = mode
        updateNode(self, context)
Ejemplo n.º 18
0
 def mode_change(self, context):
     if not (self.selected_axis == self.current_axis):
         self.label = self.selected_axis
         self.current_axis = self.selected_axis
         updateNode(self, context)
Ejemplo n.º 19
0
 def change_mode(self, context):
     if self.unwrap:
         self.level_unwrap = max(1, self.level)
     else:
         self.level = self.level_unwrap
     updateNode(self, context)
Ejemplo n.º 20
0
 def update_socket(self, context):
     updateNode(self, context)
Ejemplo n.º 21
0
 def change_prop(self, context):
     for i, name in enumerate(self.order):
         self.inputs[i].prop_name = name
     updateNode(self, context)
Ejemplo n.º 22
0
 def change_mode(self, context):
     if self.unwrap:
         self.level_unwrap = max(1, self.level)
     else:
         self.level = self.level_unwrap
     updateNode(self, context)
Ejemplo n.º 23
0
 def mode_change(self, context):
     if not (self.selected_axis == self.current_axis):
         self.label = self.selected_axis
         self.current_axis = self.selected_axis
         updateNode(self, context)
Ejemplo n.º 24
0
 def update_text(self, context):
     self.format_text()
     updateNode(self, context)
Ejemplo n.º 25
0
 def update_socket(self, context):
     updateNode(self, context)
Ejemplo n.º 26
0
 def update_text(self, context):
     self.format_text()
     # recursion protection, should be solved with better structure
     if not self.inputs[0].links:
         updateNode(self, context)