Exemple #1
0
    def process(self):
        if self.text_mode in {'CSV', 'JSON'}:
            multi_socket(self, min=1)

        if self.autodump:
            self.append = False
            self.dump()
Exemple #2
0
 def update(self):
     if self.text_mode == 'CSV' or self.text_mode == 'JSON':
         multi_socket(self, min=1)
     elif self.text_mode == 'SV':
         pass  # only one input, do nothing
     if self.dump_on_update:
         self.dump()
Exemple #3
0
    def update(self):
        multi_socket(self, min=2)

        if 'x0' in self.inputs and len(self.inputs['x0'].links) > 0:
            inputsocketname = self.inputs[0].name
            outputsocketname = [
                'data',
            ]
            changable_sockets(self, inputsocketname, outputsocketname)

        if 'data' in self.outputs and len(self.outputs['data'].links) > 0:
            if 'x0' in self.inputs and len(self.inputs['x0'].links) > 0:
                X = SvGetSocketAnyType(self, self.inputs['data'])
                slots = []
                for socket in self.inputs:
                    if socket.links:
                        slots.append(SvGetSocketAnyType(self, socket))
                if len(slots) < 2:
                    return

                X_ = dataCorrect(X)
                result = []
                for socket in slots:
                    result.extend(self.f(X_, dataCorrect(socket)))

                SvSetSocketAnyType(self, 'data', result)
Exemple #4
0
 def update(self):
     if self.text_mode == "CSV" or self.text_mode == "JSON":
         multi_socket(self, min=1)
     elif self.text_mode == "SV":
         pass  # only one input, do nothing
     if self.dump_on_update:
         self.dump()
Exemple #5
0
 def update(self):
     # ugly hack to get var name sometimes with old layouts
     if not self.var_name:
         self.gen_var_name()
             
     self.base_name = self.var_name
     multi_socket(self, min=1, breck=True)
Exemple #6
0
 def update(self):
     if self.text_mode == 'CSV' or self.text_mode == 'JSON':
         multi_socket(self, min=1)
     elif self.text_mode == 'SV':
         pass  # only one input, do nothing
     if self.dump_on_update:
         self.dump()
Exemple #7
0
    def process(self):
        if self.text_mode in {'CSV', 'JSON'}:
            multi_socket(self, min=1)

        if self.autodump:
            self.append = False
            self.dump()
Exemple #8
0
    def update(self):
        # inputs
        multi_socket(self, min=2, start=-1, breck=True)

        if self.inputs['X'].links:
            inputsocketname = 'X'
            outputsocketname = ['Result']
            changable_sockets(self, inputsocketname, outputsocketname)
Exemple #9
0
    def update(self):
        # inputs
        multi_socket(self, min=1)

        if 'data' in self.inputs and len(self.inputs['data'].links) > 0:
            inputsocketname = 'data'
            outputsocketname = ['data']
            changable_sockets(self, inputsocketname, outputsocketname)
Exemple #10
0
    def update(self):
        # inputs
        multi_socket(self, min=1)

        if 'data' in self.inputs and len(self.inputs['data'].links) > 0:
            inputsocketname = 'data'
            outputsocketname = ['data']
            changable_sockets(self, inputsocketname, outputsocketname)
Exemple #11
0
    def update(self):
        # inputs
        multi_socket(self, min=2, start=-1, breck=True)

        if self.inputs['X'].links:
            inputsocketname = 'X'
            outputsocketname = ['Result']
            changable_sockets(self, inputsocketname, outputsocketname)
Exemple #12
0
    def sv_update(self):

        if len(self.outputs) > 0:
            multi_socket(self, min=1)
        self.set_output_socketype([
            sock.other.bl_idname for sock in self.inputs
            if sock.links and sock.other
        ])
 def update(self):
     other = get_other_socket(self.inputs[0])
     if not other:
         return
     self.multi_socket_type = other.bl_idname
     multi_socket(self, min=1, start=0, breck=True, out_count=self.count)
     outputsocketname = [name.name for name in self.outputs]
     changable_sockets(self, 'data', outputsocketname)
Exemple #14
0
 def update(self):
     other = get_other_socket(self.inputs[0])
     if not other:
         return
     self.multi_socket_type = other.bl_idname
     multi_socket(self, min=1, start=0, breck=True, out_count=self.count)
     outputsocketname = [name.name for name in self.outputs]
     changable_sockets(self, 'data', outputsocketname)
Exemple #15
0
 def process(self):
     if self.text_mode == 'CSV' or self.text_mode == 'JSON':
         multi_socket(self, min=1)
     elif self.text_mode == 'SV':
         pass  # only one input, do nothing
     if self.autodump:
         self.append = False
         self.dump()
Exemple #16
0
    def update(self):
        # inputs
        multi_socket(self, min=2)

        if "data" in self.inputs and self.inputs["data"].links:
            # adaptive socket
            inputsocketname = "data"
            outputsocketname = ["data"]
            changable_sockets(self, inputsocketname, outputsocketname)
Exemple #17
0
    def update(self):
        # inputs
        multi_socket(self, min=1)

        if 'data' in self.inputs and self.inputs['data'].links:
            # Adaptive socket
            inputsocketname = 'data'
            outputsocketname = ['data']
            changable_sockets(self, inputsocketname, outputsocketname)
    def update(self):
        # inputs
        multi_socket(self, min=2)

        if 'data' in self.inputs and self.inputs['data'].links:
            # adaptive socket
            inputsocketname = 'data'
            outputsocketname = ['data']
            changable_sockets(self, inputsocketname, outputsocketname)
