Exemplo n.º 1
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)
Exemplo n.º 2
0
 def update(self):
     if 'Data' not in self.outputs:
         return
     if not self.outputs['Data'].links:
         return
     inputsocketname = 'Data True'
     outputsocketname = ['Data']
     changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 3
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)
Exemplo n.º 4
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)
Exemplo n.º 5
0
    def update(self):

        if not 'Out' in self.outputs:
            return
        if self.inputs and self.inputs[0].links:
            in_socket = 'In'
            out_socket = ['Out']
            changable_sockets(self, in_socket, out_socket)
Exemplo n.º 6
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)
Exemplo n.º 7
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)
Exemplo n.º 8
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)
Exemplo n.º 9
0
    def process(self):
        if 'Data' in self.inputs and len(self.inputs['Data'].links) > 0:
            # адаптивный сокет
            inputsocketname = 'Data'
            outputsocketname = ['Item', 'Other']
            changable_sockets(self, inputsocketname, outputsocketname)

        if 'Item' in self.outputs and self.outputs['Item'].links or \
                'Other' in self.outputs and self.outputs['Other'].links:

            if 'Data' in self.inputs and self.inputs['Data'].links:
                data = SvGetSocketAnyType(self, self.inputs['Data'])

                if 'Item' in self.outputs and self.outputs['Item'].links:
                    out = self.count(data, self.level-1, self.item, True)
                    SvSetSocketAnyType(self, 'Item', out)
                if 'Other' in self.outputs and self.outputs['Other'].links:
                    out = self.count(data, self.level-1, self.item, False)
                    SvSetSocketAnyType(self, 'Other', out)
Exemplo n.º 10
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)
Exemplo n.º 11
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)
Exemplo n.º 12
0
 def update(self):
     if 'data' in self.inputs and self.inputs['data'].is_linked:
         inputsocketname = 'data'
         outputsocketname = ['data']
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 13
0
 def update(self):
     inputsocketname = 'Data True'
     outputsocketname = ['Data']
     changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 14
0
 def update(self):
     if self.inputs['Data'].links:
         # адаптивный сокет
         inputsocketname = 'Data'
         outputsocketname = ["Middl",'First', 'Last']
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 15
0
 def update(self):
     inputsocketname = 'Data True'
     outputsocketname = ['Data']
     changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 16
0
 def update(self):
     if 'Data' in self.inputs and len(self.inputs['Data'].links) > 0:
         inputsocketname = 'Data'
         outputsocketname = ['Item', 'Other']
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 17
0
 def update(self):
     if 'data' in self.inputs and self.inputs['data'].is_linked:
         inputsocketname = 'data'
         outputsocketname = ['data']
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 18
0
 def update(self):
     # адаптивный сокет
     inputsocketname = 'data'
     outputsocketname = ['data']
     changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 19
0
 def update(self):
     if "data" in self.inputs and self.inputs["data"].links > 0:
         # адаптивный сокет
         inputsocketname = "data"
         outputsocketname = ["data"]
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 20
0
 def update(self):
     if self.inputs['Data'].links:
         inputsocketname = 'Data'
         outputsocketname = ["Middl", 'First', 'Last']
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 21
0
 def update(self):
     changable_sockets(self, "Data", ["Data"])
Exemplo n.º 22
0
 def update(self):
     if 'data' in self.inputs and len(self.inputs['data'].links) > 0:
         inputsocketname = 'data'
         outputsocketname = ['data', ]
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 23
0
 def update(self):
     if 'data' in self.inputs and self.inputs['data'].links > 0:
         # адаптивный сокет
         inputsocketname = 'data'
         outputsocketname = ['data']
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 24
0
 def update(self):
     if 'data' in self.inputs and len(self.inputs['data'].links) > 0:
         inputsocketname = 'data'
         outputsocketname = ['data', ]
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 25
0
 def update(self):
     if 'Data' in self.inputs and len(self.inputs['Data'].links) > 0:
         inputsocketname = 'Data'
         outputsocketname = ['Item', 'Other']
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 26
0
 def update(self):
     inputsocketname = 'data'
     outputsocketname = ['dataTrue', 'dataFalse']
     changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 27
0
 def update(self):
     # адаптивный сокет
     inputsocketname = 'data'
     outputsocketname = ['data']
     changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 28
0
 def sv_update(self):
     """adapt socket type to input type"""
     if self.inputs['Data'].is_linked:
         inputsocketname = 'Data'
         outputsocketname = ['Item', 'Other']
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 29
0
 def update(self):
     if 'data' in self.inputs and self.inputs['data'].links:
         # адаптивный сокет
         inputsocketname = 'data'
         outputsocketname = ['data']
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 30
0
 def update(self):
     inputsocketname = 'data'
     outputsocketname = ['dataTrue', 'dataFalse']
     changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 31
0
 def sv_update(self):
     if 'Data' in self.inputs and self.inputs['Data'].links:
         inputsocketname = 'Data'
         outputsocketname = ['Data']
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 32
0
 def update(self):
     if 'Data' in self.inputs and self.inputs['Data'].links:
         inputsocketname = 'Data'
         outputsocketname = ['Slice', 'Other']
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 33
0
 def update(self):
     # достаём два слота - вершины и полики
     if 'Data' in self.inputs and self.inputs['Data'].links:
         inputsocketname = 'Data'
         outputsocketname = ['Data', ]
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 34
0
 def sv_update(self):
     '''adapt socket type to input type'''
     if 'Data' in self.inputs and self.inputs['Data'].links:
         inputsocketname = 'Data'
         outputsocketname = ['Item', 'Other']
         changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 35
0
 def sv_update(self):
     if 'data' in self.outputs and self.inputs['data'].links:
         inputsocketname = 'data'
         outputsocketname = ['data']
         changable_sockets(self, inputsocketname, outputsocketname)
         self.newsock = True
Exemplo n.º 36
0
 def sv_update(self):
     inputsocketname = 'Data'
     outputsocketname = ['Split']
     changable_sockets(self, inputsocketname, outputsocketname)
Exemplo n.º 37
0
 def update(self):
     changable_sockets(self, "Data", ["Data"])