Ejemplo n.º 1
0
    def generate_callback(self, n_id, IV):
        inputs = self.inputs

        verts, matrices = [], []
        text = ''

        # gather vertices from input
        propv = inputs['vertices'].sv_get()
        verts = dataCorrect(propv)

        # end early, no point doing anything else.
        if not verts:
            return

        # draw text on locations instead of indices.
        text_so = inputs['text'].sv_get(default=[])
        text = dataCorrect(text_so)
        if text:
            fullList(text, len(verts))
            for i, t in enumerate(text):
                fullList(text[i], len(verts[i]))

        # read non vertex inputs in a loop and assign to data_collected
        data_collected = []
        for socket in ['edges', 'faces', 'matrix']:
            propm = inputs[socket].sv_get(default=[])
            input_stream = propm  # dataCorrect(propm) returns [1, list-of-matrices] for matrix socket.
            data_collected.append(input_stream)

        edges, faces, matrices = data_collected

        bg = self.draw_bg
        settings = self.get_settings()
        IV.callback_enable(
            n_id, verts, edges, faces, matrices, bg, settings, text)
Ejemplo n.º 2
0
    def generate_callback(self, n_id, IV):
        inputs = self.inputs

        verts, matrices = [], []
        text = ''

        # gather vertices from input
        propv = inputs['vertices'].sv_get()
        verts = dataCorrect(propv)

        # end early, no point doing anything else.
        if not verts:
            return

        # draw text on locations instead of indices.
        text_so = inputs['text'].sv_get(default=[])
        text = dataCorrect(text_so)
        if text:
            fullList(text, len(verts))
            for i, t in enumerate(text):
                fullList(text[i], len(verts[i]))

        # read non vertex inputs in a loop and assign to data_collected
        data_collected = []
        for socket in ['edges', 'faces', 'matrix']:
            propm = inputs[socket].sv_get(default=[])
            input_stream = dataCorrect(propm)
            data_collected.append(input_stream)

        edges, faces, matrices = data_collected

        bg = self.draw_bg
        settings = self.get_settings()
        IV.callback_enable(
            n_id, verts, edges, faces, matrices, bg, settings, text)