-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert specified nodes #36
base: master
Are you sure you want to change the base?
Convert specified nodes #36
Conversation
…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"]: |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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"]: |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)
@@ -307,8 +307,8 @@ def __add_write_node_commands(self, context=None): | |||
if not promoted_knob_write_nodes: | |||
# no presets use promoted knobs so we are OK to register the menus. | |||
|
|||
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) |
There was a problem hiding this comment.
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)
@@ -284,10 +284,10 @@ def __add_write_node_commands(self, context=None): | |||
|
|||
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) |
There was a problem hiding this comment.
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)
This PR Implements an option to pass a list of nodes to app methods
convert_to_write_nodes()
andconvert_from_write_nodes()
to allow for conversion of only specified nodes rather than all nodes. Methods havenodes
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.