Exemple #19
0
    def update(self):
        # inputs
        multi_socket(self, min=1)

        if 'data' in self.inputs and self.inputs['data'].links:
            # адаптивный сокет
            inputsocketname = 'data'
            outputsocketname = ['data']
            changable_sockets(self, inputsocketname, outputsocketname)
Exemple #20
0
    def sv_update(self):
        # this function auto extends the number of input sockets once a socket is linked.
        multi_socket(self, min=1)

        # we want socket types to match the input
        for socket in self.inputs:
            if socket.is_linked and socket.links:
                if socket.other: 
                    if not socket.bl_idname == socket.other.bl_idname:
                        socket.replace_socket(socket.other.bl_idname)
Exemple #21
0
    def process(self):

        # upgrades older versions of ProfileMK3 to the version that has self.file_pointer
        if self.text and not self.file_pointer:
            text = self.get_bpy_data_from_name(self.text, bpy.data.texts)
            if text:
                self.file_pointer = text

        if self.text_mode in {'CSV', 'JSON'}:
            multi_socket(self, min=1)

        if self.autodump:
            self.append = False
            self.dump()
Exemple #22
0
    def update(self):
        # multisocket - from util(formula node)
        multi_socket(self, min=2)

        if 'x0' in self.inputs and len(self.inputs['x0'].links) > 0:
            # adaptive socket - from util(mask list node)
            inputsocketname = self.inputs[
                0].name  # is you need x0 to define socket type - set 0 to 1
            outputsocketname = [
                'data',
            ]
            changable_sockets(self, inputsocketname, outputsocketname)

        if 'data' in self.outputs and len(self.outputs['data'].links) > 0:
            if 'x0' in self.inputs and len(self.inputs['x0'].links) > 0:
                # get any type socket from input:
                X = SvGetSocketAnyType(self, self.inputs['data'])
                slots = []
                for socket in self.inputs:
                    if socket.links:
                        slots.append(SvGetSocketAnyType(self, socket))

                # determine if you have enough inputs for make output
                # if not return
                # examples: all but last (last is never connected)
                # len(slots) == len(self.inputs)-1
                # if more than 2 etc.

                if len(slots) < 2:
                    return

                # Process data
                X_ = dataCorrect(X)
                result = []
                for socket in slots:
                    result.extend(self.f(X_, dataCorrect(socket)))

                # how to assign correct property to adaptive output:
                # in nearest future with socket's data' dictionary we will send
                # only node_name+layout_name+socket_name in str() format
                # and will make separate definition to easyly assign and
                # get and recognise data from dictionary
                SvSetSocketAnyType(self, 'data', result)
Exemple #23
0
    def update(self):
        # multisocket - from util(formula node)
        multi_socket(self, min=2)

        if 'x0' in self.inputs and len(self.inputs['x0'].links) > 0:
            # adaptive socket - from util(mask list node)
            inputsocketname = self.inputs[0].name  # is you need x0 to define socket type - set 0 to 1
            outputsocketname = ['data', ]
            changable_sockets(self, inputsocketname, outputsocketname)

        if 'data' in self.outputs and len(self.outputs['data'].links) > 0:
            if 'x0' in self.inputs and len(self.inputs['x0'].links) > 0:
                # get any type socket from input:
                X = SvGetSocketAnyType(self, self.inputs['data'])
                slots = []
                for socket in self.inputs:
                    if socket.links:
                        slots.append(SvGetSocketAnyType(self, socket))

                # determine if you have enough inputs for make output
                # if not return
                # examples: all but last (last is never connected)
                # len(slots) == len(self.inputs)-1
                # if more than 2 etc.

                if len(slots) < 2:
                    return

                # Process data
                X_ = dataCorrect(X)
                result = []
                for socket in slots:
                    result.extend(self.f(X_, dataCorrect(socket)))

                # how to assign correct property to adaptive output:
                # in nearest future with socket's data' dictionary we will send
                # only node_name+layout_name+socket_name in str() format
                # and will make separate definition to easyly assign and
                # get and recognise data from dictionary
                SvSetSocketAnyType(self, 'data', result)
Exemple #24
0
    def update(self):
        multi_socket(self, min=2)

        if 'x0' in self.inputs and len(self.inputs['x0'].links) > 0:
            inputsocketname = self.inputs[0].name
            outputsocketname = ['data', ]
            changable_sockets(self, inputsocketname, outputsocketname)

        if 'data' in self.outputs and len(self.outputs['data'].links) > 0:
            if 'x0' in self.inputs and len(self.inputs['x0'].links) > 0:
                X = SvGetSocketAnyType(self, self.inputs['data'])
                slots = []
                for socket in self.inputs:
                    if socket.links:
                        slots.append(SvGetSocketAnyType(self, socket))
                if len(slots) < 2:
                    return

                X_ = dataCorrect(X)
                result = []
                for socket in slots:
                    result.extend(self.f(X_, dataCorrect(socket)))

                SvSetSocketAnyType(self, 'data', result)
Exemple #25
0
 def update(self):
     multi_socket(self, min=1)
 def set_count(self, context):
     other = get_other_socket(self.inputs[0])
     if not other:
         return
     self.multi_socket_type = other.bl_idname
     multi_socket(self, min=1, start=0, breck=True, out_count=self.count)
 def sv_update(self):
     if len(self.outputs) > 0:
         multi_socket(self, min=1)
Exemple #28
0
 def update(self):
     # inputs
     multi_socket(self, min=1)
Exemple #29
0
 def set_count(self, context):
     other = get_other_socket(self.inputs[0])
     if not other:
         return
     self.multi_socket_type = other.bl_idname
     multi_socket(self, min=1, start=0, breck=True, out_count=self.count)
Exemple #30
0
 def update(self):
     # inputs
     multi_socket(self, min=1)