Merge remote-tracking branch 'origin/feature/PYPE-25-nuke-backdrop-publish' into feature/PYPE-589-publishing-gizmos-and-importing

This commit is contained in:
Jakub Jezek 2019-11-25 17:49:22 +01:00
commit c6c52d43f0
10 changed files with 380 additions and 45 deletions

View file

@ -1,16 +1,50 @@
from avalon.nuke.pipeline import Creator
from avalon.nuke import lib as anlib
import nuke
class CreateBackdrop(Creator):
"""Add Publishable Backdrop"""
name = "backdrop"
label = "Backdrop"
family = "group"
icon = "cube"
name = "nukenodes"
label = "Create Backdrop"
family = "nukenodes"
icon = "file-archive-o"
defaults = ["Main"]
def __init__(self, *args, **kwargs):
super(CreateBackdrop, self).__init__(*args, **kwargs)
self.nodes = nuke.selectedNodes()
self.node_color = "0xdfea5dff"
return
def process(self):
from nukescripts import autoBackdrop
nodes = list()
if (self.options or {}).get("useSelection"):
nodes = self.nodes
if len(nodes) >= 1:
anlib.select_nodes(nodes)
bckd_node = autoBackdrop()
bckd_node["name"].setValue("{}_BDN".format(self.name))
bckd_node["tile_color"].setValue(int(self.node_color, 16))
bckd_node["note_font_size"].setValue(24)
bckd_node["label"].setValue("[{}]".format(self.name))
# add avalon knobs
instance = anlib.imprint(bckd_node, self.data)
return instance
else:
nuke.message("Please select nodes you "
"wish to add to a container")
return
else:
bckd_node = autoBackdrop()
bckd_node["name"].setValue("{}_BDN".format(self.name))
bckd_node["tile_color"].setValue(int(self.node_color, 16))
bckd_node["note_font_size"].setValue(24)
bckd_node["label"].setValue("[{}]".format(self.name))
# add avalon knobs
instance = anlib.imprint(bckd_node, self.data)
return instance

View file

@ -24,8 +24,6 @@ class CreateWriteRender(plugin.PypeCreator):
def __init__(self, *args, **kwargs):
super(CreateWriteRender, self).__init__(*args, **kwargs)
self.name = self.data["subset"]
data = OrderedDict()
data["family"] = self.family