Group { inputs 3 name ColorMerge_F help "Color Merge\n\nMerge the color from the Input \"Color\" to the footage in \"Src\".\n\nIf the \"Mix Color\" slider is on 0, the color is keep from the \"Src\".\n" knobChanged "c = nuke.toNode('Copy3')\nif nuke.thisKnob().name() == 'inputChange':\n if nuke.thisNode().input(2) != None:\n c\['from0'].setValue('rgba.alpha')\n else:\n c\['from0'].setValue('none')" tile_color 0x7aa9ffff selected true icon F_iconrgb.png addUserKnob {20 User l "Color Merge"} addUserKnob {7 mix l "@b;Mix Color" t "Slider on \"0\" keep the color from the Input \"Src\"."} mix 1 addUserKnob {26 S01 l " " T " "} addUserKnob {26 FT1 l " " T " "} addUserKnob {26 FT2 l " " T " "} addUserKnob {26 FTools l " " t "FranklinVFX.com\n" -STARTLINE T " Franklin VFX - 2017"} addUserKnob {26 ""} addUserKnob {41 from0 l Mask t "Use this channel from the original input to mix the output with the original input." T Copy3.from0} addUserKnob {6 invert_mask l Invert t "Invert the use of the mask channel." -STARTLINE} addUserKnob {1 output l INVISIBLE +INVISIBLE} output "\[if \{\[value mix] !=\"1\"\} \{return \"\[knob this.name_1 \"\[value mix] %\"]\"\} \{return \"\[knob this.name_1 \"rgb\"]\"\}]\[value name_1]" addUserKnob {1 name_1 l INVISIBLE +INVISIBLE} name_1 rgb addUserKnob {41 alpha l "(Un)Premult by" t "Image is divided by this channel before being processed, and multiplied again afterwards. This can improve color correction of anti-aliased edges." T Unpremult1.alpha} addUserKnob {41 Invert -STARTLINE T Unpremult1.invert} } Input { inputs 0 name Src xpos -89 ypos -750 } set N28163710 [stack 0] Dot { name Dot5 xpos -199 ypos -747 } Dot { name Dot16 xpos -199 ypos 277 } set N28162770 [stack 0] Dot { name Dot6 xpos -199 ypos 460 } set N28166c30 [stack 0] Dot { name Dot3 tile_color 0xffffffff xpos -199 ypos 576 } set N28167270 [stack 0] Dot { name Dot7 xpos -199 ypos 749 } Input { inputs 0 name mask xpos 349 ypos 479 number 2 addUserKnob {20 User} addUserKnob {6 in +STARTLINE} in {{"\[exists input2]"}} } AddChannels { channels rgba name AddChannels3 xpos 349 ypos 505 } set N28161af0 [stack 0] push $N28161af0 Copy { inputs 2 to0 rgba.alpha name Copy3 xpos 349 ypos 531 disable {{!parent.mask.in}} } Invert { name Invert1 xpos 349 ypos 567 disable {{parent.invert_mask i}} } push $N28167270 push $N28162770 AddChannels { channels alpha name AddChannels1 xpos -71 ypos 267 } push $N28163710 Unpremult { alpha none name Unpremult1 xpos -89 ypos -552 } set N281662d0 [stack 0] Dot { name Dot4 xpos 61 ypos -548 } set N2815fed0 [stack 0] Input { inputs 0 name Color xpos 207 ypos -755 number 1 } NoOp { name ChannelCheck xpos 207 ypos -578 addUserKnob {20 User} addUserKnob {6 alpha +STARTLINE} alpha {{"\[python \"len(\\\[n for n in nuke.channels(nuke.thisNode().input(0)) if n.find(\\\".r\\\") != -1])>0\"]"}} } Switch { inputs 2 which {{!ChannelCheck.alpha}} name Switch2 xpos 207 ypos -552 } Clamp { minimum 0.0001 maximum_enable false name Clamp1 xpos 207 ypos -526 } Dot { name Dot8 xpos 241 ypos -457 } set N28160510 [stack 0] Dot { name Dot15 xpos 351 ypos -457 } set N28163a30 [stack 0] Dot { name Dot14 xpos 482 ypos -457 } set N28166910 [stack 0] Dot { name Dot13 xpos 592 ypos -457 } set N28163d50 [stack 0] Dot { name Dot12 xpos 727 ypos -457 } set N281614b0 [stack 0] push $N281614b0 Dot { name Dot11 xpos 837 ypos -457 } ColorMatrix { matrix { {0 0 0} {0 0 0} {1 1 1} } name ColorMatrix4 xpos 803 ypos -376 } Merge2 { inputs 2 operation divide name Merge1 xpos 693 ypos -376 } Dot { name Dot9 xpos 727 ypos -197 } push $N28166910 push $N28163d50 ColorMatrix { matrix { {0 0 0} {1 1 1} {0 0 0} } name ColorMatrix3 xpos 558 ypos -378 } Merge2 { inputs 2 operation divide name Merge3 xpos 448 ypos -378 } Dot { name Dot10 xpos 482 ypos -297 } push $N28160510 push $N28163a30 ColorMatrix { matrix { {1 1 1} {0 0 0} {0 0 0} } name ColorMatrix2 xpos 317 ypos -379 } Merge2 { inputs 2 operation divide name Merge2 xpos 207 ypos -379 } Copy { inputs 2 from0 rgba.green to0 rgba.green name Copy1 xpos 207 ypos -306 } Copy { inputs 2 from0 rgba.blue to0 rgba.blue name Copy2 xpos 207 ypos -206 } Dot { name Dot2 xpos 241 ypos -73 } push $N2815fed0 ColorMatrix { matrix { {1 1 1} {1 1 1} {1 1 1} } name ColorMatrix1 xpos 27 ypos -378 } Dot { name Dot1 xpos 61 ypos -74 } Merge2 { inputs 2 operation multiply name Merge4 xpos 121 ypos -77 } push $N281662d0 Dot { name Dot17 xpos -55 ypos 47 } set N44faaee0 [stack 0] MergeExpression { inputs 2 temp_name0 BY temp_expr0 "( 0.213*(Br<= 0.0031308 ? 12.92*Br : ( 1.055*pow(Br,1.0 / 2.4)) - 0.055)) + ( 0.715*(Bg<= 0.0031308 ? 12.92*Bg : ( 1.055*pow(Bg,1.0 / 2.4)) - 0.055)) + ( 0.072*(Bb<= 0.0031308 ? 12.92*Bb : ( 1.055*pow(Bb,1.0 / 2.4)) - 0.055))" temp_name1 APb temp_expr1 "(-0.115*(Ar<= 0.0031308 ? 12.92*Ar : ( 1.055*pow(Ar,1.0 / 2.4)) - 0.055)) + (-0.385*(Ag<= 0.0031308 ? 12.92*Ag : ( 1.055*pow(Ag,1.0 / 2.4)) - 0.055)) + ( 0.500*(Ab<= 0.0031308 ? 12.92*Ab : ( 1.055*pow(Ab,1.0 / 2.4)) - 0.055))" temp_name2 APr temp_expr2 "( 0.500*(Ar<= 0.0031308 ? 12.92*Ar : ( 1.055*pow(Ar,1.0 / 2.4)) - 0.055)) + (-0.454*(Ag<= 0.0031308 ? 12.92*Ag : ( 1.055*pow(Ag,1.0 / 2.4)) - 0.055)) + (-0.046*(Ab<= 0.0031308 ? 12.92*Ab : ( 1.055*pow(Ab,1.0 / 2.4)) - 0.055))" expr0 "(( 1.000*BY) + ( 0.000*APb) + ( 1.575*APr))<.04045 ? (( 1.000*BY) + ( 0.000*APb) + ( 1.575*APr))/12.92 : pow(((( 1.000*BY) + ( 0.000*APb) + ( 1.575*APr))+.055)/1.055, 2.4)" expr1 "(( 1.000*BY) + (-0.187*APb) + (-0.468*APr))<.04045 ? (( 1.000*BY) + (-0.187*APb) + (-0.468*APr))/12.92 : pow(((( 1.000*BY) + (-0.187*APb) + (-0.468*APr))+.055)/1.055, 2.4)" expr2 "(( 1.000*BY) + ( 1.856*APb) + ( 0.000*APr))<.04045 ? (( 1.000*BY) + ( 1.856*APb) + ( 0.000*APr))/12.92 : pow(((( 1.000*BY) + ( 1.856*APb) + ( 0.000*APr))+.055)/1.055, 2.4)" name WasherMerge1 xpos 121 ypos 43 } push $N44faaee0 Dot { name Dot18 xpos -55 ypos 125 } Dissolve { inputs 2 which {{parent.mix}} name Dissolve2 xpos 121 ypos 116 } Copy { inputs 2 from0 rgba.alpha to0 rgba.alpha name Copy4 xpos 121 ypos 267 } Premult { alpha {{{parent.Unpremult1.alpha}}} invert {{parent.Unpremult1.invert}} name Premult1 xpos 121 ypos 348 } push $N28166c30 Dissolve { inputs 2 which 1 name Dissolve1 xpos 121 ypos 451 } set N44fabb60 [stack 0] Keymix { inputs 3 name Keymix1 xpos -2 ypos 567 disable {{!parent.mask.in i}} } push $N44fabb60 Switch { inputs 2 which {{Copy3.from0}} name Switch1 xpos 121 ypos 667 } CopyBBox { inputs 2 name CopyBBox1 xpos 121 ypos 745 } Output { name FranklinVFX xpos 121 ypos 866 } end_group