Skip to content

Commit

Permalink
Added knob changed callback for changing profiles when the node is al…
Browse files Browse the repository at this point in the history
…ready created
  • Loading branch information
gillesvink committed Sep 11, 2022
1 parent fa6cbdd commit edbd110
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
10 changes: 10 additions & 0 deletions app.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ def render_farm(self, node):
"""
self.handler.render_farm(node)

def knob_changed(self, node, knob):
"""Function called whenever any knob changes on
the ShotGrid write node
Args:
node (attribute): node to process
knob (attribute): knob that has changed
"""
self.handler.knob_changed(node, knob)

def read_from_write(self, node):
"""Creates a read node from the selected write node
Expand Down
19 changes: 16 additions & 3 deletions gizmos/sgWrite.gizmo
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ Group {
addUserKnob {20 writeTab l "NFA ShotGrid Write"}
addUserKnob {41 channels T Write1.channels}
addUserKnob {1 output +DISABLED}
addUserKnob {68 category +DISABLED M {"undefined category"}}
addUserKnob {68 dataType l data -STARTLINE M {"undefined datatype"}}
addUserKnob {41 category T sgWriteControls.category}
addUserKnob {41 dataType l data -STARTLINE T sgWriteControls.dataType}
addUserKnob {26 ""}
addUserKnob {41 file T Write1.file}
addUserKnob {26 ""}
addUserKnob {22 renderLocal l render T "def render_local():\n import sgtk\n eng = sgtk.platform.current_engine()\n app = eng.apps\[\"tk-nuke-writenode\"]\n write_node = nuke.thisNode()\n app.render_local(write_node)\nrender_local()" +STARTLINE}
addUserKnob {22 renderOnFarm l "render on farm" -STARTLINE T "def render_farm():\n import sgtk\n eng = sgtk.platform.current_engine()\n app = eng.apps\[\"tk-nuke-writenode\"]\n write_node = nuke.thisNode()\n app.render_farm(write_node)\nrender_farm()"}
addUserKnob {41 Render +INVISIBLE T Write1.Render}
addUserKnob {26 ""}
addUserKnob {22 readFromWrite l "create read from write" T "def read_from_write():\n import sgtk\n eng = sgtk.platform.current_engine()\n app = eng.apps\[\"tk-nuke-writenode\"]\n write_node = nuke.thisNode()\n app.read_from_write(write_node)\nread_from_write()" +STARTLINE}
addUserKnob {26 isShotGridWriteNode l "" +STARTLINE +INVISIBLE}
}
Input {
inputs 0
name Input
selected true
xpos -171
ypos -155
}
Expand All @@ -33,4 +33,17 @@ Group {
xpos -171
ypos -15
}
NoOp {
inputs 0
name sgWriteControls
selected true
xpos 128
ypos -86
hide_input true
addUserKnob {20 sgWriteControls}
addUserKnob {68 category +DISABLED M {"undefined category"}}
addUserKnob {68 dataType l data -STARTLINE M {"undefined datatype"}}
addUserKnob {26 ""}
addUserKnob {26 help_1 l "" +STARTLINE T "<i><p>This node is separated to call the knobChanged callback only for these nodes.</p>\n\n<p>Not for example when the node's position has changed.</p>\n\n<p>This will just improve efficiency quite a bit</p>\n</i>"}
}
end_group
Empty file modified python/tk_nuke_writenode/create_dialog.py
100644 → 100755
Empty file.

0 comments on commit edbd110

Please sign in to comment.