From 9206f3ef40ef39cfc628f6d253a97ef67c997fc5 Mon Sep 17 00:00:00 2001 From: Joseph Yu Date: Wed, 11 Aug 2021 12:30:28 +0100 Subject: [PATCH 1/2] Using str.format instead of concatenation --- python/tk_nuke_writenode/handler.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/python/tk_nuke_writenode/handler.py b/python/tk_nuke_writenode/handler.py index 1d1f21c..fdae7c2 100644 --- a/python/tk_nuke_writenode/handler.py +++ b/python/tk_nuke_writenode/handler.py @@ -1534,21 +1534,15 @@ def __update_render_path(self, node, force_reset=False, is_proxy=False): # render path could not be computed for some reason - display warning # to the user in the property editor: - path_warning += ( + path_warning += "{0}

   {1}
".format( "
".join( self.__wrap_text( "The render path is currently frozen because Toolkit could not " "determine a valid path! This was due to the following problem:", 60, ) - ) - + "
" - ) - path_warning += "
" - path_warning += ( - "   " - + "
   ".join(self.__wrap_text(str(e), 57)) - + "
" + ), + "
   ".join(self.__wrap_text(str(e), 57)), ) if cached_path: From b6e9e8668996ca73fa70132c854a2232b1b8915c Mon Sep 17 00:00:00 2001 From: Joseph Yu Date: Wed, 11 Aug 2021 12:31:46 +0100 Subject: [PATCH 2/2] Create write node in main node graph --- python/tk_nuke_writenode/handler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/tk_nuke_writenode/handler.py b/python/tk_nuke_writenode/handler.py index fdae7c2..3ed2d89 100644 --- a/python/tk_nuke_writenode/handler.py +++ b/python/tk_nuke_writenode/handler.py @@ -414,9 +414,10 @@ def convert_sg_to_nuke_write_nodes(self): node_name = sg_wn.name() node_pos = (sg_wn.xpos(), sg_wn.ypos()) - # create new regular Write node: - new_wn = nuke.createNode("Write") - new_wn.setSelected(False) + # create new regular Write node in main node graph (see self.get_nodes()): + with nuke.root(): + new_wn = nuke.createNode("Write") + new_wn.setSelected(False) # copy across file & proxy knobs (if we've defined a proxy template): new_wn["file"].setValue(sg_wn["cached_path"].evaluate())