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

up to date ssvfx writenode #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 27 additions & 9 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ def get_node_render_template(self, node):
"""
Return the render template for the specified node
"""
return self.__write_node_handler.get_render_template(node)
write_type = self.__write_node_handler.get_node_write_type_name(node)

return self.__write_node_handler.get_render_template(node, write_type)

def get_node_publish_template(self, node):
"""
Expand Down Expand Up @@ -221,27 +223,43 @@ def create_new_write_node(self, profile_name):
self.__write_node_handler.create_new_node(profile_name)

# Private methods
#
def __add_write_node_commands(self, context=None):
"""
Creates write node menu entries for all write node configurations
"""
context = context or self.context

write_type = "Version"
profile_list = []
write_node_icon = os.path.join(self.disk_location, "resources", "tk2_write.png")
profile_set = set(self.__write_node_handler.profile_names)
# Remove fileset types nt associated with Project
if not self.__write_node_handler.proj_info['sg_delivery_fileset']:
nuke.tprint("No fileset specified. Loading defaults...")
profile_list = self.__write_node_handler.profile_names
else:
if any(self.__write_node_handler.proj_info['sg_delivery_fileset']['name'] in s.lower() for s in self.__write_node_handler.profile_names):
if context.step['name'] != 'Roto':
match_set = {"Jpeg", self.__write_node_handler.proj_info['sg_delivery_fileset']['name'].title()}
else:
nuke.tprint("Context is " + context.step['name'] + ".")
match_set = {"Jpeg", "Exr"}

for profile_name in self.__write_node_handler.profile_names:
profile_list = list(match_set.intersection(profile_set))
else:
nuke.tprint("Profile name not in list!")
profile_list = self.__write_node_handler.profile_names

nuke.tprint("- Project fileset(s): " + str(profile_list))

for profile_name in profile_list:
# add to toolbar menu
cb_fn = lambda pn=profile_name: self.__write_node_handler.create_new_node(pn)
cb_fn = lambda pn=profile_name,wt=write_type: self.__write_node_handler.create_new_node(pn,wt)
self.engine.register_command(
"%s [Shotgun]" % profile_name,
"%s" % profile_name,
cb_fn,
dict(
type="node",
icon=write_node_icon,
context=context,
)
)



41 changes: 41 additions & 0 deletions gizmos/ProjectSettings.gizmo
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Gizmo {
note_font Verdana
mapsize {0.15 0.15}
}
Input {
inputs 0
name Input1
xpos 195
ypos -74
}
Reformat {
type "to format"
box_width 800
box_height 1
black_outside false
pbb true
name project_reformat
disable true
}
Crop {
name project_crop
preset format
reformat true
crop false
disable true
}
AddTimeCode {
name project_tc
startcode 01:00:00:01
metafps False
fps 23.98
useFrame True
frame 1
}
set N11879e50 [stack 0]
Output {
name Output1
xpos 195
ypos 150
}
end_group
Loading