Ok, something's going definitely wrong when I copy-paste this. Script attached instead.
Sorry about that. On Fri, Jul 8, 2011 at 11:40 PM, Ivan Busquets <ivanbusqu...@gmail.com> wrote: > Hmm, something went funny with the formatting after copy/pasting. Here > it is again. > > > set cut_paste_input [stack 0] > version 6.2 v3 > push $cut_paste_input > NoOp { > name NoOp1 > knobChanged "\nn = nuke.thisNode()\nk = nuke.thisKnob()\nif k.name() > in \['red', 'green', 'blue']:\n > nuke.thisNode()\['tile_color'].setValue(int('%02x%02x%02x%02x' % > (n\['red'].value()*255,n\['green'].value()*255,n\['blue'].value()*255,1),16))\n\n\n" > tile_color 0xff0001 > selected true > xpos -299 > ypos -47 > addUserKnob {20 User} > addUserKnob {6 red +STARTLINE} > addUserKnob {6 green +STARTLINE} > green true > addUserKnob {6 blue +STARTLINE} > } > > > > On Fri, Jul 8, 2011 at 11:37 PM, Ivan Busquets <ivanbusqu...@gmail.com> wrote: >> >> That's a fun idea :) >> Yes you can, using a knobChanged callback that fires when any of your "red", >> "green" or "blue" knobs are changed. >> The trickiest bit is probably to set the right value for the tile_color knob >> based on your rgb values, since tile_color uses values packed in a rather >> awkward way. >> But here, have a look and see if that does what you want. >> >> set cut_paste_input [stack 0] version 6.2 v3 push $cut_paste_input NoOp { >> name NoOp1 knobChanged "\nn = nuke.thisNode()\nk = nuke.thisKnob()\nif >> k.name() in \['red', 'green', 'blue']:\n >> nuke.thisNode()\['tile_color'].setValue(int('%02x%02x%02x%02x' % >> (n\['red'].value()*255,n\['green'].value()*255,n\['blue'].value()*255,1),16))\n\n\n" >> tile_color 0xff0001 selected true xpos -299 ypos -17 addUserKnob {20 User} >> addUserKnob {6 red +STARTLINE} addUserKnob {6 green +STARTLINE} green true >> addUserKnob {6 blue +STARTLINE} } >> >> Cheers, >> Ivan >> On Fri, Jul 8, 2011 at 10:46 AM, David Schnee <dav...@tippett.com> wrote: >>> >>> Does anyone know if there is a way to dynamically link/change tile_color >>> with user knobs? Say I have a gizmo with a check box for red,green, and >>> blue. If only the red is checked, I want the tile_color to be red, if red >>> and green are checked, yellow, just blue, blue, and so on. Is this >>> possible? >>> >>> Cheers, >>> -Schnee >>> >>> -- >>> >>> \/ davids / comp \/ 177 >>> /\ tippettstudio /\ b d >>> >>> _______________________________________________ >>> Nuke-users mailing list >>> Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ >>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users >> >
tile_color.nk
Description: Binary data
_______________________________________________ Nuke-users mailing list Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users