diff --git a/SB/sb_LumaKey/README.md b/SB/sb_LumaKey/README.md new file mode 100644 index 0000000..ac18a38 --- /dev/null +++ b/SB/sb_LumaKey/README.md @@ -0,0 +1,3 @@ +# sb_LumaKey + +This PyPlug will perform a luminance key of your footage, based on a chosen color space. \ No newline at end of file diff --git a/SB/sb_LumaKey/sb_LumaKey.png b/SB/sb_LumaKey/sb_LumaKey.png new file mode 100644 index 0000000..6711344 Binary files /dev/null and b/SB/sb_LumaKey/sb_LumaKey.png differ diff --git a/SB/sb_LumaKey/sb_LumaKey.py b/SB/sb_LumaKey/sb_LumaKey.py new file mode 100644 index 0000000..478b9b9 --- /dev/null +++ b/SB/sb_LumaKey/sb_LumaKey.py @@ -0,0 +1,1012 @@ +# -*- coding: utf-8 -*- +# DO NOT EDIT THIS FILE +# This file was automatically generated by Natron PyPlug exporter version 10. + +# Hand-written code should be added in a separate file named sb_LumaKeyExt.py +# See http://natron.readthedocs.org/en/master/devel/groups.html#adding-hand-written-code-callbacks-etc +# Note that Viewers are never exported + +import NatronEngine +import sys + +# Try to import the extensions file where callbacks and hand-written code should be located. +try: + from sb_LumaKeyExt import * +except ImportError: + pass + +def getPluginID(): + return "natron.community.plugins.sb_LumaKey" + +def getLabel(): + return "sb_LumaKey" + +def getVersion(): + return 1 + +def getIconPath(): + return "sb_LumaKey.png" + +def getGrouping(): + return "Community/SB" + +def getPluginDescription(): + return "This PyPlug will perform a luminance key of your footage, based on a chosen color space." + +def createInstance(app,group): + # Create all nodes in the group + + # Create the parameters of the group node the same way we did for all internal nodes + lastNode = group + lastNode.setColor(0.7255, 0.2118, 0.4784) + + # Create the user parameters + lastNode.Controls = lastNode.createPageParam("Controls", "Controls") + param = lastNode.createStringParam("sep01", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep01 = param + del param + + param = lastNode.createStringParam("sep02", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep02 = param + del param + + param = lastNode.createSeparatorParam("SETUP", "") + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setPersistent(False) + param.setEvaluateOnChange(False) + lastNode.SETUP = param + del param + + param = lastNode.createStringParam("sep03", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep03 = param + del param + + param = lastNode.createStringParam("sep04", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep04 = param + del param + + param = lastNode.createChoiceParam("colorChoice", "colorspace : ") + entries = [ ("HS(L)", ""), + ("(L)*A*B", ""), + ("Red channel", ""), + ("Green channel", ""), + ("Blue channel", "")] + param.setOptions(entries) + del entries + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setAnimationEnabled(True) + lastNode.colorChoice = param + del param + + param = lastNode.createStringParam("sep05", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep05 = param + del param + + param = lastNode.createStringParam("sep06", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep06 = param + del param + + param = lastNode.createSeparatorParam("LINE01", "") + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setPersistent(False) + param.setEvaluateOnChange(False) + lastNode.LINE01 = param + del param + + param = lastNode.createStringParam("sep07", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep07 = param + del param + + param = lastNode.createStringParam("sep08", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep08 = param + del param + + param = lastNode.createColorParam("luma_gradeblackPoint", "black Point : ", True) + param.setDisplayMinimum(-1, 0) + param.setDisplayMaximum(1, 0) + param.setDisplayMinimum(-1, 1) + param.setDisplayMaximum(1, 1) + param.setDisplayMinimum(-1, 2) + param.setDisplayMaximum(1, 2) + param.setDisplayMinimum(-1, 3) + param.setDisplayMaximum(1, 3) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setAddNewLine(True) + param.setAnimationEnabled(True) + lastNode.luma_gradeblackPoint = param + del param + + param = lastNode.createColorParam("luma_gradewhitePoint", "white Point : ", True) + param.setDisplayMinimum(0, 0) + param.setDisplayMaximum(4, 0) + param.setDefaultValue(1, 0) + param.restoreDefaultValue(0) + param.setDisplayMinimum(0, 1) + param.setDisplayMaximum(4, 1) + param.setDefaultValue(1, 1) + param.restoreDefaultValue(1) + param.setDisplayMinimum(0, 2) + param.setDisplayMaximum(4, 2) + param.setDefaultValue(1, 2) + param.restoreDefaultValue(2) + param.setDisplayMinimum(0, 3) + param.setDisplayMaximum(4, 3) + param.setDefaultValue(1, 3) + param.restoreDefaultValue(3) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setAddNewLine(True) + param.setAnimationEnabled(True) + lastNode.luma_gradewhitePoint = param + del param + + param = lastNode.createColorParam("luma_gradegamma", "gamma : ", True) + param.setDisplayMinimum(0.2, 0) + param.setDisplayMaximum(5, 0) + param.setDefaultValue(1, 0) + param.restoreDefaultValue(0) + param.setDisplayMinimum(0.2, 1) + param.setDisplayMaximum(5, 1) + param.setDefaultValue(1, 1) + param.restoreDefaultValue(1) + param.setDisplayMinimum(0.2, 2) + param.setDisplayMaximum(5, 2) + param.setDefaultValue(1, 2) + param.restoreDefaultValue(2) + param.setDisplayMinimum(0.2, 3) + param.setDisplayMaximum(5, 3) + param.setDefaultValue(1, 3) + param.restoreDefaultValue(3) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setAddNewLine(True) + param.setAnimationEnabled(True) + lastNode.luma_gradegamma = param + del param + + param = lastNode.createStringParam("sep09", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep09 = param + del param + + param = lastNode.createStringParam("sep10", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep10 = param + del param + + param = lastNode.createSeparatorParam("LINE02", "") + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setPersistent(False) + param.setEvaluateOnChange(False) + lastNode.LINE02 = param + del param + + param = lastNode.createBooleanParam("invertCheck", "invert : ") + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setAnimationEnabled(True) + lastNode.invertCheck = param + del param + + param = lastNode.createChoiceParam("outputChoice", "output : ") + entries = [ ("luma matte", ""), + ("alpha", ""), + ("rgba (premultiplied)", "")] + param.setOptions(entries) + del entries + param.setDefaultValue("alpha") + param.restoreDefaultValue() + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(False) + param.setAnimationEnabled(False) + lastNode.outputChoice = param + del param + + param = lastNode.createStringParam("sep11", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep11 = param + del param + + param = lastNode.createStringParam("sep12", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Controls.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep12 = param + del param + + lastNode.Credits = lastNode.createPageParam("Credits", "Credits") + param = lastNode.createStringParam("sep101", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep101 = param + del param + + param = lastNode.createStringParam("sep102", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep102 = param + del param + + param = lastNode.createSeparatorParam("NAME", "sb_LumaKey v1.0") + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setPersistent(False) + param.setEvaluateOnChange(False) + lastNode.NAME = param + del param + + param = lastNode.createStringParam("sep103", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep103 = param + del param + + param = lastNode.createStringParam("sep104", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep104 = param + del param + + param = lastNode.createSeparatorParam("LINE101", "") + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setPersistent(False) + param.setEvaluateOnChange(False) + lastNode.LINE101 = param + del param + + param = lastNode.createStringParam("sep105", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep105 = param + del param + + param = lastNode.createStringParam("sep106", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep106 = param + del param + + param = lastNode.createSeparatorParam("FR", "Version NATRON du Gizmo Nuke développé par Simon Bjork") + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setPersistent(False) + param.setEvaluateOnChange(False) + lastNode.FR = param + del param + + param = lastNode.createStringParam("sep107", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep107 = param + del param + + param = lastNode.createStringParam("sep108", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep108 = param + del param + + param = lastNode.createSeparatorParam("ENG", "NATRON version of Nuke Gizmo developed by Simon Bjork") + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setPersistent(False) + param.setEvaluateOnChange(False) + lastNode.ENG = param + del param + + param = lastNode.createStringParam("sep109", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep109 = param + del param + + param = lastNode.createStringParam("sep110", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep110 = param + del param + + param = lastNode.createSeparatorParam("CONVERSION", " (Fabrice Fernandez - 2018)") + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setPersistent(False) + param.setEvaluateOnChange(False) + lastNode.CONVERSION = param + del param + + param = lastNode.createStringParam("sep111", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep111 = param + del param + + param = lastNode.createStringParam("sep112", "") + param.setType(NatronEngine.StringParam.TypeEnum.eStringTypeLabel) + + # Add the param to the page + lastNode.Credits.addParam(param) + + # Set param properties + param.setHelp("") + param.setAddNewLine(True) + param.setEvaluateOnChange(False) + param.setAnimationEnabled(False) + lastNode.sep112 = param + del param + + # Refresh the GUI with the newly created parameters + lastNode.setPagesOrder(['Controls', 'Credits', 'Node', 'Settings']) + lastNode.refreshUserParamsGUI() + del lastNode + + # Start of node "Output1" + lastNode = app.createNode("fr.inria.built-in.Output", 1, group) + lastNode.setLabel("Output2") + lastNode.setPosition(4067, 5002) + lastNode.setSize(80, 30) + lastNode.setColor(0.7, 0.7, 0.7) + groupOutput1 = lastNode + + del lastNode + # End of node "Output1" + + # Start of node "Source" + lastNode = app.createNode("fr.inria.built-in.Input", 1, group) + lastNode.setScriptName("Source") + lastNode.setLabel("Source") + lastNode.setPosition(4276, 3106) + lastNode.setSize(80, 30) + lastNode.setColor(0.3, 0.5, 0.2) + groupSource = lastNode + + del lastNode + # End of node "Source" + + # Start of node "Dot1_2" + lastNode = app.createNode("fr.inria.built-in.Dot", 1, group) + lastNode.setScriptName("Dot1_2") + lastNode.setLabel("Dot1_2") + lastNode.setPosition(4309, 3312) + lastNode.setSize(15, 15) + lastNode.setColor(0.7, 0.7, 0.7) + groupDot1_2 = lastNode + + del lastNode + # End of node "Dot1_2" + + # Start of node "Dot2" + lastNode = app.createNode("fr.inria.built-in.Dot", 1, group) + lastNode.setScriptName("Dot2") + lastNode.setLabel("Dot2") + lastNode.setPosition(3947, 3312) + lastNode.setSize(15, 15) + lastNode.setColor(0.7, 0.7, 0.7) + groupDot2 = lastNode + + del lastNode + # End of node "Dot2" + + # Start of node "hsl" + lastNode = app.createNode("net.sf.openfx.RGBToHSL", 1, group) + lastNode.setScriptName("hsl") + lastNode.setLabel("hsl") + lastNode.setPosition(3649, 3593) + lastNode.setSize(80, 34) + lastNode.setColor(1, 1, 1) + grouphsl = lastNode + + del lastNode + # End of node "hsl" + + # Start of node "lab" + lastNode = app.createNode("net.sf.openfx.RGB709ToLab", 1, group) + lastNode.setScriptName("lab") + lastNode.setLabel("lab") + lastNode.setPosition(3763, 3595) + lastNode.setSize(80, 34) + lastNode.setColor(1, 1, 1) + grouplab = lastNode + + del lastNode + # End of node "lab" + + # Start of node "Shuffle1_2" + lastNode = app.createNode("net.sf.openfx.ShufflePlugin", 3, group) + lastNode.setScriptName("Shuffle1_2") + lastNode.setLabel("Shuffle1") + lastNode.setPosition(3649, 3673) + lastNode.setSize(80, 34) + lastNode.setColor(0.6196, 0.2353, 0.3882) + groupShuffle1_2 = lastNode + + param = lastNode.getParam("outputR") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.B") + del param + + param = lastNode.getParam("outputG") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.B") + del param + + param = lastNode.getParam("outputA") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.B") + del param + + del lastNode + # End of node "Shuffle1_2" + + # Start of node "Shuffle2_2" + lastNode = app.createNode("net.sf.openfx.ShufflePlugin", 3, group) + lastNode.setScriptName("Shuffle2_2") + lastNode.setLabel("Shuffle2") + lastNode.setPosition(3763, 3670) + lastNode.setSize(80, 34) + lastNode.setColor(0.6196, 0.2353, 0.3882) + groupShuffle2_2 = lastNode + + param = lastNode.getParam("outputG") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.R") + del param + + param = lastNode.getParam("outputB") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.R") + del param + + param = lastNode.getParam("outputA") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.R") + del param + + del lastNode + # End of node "Shuffle2_2" + + # Start of node "red" + lastNode = app.createNode("net.sf.openfx.ShufflePlugin", 3, group) + lastNode.setScriptName("red") + lastNode.setLabel("red") + lastNode.setPosition(3914, 3672) + lastNode.setSize(80, 34) + lastNode.setColor(0.6196, 0.2353, 0.3882) + groupred = lastNode + + param = lastNode.getParam("outputG") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.R") + del param + + param = lastNode.getParam("outputB") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.R") + del param + + param = lastNode.getParam("outputA") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.R") + del param + + del lastNode + # End of node "red" + + # Start of node "green" + lastNode = app.createNode("net.sf.openfx.ShufflePlugin", 3, group) + lastNode.setScriptName("green") + lastNode.setLabel("green") + lastNode.setPosition(4029, 3669) + lastNode.setSize(80, 34) + lastNode.setColor(0.6196, 0.2353, 0.3882) + groupgreen = lastNode + + param = lastNode.getParam("outputR") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.G") + del param + + param = lastNode.getParam("outputB") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.G") + del param + + param = lastNode.getParam("outputA") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.G") + del param + + del lastNode + # End of node "green" + + # Start of node "blue" + lastNode = app.createNode("net.sf.openfx.ShufflePlugin", 3, group) + lastNode.setScriptName("blue") + lastNode.setLabel("blue") + lastNode.setPosition(4147, 3669) + lastNode.setSize(80, 34) + lastNode.setColor(0.6196, 0.2353, 0.3882) + groupblue = lastNode + + param = lastNode.getParam("outputR") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.B") + del param + + param = lastNode.getParam("outputG") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.B") + del param + + param = lastNode.getParam("outputA") + if param is not None: + param.set("B.uk.co.thefoundry.OfxImagePlaneColour.B") + del param + + del lastNode + # End of node "blue" + + # Start of node "type_switch" + lastNode = app.createNode("net.sf.openfx.switchPlugin", 1, group) + lastNode.setScriptName("type_switch") + lastNode.setLabel("type_switch") + lastNode.setPosition(3914, 3969) + lastNode.setSize(80, 34) + lastNode.setColor(1, 1, 1) + grouptype_switch = lastNode + + param = lastNode.getParam("which") + if param is not None: + param.setValue(0, 0) + del param + + del lastNode + # End of node "type_switch" + + # Start of node "luma_grade" + lastNode = app.createNode("net.sf.openfx.GradePlugin", 2, group) + lastNode.setScriptName("luma_grade") + lastNode.setLabel("luma_grade") + lastNode.setPosition(3914, 4224) + lastNode.setSize(80, 34) + lastNode.setColor(0.48, 0.66, 1) + groupluma_grade = lastNode + + param = lastNode.getParam("NatronOfxParamProcessA") + if param is not None: + param.setValue(True) + del param + + param = lastNode.getParam("clampBlack") + if param is not None: + param.setValue(False) + del param + + del lastNode + # End of node "luma_grade" + + # Start of node "Clamp1" + lastNode = app.createNode("net.sf.openfx.Clamp", 2, group) + lastNode.setScriptName("Clamp1") + lastNode.setLabel("Clamp1") + lastNode.setPosition(3914, 4280) + lastNode.setSize(80, 34) + lastNode.setColor(0.48, 0.66, 1) + groupClamp1 = lastNode + + del lastNode + # End of node "Clamp1" + + # Start of node "Invert1_2" + lastNode = app.createNode("net.sf.openfx.Invert", 2, group) + lastNode.setScriptName("Invert1_2") + lastNode.setLabel("Invert1") + lastNode.setPosition(3914, 4346) + lastNode.setSize(80, 34) + lastNode.setColor(0.48, 0.66, 1) + groupInvert1_2 = lastNode + + param = lastNode.getParam("NatronOfxParamProcessR") + if param is not None: + param.setValue(False) + del param + + param = lastNode.getParam("NatronOfxParamProcessG") + if param is not None: + param.setValue(False) + del param + + param = lastNode.getParam("NatronOfxParamProcessB") + if param is not None: + param.setValue(False) + del param + + param = lastNode.getParam("disableNode") + if param is not None: + param.setValue(True) + del param + + del lastNode + # End of node "Invert1_2" + + # Start of node "Copy1" + lastNode = app.createNode("net.sf.openfx.ShufflePlugin", 3, group) + lastNode.setScriptName("Copy1") + lastNode.setLabel("Copy1") + lastNode.setPosition(4276, 4557) + lastNode.setSize(80, 34) + lastNode.setColor(0.6196, 0.2353, 0.3882) + groupCopy1 = lastNode + + param = lastNode.getParam("outputA") + if param is not None: + param.set("A.uk.co.thefoundry.OfxImagePlaneColour.A") + del param + + del lastNode + # End of node "Copy1" + + # Start of node "Dot3_2" + lastNode = app.createNode("fr.inria.built-in.Dot", 1, group) + lastNode.setScriptName("Dot3_2") + lastNode.setLabel("Dot3_2") + lastNode.setPosition(3947, 4567) + lastNode.setSize(15, 15) + lastNode.setColor(0.7, 0.7, 0.7) + groupDot3_2 = lastNode + + del lastNode + # End of node "Dot3_2" + + # Start of node "Premult1_2" + lastNode = app.createNode("net.sf.openfx.Premult", 2, group) + lastNode.setScriptName("Premult1_2") + lastNode.setLabel("Premult1") + lastNode.setPosition(4276, 4621) + lastNode.setSize(80, 34) + lastNode.setColor(1, 1, 1) + groupPremult1_2 = lastNode + + del lastNode + # End of node "Premult1_2" + + # Start of node "Switch1" + lastNode = app.createNode("net.sf.openfx.switchPlugin", 1, group) + lastNode.setScriptName("Switch1") + lastNode.setLabel("Switch1") + lastNode.setPosition(4067, 4727) + lastNode.setSize(80, 34) + lastNode.setColor(1, 1, 1) + groupSwitch1 = lastNode + + param = lastNode.getParam("which") + if param is not None: + param.setValue(1, 0) + del param + + del lastNode + # End of node "Switch1" + + # Now that all nodes are created we can connect them together, restore expressions + groupOutput1.connectInput(0, groupSwitch1) + groupDot1_2.connectInput(0, groupSource) + groupDot2.connectInput(0, groupDot1_2) + grouphsl.connectInput(0, groupDot2) + grouplab.connectInput(0, groupDot2) + groupShuffle1_2.connectInput(0, grouphsl) + groupShuffle2_2.connectInput(0, grouplab) + groupred.connectInput(0, groupDot2) + groupgreen.connectInput(0, groupDot2) + groupblue.connectInput(0, groupDot2) + grouptype_switch.connectInput(0, groupShuffle1_2) + grouptype_switch.connectInput(1, groupShuffle2_2) + grouptype_switch.connectInput(2, groupred) + grouptype_switch.connectInput(3, groupgreen) + grouptype_switch.connectInput(4, groupblue) + groupluma_grade.connectInput(0, grouptype_switch) + groupClamp1.connectInput(0, groupluma_grade) + groupInvert1_2.connectInput(0, groupClamp1) + groupCopy1.connectInput(0, groupDot1_2) + groupCopy1.connectInput(1, groupDot3_2) + groupDot3_2.connectInput(0, groupInvert1_2) + groupPremult1_2.connectInput(0, groupCopy1) + groupSwitch1.connectInput(0, groupDot3_2) + groupSwitch1.connectInput(1, groupCopy1) + groupSwitch1.connectInput(2, groupPremult1_2) + + param = grouptype_switch.getParam("which") + param.setExpression("thisGroup.colorChoice.get()", False, 0) + del param + param = groupluma_grade.getParam("blackPoint") + group.getParam("luma_gradeblackPoint").setAsAlias(param) + del param + param = groupluma_grade.getParam("whitePoint") + group.getParam("luma_gradewhitePoint").setAsAlias(param) + del param + param = groupluma_grade.getParam("gamma") + group.getParam("luma_gradegamma").setAsAlias(param) + del param + param = groupInvert1_2.getParam("disableNode") + param.setExpression("not thisGroup.invertCheck.get()", False, 0) + del param + param = groupSwitch1.getParam("which") + param.setExpression("thisGroup.outputChoice.get()", False, 0) + del param + + try: + extModule = sys.modules["sb_LumaKeyExt"] + except KeyError: + extModule = None + if extModule is not None and hasattr(extModule ,"createInstanceExt") and hasattr(extModule.createInstanceExt,"__call__"): + extModule.createInstanceExt(app,group) diff --git a/SB/sb_LumaKey/sb_LumaKey.xml b/SB/sb_LumaKey/sb_LumaKey.xml new file mode 100644 index 0000000..f1e24d9 --- /dev/null +++ b/SB/sb_LumaKey/sb_LumaKey.xml @@ -0,0 +1,10 @@ + + + sb_LumaKey + This PyPlug will perform a luminance key of your footage, based on a chosen color space. + 1.0 + @DATE@ + natron.community.plugins.sb_LumaKey + script + +