예제 #1
0
파일: node_tree.py 프로젝트: vktcl/sverchok
    def sv_throttle_tree_update(self):
        """
        It will temporary switch off updating node tree upon adding/removing node/links in a node tree

        class MyNode:
            def property_update(self, context):
                with self.throttle_tree_update():
                    self.inputs.remove('MySocket')
        """
        return data_structure.throttle_tree_update(self)
예제 #2
0
def do_text(node, out_string):

    if not 'Sverchok_viewer' in bpy.data.texts:
        bpy.data.texts.new('Sverchok_viewer')

    string_to_write = 'node name: ' + node.name + out_string + footer
    datablock = bpy.data.texts['Sverchok_viewer']
    datablock.clear()
    datablock.from_string(string_to_write)
    
    if node.frame:
        # adding a frame if it doesn't exist, will create a depsgraph update
        with throttle_tree_update(node):
            makeframe(node.id_data)
예제 #3
0
 def update_mode(self, context):
     with throttle_tree_update(self):
         self.inputs['Start index'].hide_safe = not self.use_range
         self.inputs['End index'].hide_safe = not self.use_range
     updateNode(self, context)