Beispiel #1
0
    def execute(self, context):
        """
        - get associated monad from data.node_groups. (node.monad)
        - make a copy of that node_group. (obtain resulting name)
        - duplicate the node
        - replace the new node.monad with the copy

        """
        space = context.space_data
        tree = space.edit_tree

        try:
            node = monad_make_unique(context.active_node)
    
            # select only the new node
            for n in tree.nodes:
                n.select = False
    
            node.select = True
            tree.nodes.active = node
            node.location = space.cursor_location                


        except Exception as err:
            sys.stderr.write('ERROR: %s\n' % str(err))
            print(sys.exc_info()[-1].tb_frame.f_code)
            print('Error on line {}'.format(sys.exc_info()[-1].tb_lineno))
            return {'CANCELLED'}
        
        return {'FINISHED'}
Beispiel #2
0
    def execute(self, context):
        """
        - get associated monad from data.node_groups. (node.monad)
        - make a copy of that node_group. (obtain resulting name)
        - duplicate the node
        - replace the new node.monad with the copy

        """
        space = context.space_data
        tree = space.edit_tree

        try:
            node = monad_make_unique(context.active_node)

            # select only the new node
            for n in tree.nodes:
                n.select = False

            node.select = True
            tree.nodes.active = node
            node.location = space.cursor_location

        except Exception as err:
            sys.stderr.write('ERROR: %s\n' % str(err))
            print(sys.exc_info()[-1].tb_frame.f_code)
            print('Error on line {}'.format(sys.exc_info()[-1].tb_lineno))
            return {'CANCELLED'}

        return {'FINISHED'}
Beispiel #3
0
    def execute(self, context):
        """
        - get associated monad from data.node_groups. (node.monad)
        - make a copy of that node_group. (obtain resulting name)
        - duplicate the node
        - replace the new node.monad with the copy

        """
        
        try:
            monad_make_unique(context.active_node)
        except Exception as err:
            sys.stderr.write('ERROR: %s\n' % str(err))
            print(sys.exc_info()[-1].tb_frame.f_code)
            print('Error on line {}'.format(sys.exc_info()[-1].tb_lineno))
        
        return {'FINISHED'}