# -*- 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 LightWrapExt.py
# See http://natron.readthedocs.org/en/master/devel/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 LightWrapExt import *
except ImportError:
    pass

def getPluginID():
    return "fr.inria.LightWrap"

def getLabel():
    return "LightWrap"

def getVersion():
    return 1

def getIconPath():
    return "LightWrap.png"

def getGrouping():
    return "Draw"

def getPluginDescription():
    return "LightWrap helps composite objects onto a bright background by simulating reflections from the background light on the foreground, around its edges. Input A is the foreground image and its matte, and input B the the background to use for the wrapping effect.\n\nThe output of LightWrap should then be composited over the background to give the final composite."

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

    # Create the user parameters
    lastNode.controlsPage = lastNode.createPageParam("controlsPage", "Controls")
    param = lastNode.createDouble2DParam("diffuse", "Diffuse")
    param.setMinimum(0, 0)
    param.setMaximum(1000, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(100, 0)
    param.setDefaultValue(15, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(0, 1)
    param.setMaximum(1000, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(100, 1)
    param.setDefaultValue(15, 1)
    param.restoreDefaultValue(1)

    # Add the param to the page
    lastNode.controlsPage.addParam(param)

    # Set param properties
    param.setHelp("Size of the reflections from the background to the foreground element (Intensity controls their intensity). Start by setting Diffuse to zero and adjust intensity to see what colors from the background are being reflected. Then adjust Diffuse, come back to Intensity if necessary, and balance both parameters until the result is satisfactory.")
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.diffuse = param
    del param

    param = lastNode.createDoubleParam("intensity", "Intensity")
    param.setMinimum(0, 0)
    param.setMaximum(100, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(100, 0)

    # Add the param to the page
    lastNode.controlsPage.addParam(param)

    # Set param properties
    param.setHelp("Brightness of the reflections from the background to the foreground element (Diffuse controls their size). Start by setting Diffuse to zero and adjust intensity to see what colors from the background are being reflected. Then adjust Diffuse, come back to Intensity if necessary, and balance both parameters until the result is satisfactory.")
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.intensity = param
    del param

    param = lastNode.createBooleanParam("onlyWrap", "Generate Wrap Only")

    # Add the param to the page
    lastNode.controlsPage.addParam(param)

    # Set param properties
    param.setHelp("When checked, the LightWrap in generated but is not merged with the foreground object (disables the Highlight Merge).")
    param.setAddNewLine(True)
    param.setAnimationEnabled(False)
    lastNode.onlyWrap = param
    del param

    param = lastNode.createBooleanParam("disableLuma", "Disable luminance-Based Wrap")

    # Add the param to the page
    lastNode.controlsPage.addParam(param)

    # Set param properties
    param.setHelp("When checked, the LightWrap effect is created uniformly around the edged, rather than being controled by the color of the background.")
    param.setAddNewLine(True)
    param.setAnimationEnabled(False)
    lastNode.disableLuma = param
    del param

    param = lastNode.createBooleanParam("enableGlow", "Enable Glow")

    # Add the param to the page
    lastNode.controlsPage.addParam(param)

    # Set param properties
    param.setHelp("When checked, the LightWrap is not masked by the foreground object, so that the objects seems to glow.")
    param.setAddNewLine(True)
    param.setAnimationEnabled(False)
    lastNode.enableGlow = param
    del param

    param = lastNode.createDouble2DParam("fgblur", "FGBlur")
    param.setMinimum(0, 0)
    param.setMaximum(1000, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(100, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(0, 1)
    param.setMaximum(1000, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(100, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)

    # Add the param to the page
    lastNode.controlsPage.addParam(param)

    # Set param properties
    param.setHelp("Size of the blur applied to the alpha channel of the foreground (i.e. the foreground matte). More blur causes more background to be added to the foreground.")
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.fgblur = param
    del param

    param = lastNode.createChoiceParam("fgblurBoundary", "FGBlur Border Conditions")

    # Add the param to the page
    lastNode.controlsPage.addParam(param)

    # Set param properties
    param.setHelp("Border conditions of the blur applied to the alpha channel of the foreground (i.e. the foreground matte). Use \"Black\" in most cases, and \"Nearest\" if the foreground matte should be extended beyond image borders when it touches them.")
    param.setAddNewLine(True)
    param.setAnimationEnabled(False)
    lastNode.fgblurBoundary = param
    del param

    param = lastNode.createDouble2DParam("bgblur", "BGBlur")
    param.setMinimum(0, 0)
    param.setMaximum(1000, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(100, 0)
    param.setMinimum(0, 1)
    param.setMaximum(1000, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(100, 1)

    # Add the param to the page
    lastNode.controlsPage.addParam(param)

    # Set param properties
    param.setHelp("Size of the blur applied to the background before merging it with the foreground element and applying the Diffuse blur.")
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.bgblur = param
    del param

    param = lastNode.createDoubleParam("saturation", "Saturation")
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(4, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)

    # Add the param to the page
    lastNode.controlsPage.addParam(param)

    # Set param properties
    param.setHelp("Color saturation of the LightWrap effect. Advanced color correction parameters are available in the ColorCorrect tab.")
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.saturation = param
    del param

    param = lastNode.createDoubleParam("lumaTolerance", "Luma Tolerance")
    param.setMinimum(0, 0)
    param.setMaximum(1, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(1, 0)

    # Add the param to the page
    lastNode.controlsPage.addParam(param)

    # Set param properties
    param.setHelp("Luminance threshold of the LightWrap effect. Luminance values below this do not generate a LightWrap.")
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.lumaTolerance = param
    del param

    param = lastNode.createChoiceParam("highlightmerge", "Highlight Merge")
    param.setDefaultValue(31)
    param.restoreDefaultValue()

    # Add the param to the page
    lastNode.controlsPage.addParam(param)

    # Set param properties
    param.setHelp("Merge operation between the foreground object and the background. The default operation is \"plus\", which produces a glow effect.")
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.highlightmerge = param
    del param

    param = lastNode.createBooleanParam("useConstant", "Use Constant Highlight")

    # Add the param to the page
    lastNode.controlsPage.addParam(param)

    # Set param properties
    param.setHelp("When checked, use a constant color (specified by the Constant parameter) instead of the background for the LightWrap effect.")
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.useConstant = param
    del param

    param = lastNode.createColorParam("constantcolor", "Constant", True)
    param.setMinimum(-2147483648, 0)
    param.setMaximum(2147483647, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(1, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-2147483648, 1)
    param.setMaximum(2147483647, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(1, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-2147483648, 2)
    param.setMaximum(2147483647, 2)
    param.setDisplayMinimum(0, 2)
    param.setDisplayMaximum(1, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-2147483648, 3)
    param.setMaximum(2147483647, 3)
    param.setDisplayMinimum(0, 3)
    param.setDisplayMaximum(1, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the page
    lastNode.controlsPage.addParam(param)

    # Set param properties
    param.setHelp("Color to use in the LightWrap effect when Use constant highlight is enabled.")
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.constantcolor = param
    del param

    lastNode.colorCorrectPage = lastNode.createPageParam("colorCorrectPage", "ColorCorrect")
    param = lastNode.createGroupParam("masterGroup", "Master")

    # Add the param to the page
    lastNode.colorCorrectPage.addParam(param)

    # Set param properties
    param.setHelp("")
    param.setAddNewLine(True)
    param.setEvaluateOnChange(False)
    param.setOpened(True)
    lastNode.masterGroup = param
    del param

    param = lastNode.createColorParam("ColorCorrect1MasterSaturation", "Saturation", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(4, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(4, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0, 2)
    param.setDisplayMaximum(4, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0, 3)
    param.setDisplayMaximum(4, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.masterGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1MasterSaturation = param
    del param

    param = lastNode.createColorParam("ColorCorrect1MasterContrast", "Contrast", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(4, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(4, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0, 2)
    param.setDisplayMaximum(4, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0, 3)
    param.setDisplayMaximum(4, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.masterGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1MasterContrast = param
    del param

    param = lastNode.createColorParam("ColorCorrect1MasterGamma", "Gamma", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0.2, 0)
    param.setDisplayMaximum(5, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0.2, 1)
    param.setDisplayMaximum(5, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0.2, 2)
    param.setDisplayMaximum(5, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0.2, 3)
    param.setDisplayMaximum(5, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.masterGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1MasterGamma = param
    del param

    param = lastNode.createColorParam("ColorCorrect1MasterGain", "Gain", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(4, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(4, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0, 2)
    param.setDisplayMaximum(4, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0, 3)
    param.setDisplayMaximum(4, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.masterGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1MasterGain = param
    del param

    param = lastNode.createColorParam("ColorCorrect1MasterOffset", "Offset", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(-1, 0)
    param.setDisplayMaximum(1, 0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(-1, 1)
    param.setDisplayMaximum(1, 1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(-1, 2)
    param.setDisplayMaximum(1, 2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(-1, 3)
    param.setDisplayMaximum(1, 3)

    # Add the param to the group, no need to add it to the page
    lastNode.masterGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1MasterOffset = param
    del param

    param = lastNode.createGroupParam("shadowsGroup", "Shadows")

    # Add the param to the page
    lastNode.colorCorrectPage.addParam(param)

    # Set param properties
    param.setHelp("")
    param.setAddNewLine(True)
    param.setEvaluateOnChange(False)
    param.setOpened(True)
    lastNode.shadowsGroup = param
    del param

    param = lastNode.createBooleanParam("ColorCorrect1ShadowsEnable", "Enable")
    param.setDefaultValue(True)
    param.restoreDefaultValue()

    # Add the param to the group, no need to add it to the page
    lastNode.shadowsGroup.addParam(param)

    # Set param properties
    param.setHelp("")
    param.setAddNewLine(True)
    param.setAnimationEnabled(False)
    lastNode.ColorCorrect1ShadowsEnable = param
    del param

    param = lastNode.createColorParam("ColorCorrect1ShadowsSaturation", "Saturation", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(4, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(4, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0, 2)
    param.setDisplayMaximum(4, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0, 3)
    param.setDisplayMaximum(4, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.shadowsGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1ShadowsSaturation = param
    del param

    param = lastNode.createColorParam("ColorCorrect1ShadowsContrast", "Contrast", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(4, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(4, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0, 2)
    param.setDisplayMaximum(4, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0, 3)
    param.setDisplayMaximum(4, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.shadowsGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1ShadowsContrast = param
    del param

    param = lastNode.createColorParam("ColorCorrect1ShadowsGamma", "Gamma", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0.2, 0)
    param.setDisplayMaximum(5, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0.2, 1)
    param.setDisplayMaximum(5, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0.2, 2)
    param.setDisplayMaximum(5, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0.2, 3)
    param.setDisplayMaximum(5, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.shadowsGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1ShadowsGamma = param
    del param

    param = lastNode.createColorParam("ColorCorrect1ShadowsGain", "Gain", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(4, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(4, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0, 2)
    param.setDisplayMaximum(4, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0, 3)
    param.setDisplayMaximum(4, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.shadowsGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1ShadowsGain = param
    del param

    param = lastNode.createColorParam("ColorCorrect1ShadowsOffset", "Offset", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(-1, 0)
    param.setDisplayMaximum(1, 0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(-1, 1)
    param.setDisplayMaximum(1, 1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(-1, 2)
    param.setDisplayMaximum(1, 2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(-1, 3)
    param.setDisplayMaximum(1, 3)

    # Add the param to the group, no need to add it to the page
    lastNode.shadowsGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1ShadowsOffset = param
    del param

    param = lastNode.createGroupParam("midtonesGroup", "Midtones")

    # Add the param to the page
    lastNode.colorCorrectPage.addParam(param)

    # Set param properties
    param.setHelp("")
    param.setAddNewLine(True)
    param.setEvaluateOnChange(False)
    param.setOpened(True)
    lastNode.midtonesGroup = param
    del param

    param = lastNode.createBooleanParam("ColorCorrect1MidtonesEnable", "Enable")
    param.setDefaultValue(True)
    param.restoreDefaultValue()

    # Add the param to the group, no need to add it to the page
    lastNode.midtonesGroup.addParam(param)

    # Set param properties
    param.setHelp("")
    param.setAddNewLine(True)
    param.setAnimationEnabled(False)
    lastNode.ColorCorrect1MidtonesEnable = param
    del param

    param = lastNode.createColorParam("ColorCorrect1MidtonesSaturation", "Saturation", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(4, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(4, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0, 2)
    param.setDisplayMaximum(4, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0, 3)
    param.setDisplayMaximum(4, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.midtonesGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1MidtonesSaturation = param
    del param

    param = lastNode.createColorParam("ColorCorrect1MidtonesContrast", "Contrast", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(4, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(4, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0, 2)
    param.setDisplayMaximum(4, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0, 3)
    param.setDisplayMaximum(4, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.midtonesGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1MidtonesContrast = param
    del param

    param = lastNode.createColorParam("ColorCorrect1MidtonesGamma", "Gamma", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0.2, 0)
    param.setDisplayMaximum(5, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0.2, 1)
    param.setDisplayMaximum(5, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0.2, 2)
    param.setDisplayMaximum(5, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0.2, 3)
    param.setDisplayMaximum(5, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.midtonesGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1MidtonesGamma = param
    del param

    param = lastNode.createColorParam("ColorCorrect1MidtonesGain", "Gain", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(4, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(4, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0, 2)
    param.setDisplayMaximum(4, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0, 3)
    param.setDisplayMaximum(4, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.midtonesGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1MidtonesGain = param
    del param

    param = lastNode.createColorParam("ColorCorrect1MidtonesOffset", "Offset", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(-1, 0)
    param.setDisplayMaximum(1, 0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(-1, 1)
    param.setDisplayMaximum(1, 1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(-1, 2)
    param.setDisplayMaximum(1, 2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(-1, 3)
    param.setDisplayMaximum(1, 3)

    # Add the param to the group, no need to add it to the page
    lastNode.midtonesGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1MidtonesOffset = param
    del param

    param = lastNode.createGroupParam("highlightsGroup", "Highlights")

    # Add the param to the page
    lastNode.colorCorrectPage.addParam(param)

    # Set param properties
    param.setHelp("")
    param.setAddNewLine(True)
    param.setEvaluateOnChange(False)
    param.setOpened(True)
    lastNode.highlightsGroup = param
    del param

    param = lastNode.createBooleanParam("ColorCorrect1HighlightsEnable", "Enable")
    param.setDefaultValue(True)
    param.restoreDefaultValue()

    # Add the param to the group, no need to add it to the page
    lastNode.highlightsGroup.addParam(param)

    # Set param properties
    param.setHelp("")
    param.setAddNewLine(True)
    param.setAnimationEnabled(False)
    lastNode.ColorCorrect1HighlightsEnable = param
    del param

    param = lastNode.createColorParam("ColorCorrect1HighlightsSaturation", "Saturation", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(4, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(4, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0, 2)
    param.setDisplayMaximum(4, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0, 3)
    param.setDisplayMaximum(4, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.highlightsGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1HighlightsSaturation = param
    del param

    param = lastNode.createColorParam("ColorCorrect1HighlightsContrast", "Contrast", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(4, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(4, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0, 2)
    param.setDisplayMaximum(4, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0, 3)
    param.setDisplayMaximum(4, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.highlightsGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1HighlightsContrast = param
    del param

    param = lastNode.createColorParam("ColorCorrect1HighlightsGamma", "Gamma", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0.2, 0)
    param.setDisplayMaximum(5, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0.2, 1)
    param.setDisplayMaximum(5, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0.2, 2)
    param.setDisplayMaximum(5, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0.2, 3)
    param.setDisplayMaximum(5, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.highlightsGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1HighlightsGamma = param
    del param

    param = lastNode.createColorParam("ColorCorrect1HighlightsGain", "Gain", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(0, 0)
    param.setDisplayMaximum(4, 0)
    param.setDefaultValue(1, 0)
    param.restoreDefaultValue(0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(0, 1)
    param.setDisplayMaximum(4, 1)
    param.setDefaultValue(1, 1)
    param.restoreDefaultValue(1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(0, 2)
    param.setDisplayMaximum(4, 2)
    param.setDefaultValue(1, 2)
    param.restoreDefaultValue(2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(0, 3)
    param.setDisplayMaximum(4, 3)
    param.setDefaultValue(1, 3)
    param.restoreDefaultValue(3)

    # Add the param to the group, no need to add it to the page
    lastNode.highlightsGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1HighlightsGain = param
    del param

    param = lastNode.createColorParam("ColorCorrect1HighlightsOffset", "Offset", True)
    param.setMinimum(-1.79769e+308, 0)
    param.setMaximum(1.79769e+308, 0)
    param.setDisplayMinimum(-1, 0)
    param.setDisplayMaximum(1, 0)
    param.setMinimum(-1.79769e+308, 1)
    param.setMaximum(1.79769e+308, 1)
    param.setDisplayMinimum(-1, 1)
    param.setDisplayMaximum(1, 1)
    param.setMinimum(-1.79769e+308, 2)
    param.setMaximum(1.79769e+308, 2)
    param.setDisplayMinimum(-1, 2)
    param.setDisplayMaximum(1, 2)
    param.setMinimum(-1.79769e+308, 3)
    param.setMaximum(1.79769e+308, 3)
    param.setDisplayMinimum(-1, 3)
    param.setDisplayMaximum(1, 3)

    # Add the param to the group, no need to add it to the page
    lastNode.highlightsGroup.addParam(param)

    # Set param properties
    param.setAddNewLine(True)
    param.setAnimationEnabled(True)
    lastNode.ColorCorrect1HighlightsOffset = param
    del param

    lastNode.userNatron = lastNode.createPageParam("userNatron", "User")
    # Refresh the GUI with the newly created parameters
    lastNode.setPagesOrder(['controlsPage', 'colorCorrectPage', 'Node', 'Settings', 'userNatron'])
    lastNode.refreshUserParamsGUI()
    del lastNode

    # Start of node "Output1"
    lastNode = app.createNode("fr.inria.built-in.Output", 1, group)
    lastNode.setLabel("Output1")
    lastNode.setPosition(761, 1308)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.7, 0.7, 0.7)
    groupOutput1 = lastNode

    del lastNode
    # End of node "Output1"

    # Start of node "Input1"
    lastNode = app.createNode("fr.inria.built-in.Input", 1, group)
    lastNode.setScriptName("Input1")
    lastNode.setLabel("A")
    lastNode.setPosition(198, -35)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.3, 0.5, 0.2)
    groupInput1 = lastNode

    del lastNode
    # End of node "Input1"

    # Start of node "Keyer1"
    lastNode = app.createNode("net.sf.openfx.KeyerPlugin", 1, group)
    lastNode.setScriptName("Keyer1")
    lastNode.setLabel("Keyer1")
    lastNode.setPosition(752, 164)
    lastNode.setSize(104, 56)
    lastNode.setColor(0, 1, 0)
    groupKeyer1 = lastNode

    param = lastNode.getParam("softnessLower")
    if param is not None:
        param.setValue(-1, 0)
        del param

    param = lastNode.getParam("softnessUpper")
    if param is not None:
        param.setValue(0, 0)
        del param

    param = lastNode.getParam("userTextArea")
    if param is not None:
        param.setValue("<Natron>(Luminance)</Natron>")
        del param

    del lastNode
    # End of node "Keyer1"

    # Start of node "Premult1"
    lastNode = app.createNode("net.sf.openfx.Premult", 2, group)
    lastNode.setScriptName("Premult1")
    lastNode.setLabel("Premult1")
    lastNode.setPosition(752, 252)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.3, 0.37, 0.776)
    groupPremult1 = lastNode

    del lastNode
    # End of node "Premult1"

    # Start of node "BGBlur"
    lastNode = app.createNode("net.sf.cimg.CImgBlur", 3, group)
    lastNode.setScriptName("BGBlur")
    lastNode.setLabel("BGBlur")
    lastNode.setPosition(752, 316)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.8, 0.5, 0.3)
    groupBGBlur = lastNode

    param = lastNode.getParam("NatronOfxParamProcessA")
    if param is not None:
        param.setValue(True)
        del param

    param = lastNode.getParam("expandRoD")
    if param is not None:
        param.setValue(False)
        del param

    del lastNode
    # End of node "BGBlur"

    # Start of node "Constant1"
    lastNode = app.createNode("net.sf.openfx.ConstantPlugin", 1, group)
    lastNode.setScriptName("Constant1")
    lastNode.setLabel("Constant1")
    lastNode.setPosition(968, 185)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.3, 0.5, 0.2)
    groupConstant1 = lastNode

    param = lastNode.getParam("NatronParamFormatChoice")
    if param is not None:
        param.set("PC_Video 640x480")
        del param

    param = lastNode.getParam("size")
    if param is not None:
        param.setValue(960, 0)
        param.setValue(540, 1)
        del param

    param = lastNode.getParam("color")
    if param is not None:
        param.setValue(1, 0)
        param.setValue(1, 1)
        param.setValue(1, 2)
        param.setValue(1, 3)
        del param

    param = lastNode.getParam("NatronOfxParamProcessA")
    if param is not None:
        param.setValue(False)
        del param

    del lastNode
    # End of node "Constant1"

    # Start of node "Shufflecopy1"
    lastNode = app.createNode("net.sf.openfx.ShufflePlugin", 2, group)
    lastNode.setScriptName("Shufflecopy1")
    lastNode.setLabel("Shufflecopy1")
    lastNode.setPosition(968, 316)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.6, 0.24, 0.39)
    groupShufflecopy1 = lastNode

    param = lastNode.getParam("outputR")
    if param is not None:
        param.set("B.uk.co.thefoundry.OfxImagePlaneColour.R")
        del param

    param = lastNode.getParam("outputG")
    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.B")
        del param

    del lastNode
    # End of node "Shufflecopy1"

    # Start of node "Premult2"
    lastNode = app.createNode("net.sf.openfx.Premult", 2, group)
    lastNode.setScriptName("Premult2")
    lastNode.setLabel("Premult2")
    lastNode.setPosition(970, 380)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.3, 0.37, 0.776)
    groupPremult2 = lastNode

    del lastNode
    # End of node "Premult2"

    # Start of node "DisableLuma"
    lastNode = app.createNode("net.sf.openfx.switchPlugin", 1, group)
    lastNode.setScriptName("DisableLuma")
    lastNode.setLabel("DisableLuma")
    lastNode.setPosition(1172, 380)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.3, 0.37, 0.776)
    groupDisableLuma = lastNode

    param = lastNode.getParam("which")
    if param is not None:
        param.setValue(0, 0)
        del param

    del lastNode
    # End of node "DisableLuma"

    # Start of node "DisableLuma1"
    lastNode = app.createNode("net.sf.openfx.switchPlugin", 1, group)
    lastNode.setScriptName("DisableLuma1")
    lastNode.setLabel("DisableLuma1")
    lastNode.setPosition(579, 319)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.3, 0.37, 0.776)
    groupDisableLuma1 = lastNode

    param = lastNode.getParam("which")
    if param is not None:
        param.setValue(0, 0)
        del param

    del lastNode
    # End of node "DisableLuma1"

    # Start of node "Dot1"
    lastNode = app.createNode("fr.inria.built-in.Dot", 1, group)
    lastNode.setScriptName("Dot1")
    lastNode.setLabel("Dot1")
    lastNode.setPosition(797, 21)
    lastNode.setSize(15, 15)
    lastNode.setColor(0.7, 0.7, 0.7)
    groupDot1 = lastNode

    del lastNode
    # End of node "Dot1"

    # Start of node "ConstantColor"
    lastNode = app.createNode("net.sf.openfx.switchPlugin", 1, group)
    lastNode.setScriptName("ConstantColor")
    lastNode.setLabel("ConstantColor")
    lastNode.setPosition(758, 448)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.3, 0.37, 0.776)
    groupConstantColor = lastNode

    param = lastNode.getParam("which")
    if param is not None:
        param.setValue(0, 0)
        del param

    del lastNode
    # End of node "ConstantColor"

    # Start of node "Dot2"
    lastNode = app.createNode("fr.inria.built-in.Dot", 1, group)
    lastNode.setScriptName("Dot2")
    lastNode.setLabel("Dot2")
    lastNode.setPosition(243, 443)
    lastNode.setSize(15, 15)
    lastNode.setColor(0.7, 0.7, 0.7)
    groupDot2 = lastNode

    del lastNode
    # End of node "Dot2"

    # Start of node "FGBlur"
    lastNode = app.createNode("net.sf.cimg.CImgBlur", 3, group)
    lastNode.setScriptName("FGBlur")
    lastNode.setLabel("FGBlur")
    lastNode.setPosition(434, 433)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.8, 0.5, 0.3)
    groupFGBlur = 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("NatronOfxParamProcessA")
    if param is not None:
        param.setValue(True)
        del param

    param = lastNode.getParam("size")
    if param is not None:
        param.setValue(1, 0)
        param.setValue(1, 1)
        del param

    param = lastNode.getParam("expandRoD")
    if param is not None:
        param.setValue(False)
        del param

    del lastNode
    # End of node "FGBlur"

    # Start of node "EdgeMerge"
    lastNode = app.createNode("net.sf.openfx.MergePlugin", 1, group)
    lastNode.setScriptName("EdgeMerge")
    lastNode.setLabel("EdgeMerge")
    lastNode.setPosition(434, 545)
    lastNode.setSize(104, 56)
    lastNode.setColor(0.3, 0.37, 0.776)
    groupEdgeMerge = lastNode

    param = lastNode.getParam("NatronOfxParamStringSublabelName")
    if param is not None:
        param.setValue("out")
        del param

    param = lastNode.getParam("operation")
    if param is not None:
        param.set("out")
        del param

    param = lastNode.getParam("AChannelsR")
    if param is not None:
        param.setValue(False)
        del param

    param = lastNode.getParam("AChannelsG")
    if param is not None:
        param.setValue(False)
        del param

    param = lastNode.getParam("AChannelsB")
    if param is not None:
        param.setValue(False)
        del param

    param = lastNode.getParam("OutputChannelsR")
    if param is not None:
        param.setValue(False)
        del param

    param = lastNode.getParam("OutputChannelsG")
    if param is not None:
        param.setValue(False)
        del param

    param = lastNode.getParam("OutputChannelsB")
    if param is not None:
        param.setValue(False)
        del param

    param = lastNode.getParam("userTextArea")
    if param is not None:
        param.setValue("<Natron>(out)</Natron>")
        del param

    del lastNode
    # End of node "EdgeMerge"

    # Start of node "MaskMerge"
    lastNode = app.createNode("net.sf.openfx.MergePlugin", 1, group)
    lastNode.setScriptName("MaskMerge")
    lastNode.setLabel("MaskMerge")
    lastNode.setPosition(758, 545)
    lastNode.setSize(104, 56)
    lastNode.setColor(0.3, 0.37, 0.776)
    groupMaskMerge = lastNode

    param = lastNode.getParam("NatronOfxParamStringSublabelName")
    if param is not None:
        param.setValue("in")
        del param

    param = lastNode.getParam("operation")
    if param is not None:
        param.set("in")
        del param

    param = lastNode.getParam("OutputChannelsA")
    if param is not None:
        param.setValue(False)
        del param

    param = lastNode.getParam("userTextArea")
    if param is not None:
        param.setValue("<Natron>(in)</Natron>")
        del param

    del lastNode
    # End of node "MaskMerge"

    # Start of node "Diffuse"
    lastNode = app.createNode("net.sf.cimg.CImgBlur", 3, group)
    lastNode.setScriptName("Diffuse")
    lastNode.setLabel("Diffuse")
    lastNode.setPosition(758, 633)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.8, 0.5, 0.3)
    groupDiffuse = lastNode

    param = lastNode.getParam("NatronOfxParamProcessA")
    if param is not None:
        param.setValue(True)
        del param

    param = lastNode.getParam("size")
    if param is not None:
        param.setValue(15, 0)
        param.setValue(15, 1)
        del param

    param = lastNode.getParam("expandRoD")
    if param is not None:
        param.setValue(False)
        del param

    del lastNode
    # End of node "Diffuse"

    # Start of node "Intensity"
    lastNode = app.createNode("net.sf.openfx.MultiplyPlugin", 2, group)
    lastNode.setScriptName("Intensity")
    lastNode.setLabel("Intensity")
    lastNode.setPosition(758, 697)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.48, 0.66, 1)
    groupIntensity = lastNode

    param = lastNode.getParam("NatronOfxParamProcessA")
    if param is not None:
        param.setValue(True)
        del param

    param = lastNode.getParam("value")
    if param is not None:
        param.setValue(0, 0)
        param.setValue(0, 1)
        param.setValue(0, 2)
        param.setValue(0, 3)
        del param

    del lastNode
    # End of node "Intensity"

    # Start of node "Saturation1"
    lastNode = app.createNode("net.sf.openfx.SaturationPlugin", 2, group)
    lastNode.setScriptName("Saturation1")
    lastNode.setLabel("Saturation1")
    lastNode.setPosition(758, 761)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.48, 0.66, 1)
    groupSaturation1 = lastNode

    param = lastNode.getParam("clampBlack")
    if param is not None:
        param.setValue(False)
        del param

    del lastNode
    # End of node "Saturation1"

    # Start of node "ColorCorrect1"
    lastNode = app.createNode("net.sf.openfx.ColorCorrectPlugin", 2, group)
    lastNode.setScriptName("ColorCorrect1")
    lastNode.setLabel("ColorCorrect1")
    lastNode.setPosition(758, 825)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.48, 0.66, 1)
    groupColorCorrect1 = lastNode

    param = lastNode.getParam("NatronOfxParamProcessA")
    if param is not None:
        param.setValue(True)
        del param

    param = lastNode.getParam("toneRanges")
    if param is not None:
        param.setCurveColor(0, 0.6, 0.4, 0.6)
        param.deleteAllControlPoints(0)
        param.addControlPoint(0, 0, 1, 0, 0, NatronEngine.Natron.KeyframeTypeEnum.eKeyframeTypeHorizontal)
        param.addControlPoint(0, 0.09, 0, 0, 0, NatronEngine.Natron.KeyframeTypeEnum.eKeyframeTypeHorizontal)
        param.setCurveColor(1, 0.8, 0.7, 0.6)
        param.deleteAllControlPoints(1)
        param.addControlPoint(1, 0.5, 0, 0, 0, NatronEngine.Natron.KeyframeTypeEnum.eKeyframeTypeHorizontal)
        param.addControlPoint(1, 1, 1, 0, 0, NatronEngine.Natron.KeyframeTypeEnum.eKeyframeTypeHorizontal)
        del param

    param = lastNode.getParam("clampBlack")
    if param is not None:
        param.setValue(False)
        del param

    del lastNode
    # End of node "ColorCorrect1"

    # Start of node "MaskMerge2"
    lastNode = app.createNode("net.sf.openfx.MergePlugin", 1, group)
    lastNode.setScriptName("MaskMerge2")
    lastNode.setLabel("MaskMerge2")
    lastNode.setPosition(761, 909)
    lastNode.setSize(104, 56)
    lastNode.setColor(0.3, 0.37, 0.776)
    groupMaskMerge2 = lastNode

    param = lastNode.getParam("NatronOfxParamStringSublabelName")
    if param is not None:
        param.setValue("mask")
        del param

    param = lastNode.getParam("operation")
    if param is not None:
        param.set("mask")
        del param

    param = lastNode.getParam("userTextArea")
    if param is not None:
        param.setValue("<Natron>(mask)</Natron>")
        del param

    del lastNode
    # End of node "MaskMerge2"

    # Start of node "Shuffle1"
    lastNode = app.createNode("net.sf.openfx.ShufflePlugin", 2, group)
    lastNode.setScriptName("Shuffle1")
    lastNode.setLabel("Shuffle1")
    lastNode.setPosition(761, 1026)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.6, 0.24, 0.39)
    groupShuffle1 = lastNode

    param = lastNode.getParam("outputA")
    if param is not None:
        param.set("0")
        del param

    del lastNode
    # End of node "Shuffle1"

    # Start of node "HighlightMerge"
    lastNode = app.createNode("net.sf.openfx.MergePlugin", 1, group)
    lastNode.setScriptName("HighlightMerge")
    lastNode.setLabel("HighlightMerge")
    lastNode.setPosition(761, 1108)
    lastNode.setSize(104, 56)
    lastNode.setColor(0.3, 0.37, 0.776)
    groupHighlightMerge = lastNode

    param = lastNode.getParam("NatronOfxParamStringSublabelName")
    if param is not None:
        param.setValue("plus")
        del param

    param = lastNode.getParam("operation")
    if param is not None:
        param.set("plus")
        del param

    param = lastNode.getParam("userTextArea")
    if param is not None:
        param.setValue("<Natron>(plus)</Natron>")
        del param

    del lastNode
    # End of node "HighlightMerge"

    # Start of node "Dot4"
    lastNode = app.createNode("fr.inria.built-in.Dot", 1, group)
    lastNode.setScriptName("Dot4")
    lastNode.setLabel("Dot4")
    lastNode.setPosition(806, 1218)
    lastNode.setSize(15, 15)
    lastNode.setColor(0.7, 0.7, 0.7)
    groupDot4 = lastNode

    del lastNode
    # End of node "Dot4"

    # Start of node "Input2"
    lastNode = app.createNode("fr.inria.built-in.Input", 1, group)
    lastNode.setScriptName("Input2")
    lastNode.setLabel("B")
    lastNode.setPosition(753, -43)
    lastNode.setSize(104, 34)
    lastNode.setColor(0.3, 0.5, 0.2)
    groupInput2 = lastNode

    del lastNode
    # End of node "Input2"

    # Now that all nodes are created we can connect them together, restore expressions
    groupOutput1.connectInput(0, groupDot4)
    groupKeyer1.connectInput(0, groupDot1)
    groupPremult1.connectInput(0, groupKeyer1)
    groupBGBlur.connectInput(0, groupPremult1)
    groupShufflecopy1.connectInput(0, groupConstant1)
    groupShufflecopy1.connectInput(1, groupBGBlur)
    groupPremult2.connectInput(0, groupShufflecopy1)
    groupDisableLuma.connectInput(0, groupPremult2)
    groupDisableLuma.connectInput(1, groupConstant1)
    groupDisableLuma1.connectInput(0, groupBGBlur)
    groupDisableLuma1.connectInput(1, groupKeyer1)
    groupDot1.connectInput(0, groupInput2)
    groupConstantColor.connectInput(0, groupDisableLuma1)
    groupConstantColor.connectInput(1, groupDisableLuma)
    groupDot2.connectInput(0, groupInput1)
    groupFGBlur.connectInput(0, groupDot2)
    groupEdgeMerge.connectInput(0, groupFGBlur)
    groupEdgeMerge.connectInput(1, groupDot2)
    groupMaskMerge.connectInput(0, groupEdgeMerge)
    groupMaskMerge.connectInput(1, groupConstantColor)
    groupDiffuse.connectInput(0, groupMaskMerge)
    groupIntensity.connectInput(0, groupDiffuse)
    groupSaturation1.connectInput(0, groupIntensity)
    groupColorCorrect1.connectInput(0, groupSaturation1)
    groupMaskMerge2.connectInput(0, groupColorCorrect1)
    groupMaskMerge2.connectInput(1, groupDot2)
    groupShuffle1.connectInput(1, groupMaskMerge2)
    groupHighlightMerge.connectInput(0, groupShuffle1)
    groupHighlightMerge.connectInput(1, groupDot2)
    groupDot4.connectInput(0, groupHighlightMerge)

    param = groupKeyer1.getParam("softnessLower")
    param.setExpression("thisGroup.lumaTolerance.getValue() - 1", False, 0)
    del param
    param = groupBGBlur.getParam("size")
    group.getParam("bgblur").setAsAlias(param)
    del param
    param = groupConstant1.getParam("color")
    group.getParam("constantcolor").setAsAlias(param)
    del param
    param = groupDisableLuma.getParam("which")
    param.setExpression("thisGroup.disableLuma.getValue()", False, 0)
    del param
    param = groupDisableLuma1.getParam("which")
    param.setExpression("thisGroup.disableLuma.getValue()", False, 0)
    del param
    param = groupConstantColor.getParam("which")
    param.setExpression("thisGroup.useConstant.getValue()", False, 0)
    del param
    param = groupFGBlur.getParam("size")
    group.getParam("fgblur").setAsAlias(param)
    del param
    param = groupFGBlur.getParam("boundary")
    group.getParam("fgblurBoundary").setAsAlias(param)
    del param
    param = groupDiffuse.getParam("size")
    group.getParam("diffuse").setAsAlias(param)
    del param
    param = groupIntensity.getParam("value")
    param.setExpression("thisGroup.intensity.getValue()", False, 0)
    param.setExpression("thisGroup.intensity.getValue()", False, 1)
    param.setExpression("thisGroup.intensity.getValue()", False, 2)
    param.setExpression("thisGroup.intensity.getValue()", False, 3)
    del param
    param = groupSaturation1.getParam("saturation")
    group.getParam("saturation").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("MasterSaturation")
    group.getParam("ColorCorrect1MasterSaturation").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("MasterContrast")
    group.getParam("ColorCorrect1MasterContrast").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("MasterGamma")
    group.getParam("ColorCorrect1MasterGamma").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("MasterGain")
    group.getParam("ColorCorrect1MasterGain").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("MasterOffset")
    group.getParam("ColorCorrect1MasterOffset").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("ShadowsEnable")
    group.getParam("ColorCorrect1ShadowsEnable").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("ShadowsSaturation")
    group.getParam("ColorCorrect1ShadowsSaturation").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("ShadowsContrast")
    group.getParam("ColorCorrect1ShadowsContrast").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("ShadowsGamma")
    group.getParam("ColorCorrect1ShadowsGamma").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("ShadowsGain")
    group.getParam("ColorCorrect1ShadowsGain").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("ShadowsOffset")
    group.getParam("ColorCorrect1ShadowsOffset").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("MidtonesEnable")
    group.getParam("ColorCorrect1MidtonesEnable").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("MidtonesSaturation")
    group.getParam("ColorCorrect1MidtonesSaturation").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("MidtonesContrast")
    group.getParam("ColorCorrect1MidtonesContrast").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("MidtonesGamma")
    group.getParam("ColorCorrect1MidtonesGamma").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("MidtonesGain")
    group.getParam("ColorCorrect1MidtonesGain").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("MidtonesOffset")
    group.getParam("ColorCorrect1MidtonesOffset").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("HighlightsEnable")
    group.getParam("ColorCorrect1HighlightsEnable").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("HighlightsSaturation")
    group.getParam("ColorCorrect1HighlightsSaturation").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("HighlightsContrast")
    group.getParam("ColorCorrect1HighlightsContrast").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("HighlightsGamma")
    group.getParam("ColorCorrect1HighlightsGamma").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("HighlightsGain")
    group.getParam("ColorCorrect1HighlightsGain").setAsAlias(param)
    del param
    param = groupColorCorrect1.getParam("HighlightsOffset")
    group.getParam("ColorCorrect1HighlightsOffset").setAsAlias(param)
    del param
    param = groupMaskMerge2.getParam("disableNode")
    group.getParam("enableGlow").setAsAlias(param)
    del param
    param = groupHighlightMerge.getParam("operation")
    group.getParam("highlightmerge").setAsAlias(param)
    del param
    param = groupHighlightMerge.getParam("disableNode")
    group.getParam("onlyWrap").setAsAlias(param)
    del param

    try:
        extModule = sys.modules["LightWrapExt"]
    except KeyError:
        extModule = None
    if extModule is not None and hasattr(extModule ,"createInstanceExt") and hasattr(extModule.createInstanceExt,"__call__"):
        extModule.createInstanceExt(app,group)
