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)
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)
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)