can't this just be done with a gizmo and an expression. super basic but
the point I am trying to make.
set cut_paste_input [stack 0]
version 6.2 v3
ColorBars {
inputs 0
name ColorBars1
selected true
xpos -111
ypos -232
}
Truelight3 {
commands {lamp{internal-Xenon}
greyValue{445,445,445}
printerPoints{3.44,2.44,2.44}}
output_raw true
display monitor
display_file
/Applications/Nuke6.2v3/NukeX6.2v3.app/../Nuke6.2v3.app/Contents/MacOS/plugins/truelight3/displays/monitor
advanced true
lamp internal-Xenon
printer_points {{NoOp1.master+r x1 3} {NoOp1.master+g} {NoOp1.master+b}}
brightness 1
flare_correction 0.009999999776
white_u 0.1977999955
white_v 0.4683000147
name Truelight1
label "Truelight v3.0"
selected true
xpos -75
ypos -90
}
Viewer {
frame 1
input_process false
name Viewer1
selected true
xpos -40
ypos -9
}
push $cut_paste_input
NoOp {
name NoOp1
selected true
xpos -299
ypos -206
addUserKnob {20 User}
addUserKnob {7 master}
master 0.44
}
Randy S. Little
http://www.rslittle.com <http://reel.rslittle.com>
On Thu, Jun 30, 2011 at 09:20, Ben Dickson <[email protected]> wrote:
> It can be done fairly easily using a Python onKnobChanged callback..
>
> As a really basic (untested) example:
>
> def gang_sliders():
> node = nuke.thisNode()
> knob = nuke.thisKnob()
>
> # Get value of gang checkbox (True or False)
> gang_enabled = node['gang'].value()
>
> if not gang_enabled:
> return # do nothing
>
> new_value = knob.value()
>
> # set all the other values
> if knob.name() != "grade_red":
> node['grade_red'].setValue(**new_value)
> if knob.name() != "grade_green":
> node['grade_green'].setValue(**new_value)
> if knob.name() != "grade_blue":
> node['grade_blue'].setValue(**new_value)
>
> nuke.addKnobChanged(gang_**sliders, nodeClass = "MyGradeNode")
>
>
> That should give you the general idea - to make it actually function like
> the gang (keep the relative values), you need to know the old and new
> value..
>
> To do that, the simplest way I can think of is to have a dictionary storing
> the the previous values, e.g:
>
> PREV_VALUES = {}
>
> def gang_sliders():
> global PREV_VALUES
>
> node = nuke.thisNode()
> knob = nuke.thisKnob()
>
> # Get the previous values for the channel
> prev_red = PREV_VALUES[node.name()]['red'**]
>
> delta_red = prev - node['grade_red']
>
> if knob.name() == "grade_red":
> # red channel changed, move blue/green
> node['grade_green'].setValue(
> node['grade_green'].value() + delta_red)
> node['grade_blue'].setValue(
> node['grade_blue'].value() + delta_red)
>
> elif knob.name() == "grade_green":
> # same thing, but for red/blue
>
> elif knob.name() == "grade_blue":
> # and again
>
>
> # Then at the end, update the previous values
> PREV_VALUES[node.name()] = {
> 'red': node['grade_red'].value(),
> 'green': node['grade_green'].value(),
> [...]
> }
>
> Also, you'll need to keep have a callback for when the node is deleted,
> which removes the previous values
>
> ..okay so maybe "fairly easy" was maybe the wrong way to describe it! I'm
> sure there must be an easier or more elegant way to do this... I guess you
> could store the previous values in a hidden knob on the node?
>
> ella boliver wrote:
>
>> No, I am looking for something that works exactly like the 'gang' button
>> in the exposure node.
>>
>> :-)
>>
>> On Thu, Jun 30, 2011 at 10:51 AM, Julien Chandelle <
>> [email protected]
>> <mailto:julienchandelle@gmail.**com<[email protected]>>>
>> wrote:
>>
>> something like that ?
>>
>> set cut_paste_input [stack 0]
>> version 6.2 v4
>> push $cut_paste_input
>> NoOp {
>> name NoOp1
>> selected true
>> xpos 532
>> ypos -66
>> addUserKnob {20 User}
>> addUserKnob {7 master}
>> master 0.22
>> addUserKnob {7 red}
>> red 0.585
>> addUserKnob {7 green}
>> green 0.285
>> addUserKnob {7 blue}
>> blue 0.545
>> addUserKnob {18 color}
>> color {{master+red i} {master+green i} {master+blue i}}
>> }
>>
>>
>> On Thu, Jun 30, 2011 at 4:43 PM, ella boliver <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>> Hello,
>>
>> I am hoping someone can tell me the python to make parameters
>> move as a gang. For example- we have a custom baselight node
>> but the red, green, and blue all move independently in the
>> contrast. We want them to move together and then be able to
>> break them apart for final tweaks later on. Ideas?
>>
>> Thanks so much!
>>
>> Ella
>>
>> -- digital compositor
>> www.ellaboliver.net <http://www.ellaboliver.net>
>> +1 917 657 7070 <tel:%2B1%20917%20657%207070>
>>
>>
>> ______________________________**_________________
>> Nuke-users mailing list
>>
>> [email protected].**co.uk<[email protected]>
>>
>> <mailto:Nuke-users@support.**thefoundry.co.uk<[email protected]>
>> >,
>>
>> http://forums.thefoundry.co.**uk/<http://forums.thefoundry.co.uk/>
>> http://support.thefoundry.co.**uk/cgi-bin/mailman/listinfo/**
>> nuke-users<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users>
>>
>>
>>
>>
>> -- Julien Chandelle
>> GSM : +32 (0) 494 277 542 <tel:%2B32%20%280%29%20494%**20277%20542>
>> julienchandelle.be <http://www.julienchandelle.be**>
>>
>> || Nuke , AE & Fusion Compositor ||
>>
>>
>> ______________________________**_________________
>> Nuke-users mailing list
>> [email protected].**co.uk<[email protected]>
>>
>> <mailto:Nuke-users@support.**thefoundry.co.uk<[email protected]>
>> >,
>>
>> http://forums.thefoundry.co.**uk/ <http://forums.thefoundry.co.uk/>
>> http://support.thefoundry.co.**uk/cgi-bin/mailman/listinfo/**
>> nuke-users<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users>
>>
>>
>>
>>
>> --
>> digital compositor
>> www.ellaboliver.net <http://www.ellaboliver.net>
>>
>> +1 917 657 7070
>>
>>
>> ------------------------------**------------------------------**
>> ------------
>>
>> ______________________________**_________________
>> Nuke-users mailing list
>> [email protected].**co.uk<[email protected]>,
>> http://forums.thefoundry.co.**uk/ <http://forums.thefoundry.co.uk/>
>> http://support.thefoundry.co.**uk/cgi-bin/mailman/listinfo/**nuke-users<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users>
>>
>
> --
> ben dickson
> 2D TD | [email protected]
> rising sun pictures | www.rsp.com.au
>
> ______________________________**_________________
> Nuke-users mailing list
> [email protected].**co.uk<[email protected]>,
> http://forums.thefoundry.co.**uk/ <http://forums.thefoundry.co.uk/>
> http://support.thefoundry.co.**uk/cgi-bin/mailman/listinfo/**nuke-users<http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users>
>
_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users