Skip to content

Conversation

@alxkocic
Copy link

This PR Implements an option to pass a list of nodes to app methods convert_to_write_nodes() and convert_from_write_nodes() to allow for conversion of only specified nodes rather than all nodes. Methods have nodes keyword argument which requires a list. If this argument is not supplied, methods work as usual - converting all nodes in the script. This keeps backward compatibility.

For the handler, I've decoupled conversion logic from the methods for easier maintenance.

alxkocic added 2 commits June 10, 2019 10:31
…vert_from_write_nodes methods to allow for specific nodes to be converted rather than all
# skip knobs we don't want to copy:
if knob_name in ["file_type", "file", "proxy", "beforeRender", "afterRender",
"name", "xpos", "ypos", "disable", "tile_color", "postage_stamp",
"label"]:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent

for knob_name, knob in wn.knobs().iteritems():
# skip knobs we don't want to copy:
if knob_name in ["file_type", "file", "proxy", "beforeRender", "afterRender",
"name", "xpos", "ypos", "disable", "tile_color", "postage_stamp",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent

or not render_template_knob
or not publish_template_knob
or not proxy_render_template_knob
or not proxy_publish_template_knob):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line break before binary operator
visually indented line with same indent as next logical line

or not use_name_as_output_knob
or not render_template_knob
or not publish_template_knob
or not proxy_render_template_knob

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line break before binary operator

or not output_knob
or not use_name_as_output_knob
or not render_template_knob
or not publish_template_knob

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line break before binary operator

write_nodes = nuke.allNodes(group=nuke.root(), filter="Write", recurseGroups = True)

if nodes:
# filter list to only write nodes:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation is not a multiple of four (comment)

for knob_name, knob in int_wn.knobs().iteritems():
# skip knobs we don't want to copy:
if knob_name in ["file_type", "file", "proxy", "beforeRender", "afterRender",
"name", "xpos", "ypos"]:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent

convert_to_write_nodes_action = lambda :self.convert_to_write_nodes(show_warning=True)
convert_from_write_nodes_action = lambda: self.convert_from_write_nodes(show_warning=True)
def convert_to_write_nodes_action(): return self.convert_to_write_nodes(show_warning=True)
def convert_from_write_nodes_action(): return self.convert_from_write_nodes(show_warning=True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected 1 blank line before a nested definition, found 0
multiple statements on one line (def)


convert_to_write_nodes_action = lambda :self.convert_to_write_nodes(show_warning=True)
convert_from_write_nodes_action = lambda: self.convert_from_write_nodes(show_warning=True)
def convert_to_write_nodes_action(): return self.convert_to_write_nodes(show_warning=True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multiple statements on one line (def)

for profile_name in self.__write_node_handler.profile_names:
# add to toolbar menu
cb_fn = lambda pn=profile_name: self.__write_node_handler.create_new_node(pn)
def cb_fn(pn=profile_name): return self.__write_node_handler.create_new_node(pn)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multiple statements on one line (def)

@alxkocic alxkocic changed the title Implement convert single node Convert specified nodes Jun 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants