Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alx00x
Copy link

@alx00x alx00x commented Jun 10, 2019

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.

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

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

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)

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)

@alx00x alx00x 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