aŋ
i
nfo
m
acros
CT_Regrain
Based on Emilio Sapia - Millolab's ReGrain design with some changes & a built in PlatePreserver from Joe Laude Muse Tools Library.
.
s
etting/
M
acro:
Copy
--[[-- Written by : Nguyen Tuan An Written on : Jan, 2024 Version 1.0 --]]-- { Tools = ordered() { CT_Regrain = GroupOperator { CtrlWZoom = false, CustomData = { Path = { Map = { ["Setting:"] = "Macros:\\" } }, }, Inputs = ordered() { MainInput1 = InstanceInput { SourceOp = "PipeRouter1", Source = "Input", Name = "Plate", }, MainInput2 = InstanceInput { SourceOp = "PipeRouter3", Source = "Input", Name = "Denoised", }, MainInput3 = InstanceInput { SourceOp = "PipeRouter2", Source = "Input", Name = "Comp", }, Input1 = InstanceInput { SourceOp = "TimeStretcher1", Source = "SourceTime", Default = 0, }, Input2 = InstanceInput { SourceOp = "Rectangle1", Source = "Center", }, Input3 = InstanceInput { SourceOp = "Rectangle1", Source = "Width", Default = 0.035, }, Input4 = InstanceInput { SourceOp = "Rectangle1", Source = "Height", Default = 0.045, }, Dropdown = InstanceInput { SourceOp = "CustomTool1", Source = "Bonus", Page = "Controls", Default = 0, }, Input5 = InstanceInput { SourceOp = "CustomTool1", Source = "Size", Page = "Controls", Default = 1, }, Input6 = InstanceInput { SourceOp = "CustomTool1", Source = "Gain", Page = "Controls", Default = 2, }, Input7 = InstanceInput { SourceOp = "CustomTool1", Source = "Red", Page = "Controls", Default = 0, }, Input8 = InstanceInput { SourceOp = "CustomTool1", Source = "Green", Page = "Controls", Default = 0, }, Input9 = InstanceInput { SourceOp = "CustomTool1", Source = "Blue", Page = "Controls", Default = 0, }, Input11 = InstanceInput { SourceOp = "CustomTool1", Source = "Blur", Page = "Controls", Default = 0.2, }, Input10 = InstanceInput { SourceOp = "CustomTool1", Source = "OutputCheck", Page = "Controls", Default = 0, }, }, Outputs = { MainOutput1 = InstanceOutput { SourceOp = "Merge2", Source = "Output", } }, ViewInfo = GroupInfo { Pos = { 70.6667, 152.818 }, Flags = { AllowPan = false, AutoSnap = true, RemoveRouters = true }, Size = { 864.221, 332.279, 432.11, 24.2424 }, Direction = "Horizontal", PipeStyle = "Direct", Scale = 1, Offset = { 0, 0 } }, Tools = ordered() { PipeRouter1 = PipeRouter { CtrlWShown = false, ViewInfo = PipeRouterInfo { Pos = { 378.993, 8.80008 } }, }, PipeRouter3 = PipeRouter { CtrlWShown = false, ViewInfo = PipeRouterInfo { Pos = { 252.464, 27.7931 } }, }, PipeRouter2 = PipeRouter { CtrlWShown = false, ViewInfo = PipeRouterInfo { Pos = { 25.4737, 56.1841 } }, }, TimeStretcher1 = TimeStretcher { CtrlWShown = false, Inputs = { SourceTime = Input { Value = 0, }, Input = Input { SourceOp = "CustomTool1", Source = "Output", }, }, ViewInfo = OperatorInfo { Pos = { -274.341, 93.7931 } }, }, Rectangle1 = RectangleMask { CtrlWShown = false, Inputs = { Filter = Input { Value = FuID { "Fast Gaussian" }, }, MaskWidth = Input { Value = 4096, }, MaskHeight = Input { Value = 2160, }, PixelAspect = Input { Value = { 1, 1 }, }, ClippingMode = Input { Value = FuID { "None" }, }, Width = Input { Value = 0.035, }, Height = Input { Value = 0.045, }, }, ViewInfo = OperatorInfo { Pos = { -379.213, 162.678 } }, }, CustomTool1 = Custom { CtrlWZoom = false, CtrlWShown = false, NameSet = true, Inputs = { NumberIn1 = Input { Value = 2, Expression = "Gain+Red", }, NumberIn2 = Input { Value = 2, Expression = "Gain+Green", }, NumberIn3 = Input { Value = 2, Expression = "Gain+Blue", }, LUTIn1 = Input { SourceOp = "CustomTool1LUTIn1", Source = "Value", }, LUTIn2 = Input { SourceOp = "CustomTool1LUTIn2", Source = "Value", }, LUTIn3 = Input { SourceOp = "CustomTool1LUTIn3", Source = "Value", }, LUTIn4 = Input { SourceOp = "CustomTool1LUTIn4", Source = "Value", }, RedExpression = Input { Value = "(c2-c1)*n1", }, GreenExpression = Input { Value = "(c2-c1)*n2", }, BlueExpression = Input { Value = "(c2-c1)*n3", }, Image1 = Input { SourceOp = "PipeRouter3", Source = "Output", }, Image2 = Input { SourceOp = "PipeRouter1", Source = "Output", }, Bonus = Input { Value = 0, }, Gain = Input { Value = 2, }, Blur = Input { Value = 0.2, }, }, ViewInfo = OperatorInfo { Pos = { -251.933, 8.80008 } }, UserControls = ordered() { Bonus = { INP_MaxAllowed = 1000000, INP_Integer = false, LBLC_DropDownButton = true, INPID_InputControl = "LabelControl", LBLC_NumInputs = 7, INP_MaxScale = 1, INP_Default = 0, INP_MinScale = 0, INP_MinAllowed = -1000000, LINKID_DataType = "Number", INP_Passive = true, ICS_ControlPage = "Controls", LINKS_Name = "Bonus" }, Size = { INP_MaxAllowed = 5, INP_Integer = false, INPID_InputControl = "SliderControl", INP_MaxScale = 5, INP_Default = 1, INP_MinScale = 0, INP_MinAllowed = 0, LINKID_DataType = "Number", ICS_ControlPage = "Controls", LINKS_Name = "Size" }, Gain = { INP_MaxAllowed = 5, INP_Integer = false, INPID_InputControl = "SliderControl", INP_MaxScale = 5, INP_Default = 1, INP_MinScale = 0, INP_MinAllowed = 0, LINKID_DataType = "Number", ICS_ControlPage = "Controls", LINKS_Name = "Gain" }, Red = { INP_MaxAllowed = 5, INP_Integer = false, INPID_InputControl = "SliderControl", INP_MaxScale = 5, INP_Default = 0, INP_MinScale = 0, INP_MinAllowed = 0, LINKID_DataType = "Number", ICS_ControlPage = "Controls", LINKS_Name = "Red" }, Green = { INP_MaxAllowed = 5, INP_Integer = false, INPID_InputControl = "SliderControl", INP_MaxScale = 5, INP_Default = 0, INP_MinScale = 0, INP_MinAllowed = 0, LINKID_DataType = "Number", ICS_ControlPage = "Controls", LINKS_Name = "Green" }, Blue = { INP_MaxAllowed = 5, INP_Integer = false, INPID_InputControl = "SliderControl", INP_MaxScale = 5, INP_Default = 0, INP_MinScale = 0, INP_MinAllowed = 0, LINKID_DataType = "Number", ICS_ControlPage = "Controls", LINKS_Name = "Blue" }, OutputCheck = { INP_MaxAllowed = 1000000, INP_Integer = false, INPID_InputControl = "CheckboxControl", INP_MaxScale = 1, INP_Default = 0, INP_MinScale = 0, INP_MinAllowed = -1000000, LINKID_DataType = "Number", ICS_ControlPage = "Controls", CBC_TriState = false, LINKS_Name = "OutputCheck" }, Blur = { INP_MaxAllowed = 1, INP_Integer = false, INPID_InputControl = "SliderControl", INP_MaxScale = 1, INP_Default = 0.100000001490116, INP_MinScale = 0, INP_MinAllowed = 0, LINKID_DataType = "Number", ICS_ControlPage = "Controls", LINKS_Name = "Blur" } } }, CustomTool1LUTIn1 = LUTBezier { KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, SplineColor = { Red = 204, Green = 0, Blue = 0 }, CtrlWZoom = false, }, CustomTool1LUTIn2 = LUTBezier { KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, SplineColor = { Red = 0, Green = 204, Blue = 0 }, CtrlWZoom = false, }, CustomTool1LUTIn3 = LUTBezier { KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, SplineColor = { Red = 0, Green = 0, Blue = 204 }, CtrlWZoom = false, }, CustomTool1LUTIn4 = LUTBezier { KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, SplineColor = { Red = 204, Green = 204, Blue = 204 }, CtrlWZoom = false, }, Blur2 = Blur { CtrlWShown = false, Inputs = { Filter = Input { Value = FuID { "Fast Gaussian" }, }, XBlurSize = Input { Value = 0.2, Expression = "CustomTool1.Blur", }, Input = Input { SourceOp = "Texture1", Source = "Output", }, }, ViewInfo = OperatorInfo { Pos = { -145.674, 274.715 } }, }, Texture1 = Texture { CtrlWShown = false, Inputs = { Input = Input { SourceOp = "ColorSpace1", Source = "Output", }, Texture = Input { SourceOp = "Crop2", Source = "Output", }, }, ViewInfo = OperatorInfo { Pos = { -145.674, 225.793 } }, }, Crop2 = Crop { CtrlWShown = false, Inputs = { XSize = Input { Value = 2048, Expression = "TimeStretcher1.Input.OriginalWidth", }, YSize = Input { Value = 1080, Expression = "TimeStretcher1.Input.OriginalHeight", }, Input = Input { SourceOp = "Transform1", Source = "Output", }, }, ViewInfo = OperatorInfo { Pos = { -274.341, 225.793 } }, }, CustomTool2 = Custom { CtrlWShown = false, Inputs = { LUTIn1 = Input { SourceOp = "CustomTool2LUTIn1", Source = "Value", }, LUTIn2 = Input { SourceOp = "CustomTool2LUTIn2", Source = "Value", }, LUTIn3 = Input { SourceOp = "CustomTool2LUTIn3", Source = "Value", }, LUTIn4 = Input { SourceOp = "CustomTool2LUTIn4", Source = "Value", }, RedExpression = Input { Value = "if((r1==r2)&&(g1==g2)&&(b1==b2),0,c2+c3)", }, GreenExpression = Input { Value = "if((r1==r2)&&(g1==g2)&&(b1==b2),0,c2+c3)", }, BlueExpression = Input { Value = "if((r1==r2)&&(g1==g2)&&(b1==b2),0,c2+c3)", }, AlphaExpression = Input { Value = "if((r1==r2)&&(g1==g2)&&(b1==b2),0,c2+c3)", }, Image1 = Input { SourceOp = "PipeRouter3", Source = "Output", }, Image2 = Input { SourceOp = "PipeRouter2", Source = "Output", }, Image3 = Input { SourceOp = "Blur2", Source = "Output", }, }, ViewInfo = OperatorInfo { Pos = { 45.9057, 274.715 } }, }, CustomTool2LUTIn1 = LUTBezier { KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, SplineColor = { Red = 204, Green = 0, Blue = 0 }, CtrlWZoom = false, }, CustomTool2LUTIn2 = LUTBezier { KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, SplineColor = { Red = 0, Green = 204, Blue = 0 }, CtrlWZoom = false, }, CustomTool2LUTIn3 = LUTBezier { KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, SplineColor = { Red = 0, Green = 0, Blue = 204 }, CtrlWZoom = false, }, CustomTool2LUTIn4 = LUTBezier { KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, SplineColor = { Red = 204, Green = 204, Blue = 204 }, CtrlWZoom = false, }, Transform1 = Transform { CtrlWShown = false, Inputs = { Size = Input { Value = 1.4, Expression = "CustomTool1.Size", }, Edges = Input { Value = 1, }, Input = Input { SourceOp = "Crop2_1", Source = "Output", }, }, ViewInfo = OperatorInfo { Pos = { -274.341, 192.793 } }, }, Crop2_1 = Crop { CtrlWShown = false, Inputs = { XOffset = Input { Value = 988, Expression = "Rectangle1.Center.X*(Crop2_1.Input.OriginalWidth)-XSize/2", }, YOffset = Input { Value = 1000, Expression = "Rectangle1.Center.Y*(Crop2_1.Input.OriginalWidth)-YSize/2", }, XSize = Input { Value = 72, Expression = "Crop2_1.Input.OriginalWidth*Rectangle1.Width", }, YSize = Input { Value = 49, Expression = "Crop2_1.Input.OriginalHeight*Rectangle1.Height", }, Input = Input { SourceOp = "TimeStretcher1", Source = "Output", }, }, ViewInfo = OperatorInfo { Pos = { -274.341, 160.715 } }, }, ColorSpace1 = ColorSpace { CtrlWShown = false, Inputs = { ColorSpaceConversion = Input { Value = 1, }, ColorType = Input { Value = 3, }, Input = Input { SourceOp = "CreateBumpMap1", Source = "Output", }, }, ViewInfo = OperatorInfo { Pos = { -145.674, 160.65 } }, }, Merge2 = Merge { CtrlWShown = false, Inputs = { Background = Input { SourceOp = "PipeRouter1", Source = "Output", }, Foreground = Input { SourceOp = "CustomTool2", Source = "Output", }, Operator = Input { Expression = "iif(CustomTool1.OutputCheck==1,\"In\",\"Over\")", }, PerformDepthMerge = Input { Value = 0, }, }, ViewInfo = OperatorInfo { Pos = { 367.07, 274.715 } }, }, CreateBumpMap1 = CreateBumpMap { CtrlWShown = false, Inputs = { Input = Input { SourceOp = "CustomTool1", Source = "Output", }, HeightScale = Input { Value = 10, }, }, ViewInfo = OperatorInfo { Pos = { -145.674, 93.7931 } }, } }, Colors = { TileColor = { R = 0.725490196078431, G = 0.690196078431373, B = 0.592156862745098 }, } } }, ActiveTool = "Regrain_CustomTool" }