diff --git a/core/monad.py b/core/monad.py index f7c7194ae30e16ae393d0cc3482bf3439368d952..30c353b9bd65c6fa07bf15b44e19d17f51e5cfd3 100644 --- a/core/monad.py +++ b/core/monad.py @@ -571,6 +571,8 @@ class SvGroupNodeExp: monad = self.monad in_node = monad.input_node out_node = monad.output_node + monad['current_index'] = 0 + monad['current_total'] = 0 for index, socket in enumerate(self.inputs): data = socket.sv_get(deepcopy=False) diff --git a/core/update_system.py b/core/update_system.py index afe0735aeda65c233acdeece7a7d1a61e38088b6..da47145c2a7d5042c76a5a09da98a04d0e4dfb2f 100644 --- a/core/update_system.py +++ b/core/update_system.py @@ -364,9 +364,11 @@ def do_update_general(node_list, nodes, procesed_nodes=set()): #traceback.print_tb(err.__traceback__) exception("Node %s had exception: %s", node_name, err) - if ng.sv_show_error_in_tree: - error_text = traceback.format_exc() - start_exception_drawing_with_bgl(ng, node_name, error_text, err) + if hasattr(ng, "sv_show_error_in_tree"): + # not yet supported in monad trees.. + if ng.sv_show_error_in_tree: + error_text = traceback.format_exc() + start_exception_drawing_with_bgl(ng, node_name, error_text, err) return None diff --git a/nodes/scene/monad.py b/nodes/scene/monad.py index dfcd0c2abc988ad65474428dac2e694cc6b84619..d25a5dd629f0c7981f0ba1a44ef880401fdd84f6 100644 --- a/nodes/scene/monad.py +++ b/nodes/scene/monad.py @@ -232,14 +232,18 @@ class SvMonadInfoNode(bpy.types.Node, SverchCustomTreeNode): def process(self): # outputs monad = self.id_data + display_message = False try: idx = monad["current_index"] total = monad["current_total"] except Exception as err: - print(repr(err)) + print("This error is being displayed by Monad Info: ", repr(err)) + print("could not find monad[\"current_index\"] nor monad [\"current_total\"], setting to 0, 0 instead") idx, total = 0 , 0 - print("couldn't find monad info") + display_message = True + if display_message: + print('recovering from error, processing anyway') for socket, data in zip(self.outputs, [idx, total]): if socket.is_linked: socket.sv_set([[data]]) diff --git a/utils/sv_IO_panel_tools.py b/utils/sv_IO_panel_tools.py index 8669e39954a5f50a52abed788b1546eb8d42ac81..95607040a26ca3a3e3a23a311735e224511c05fa 100644 --- a/utils/sv_IO_panel_tools.py +++ b/utils/sv_IO_panel_tools.py @@ -402,19 +402,21 @@ def perform_scripted_node_inject(node, node_ref): script_name = params.get('script_name') script_content = params.get('script_str') - if script_name and not (script_name in texts): - new_text = texts.new(script_name) - new_text.from_string(script_content) - elif script_name and (script_name in texts): - # This was added to fix existing texts with the same name but no / different content. - if texts[script_name].as_string() == script_content: - debug("SN skipping text named `%s' - their content are the same", script_name) - else: - info("SN text named `%s' already found in current, but content differs", script_name) + with node.sv_throttle_tree_update(): + + if script_name and not (script_name in texts): new_text = texts.new(script_name) new_text.from_string(script_content) - script_name = new_text.name - info('SN text named replaced with %s', script_name) + elif script_name and (script_name in texts): + # This was added to fix existing texts with the same name but no / different content. + if texts[script_name].as_string() == script_content: + debug("SN skipping text named `%s' - their content are the same", script_name) + else: + info("SN text named `%s' already found in current, but content differs", script_name) + new_text = texts.new(script_name) + new_text.from_string(script_content) + script_name = new_text.name + info('SN text named replaced with %s', script_name) node.script_name = script_name node.script_str = script_content