The text() turns everything into a string so the Text+ tool can display it as such. But you can't subtract two strings like numbers. So just get rid of the Text() functions inside the iif.
Try something like this:
Text(iif(Text1.StyledText.Value-Text2.StyledText.Value < 0, 0, Text1.StyledText.Value-Text2.StyledText.Value))
-
Code:
Select all
-
{
Tools = ordered() {
Text2 = TextPlus {
NameSet = true,
Inputs = {
GlobalIn = Input { Value = 1, },
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
StyledText = Input {
Value = "-13",
Expression = "Text(-time+10)",
},
Font = Input { Value = "Open Sans", },
Style = Input { Value = "Bold", },
VerticalJustificationNew = Input { Value = 3, },
HorizontalJustificationNew = Input { Value = 3, },
ManualFontKerningPlacement = Input {
Value = StyledText {
Array = {
},
Value = ""
},
},
},
ViewInfo = OperatorInfo { Pos = { 725.333, 192.818 } },
},
Text1 = TextPlus {
CtrlWZoom = false,
Inputs = {
GlobalIn = Input { Value = 1, },
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
StyledText = Input {
Value = "23",
Expression = "Text(time)",
},
Font = Input { Value = "Open Sans", },
Style = Input { Value = "Bold", },
VerticalJustificationNew = Input { Value = 3, },
HorizontalJustificationNew = Input { Value = 3, },
ManualFontKerningPlacement = Input {
Value = StyledText {
Array = {
},
Value = ""
},
},
},
ViewInfo = OperatorInfo { Pos = { 570, 193.424 } },
},
Text3 = TextPlus {
Inputs = {
GlobalIn = Input { Value = 1, },
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
StyledText = Input {
Value = "36",
Expression = "Text(iif(Text1.StyledText.Value-Text2.StyledText.Value < 0, 0, Text1.StyledText.Value-Text2.StyledText.Value))",
},
Font = Input { Value = "Open Sans", },
Style = Input { Value = "Bold", },
VerticalJustificationNew = Input { Value = 3, },
HorizontalJustificationNew = Input { Value = 3, },
ManualFontKerningPlacement = Input {
Value = StyledText {
Array = {
},
Value = ""
},
},
},
ViewInfo = OperatorInfo { Pos = { 938.667, 184.939 } },
},
Merge2 = Merge {
Inputs = {
Background = Input {
SourceOp = "Merge1",
Source = "Output",
},
Foreground = Input {
SourceOp = "Text3",
Source = "Output",
},
Center = Input { Value = { 0.634375, 0.5 }, },
PerformDepthMerge = Input { Value = 0, },
},
ViewInfo = OperatorInfo { Pos = { 938.667, 355.515 } },
},
Merge1 = Merge {
Inputs = {
Background = Input {
SourceOp = "Text2",
Source = "Output",
},
Foreground = Input {
SourceOp = "Text1",
Source = "Output",
},
Center = Input { Value = { 0.3546875, 0.5 }, },
PerformDepthMerge = Input { Value = 0, },
},
ViewInfo = OperatorInfo { Pos = { 725.333, 355.515 } },
}
}
}
Or if you want to have better access to Lua then use the ":". This has the benefit of being a little easier to debug.
Same setup, only added another Text+:
: x = Text1.StyledText.Value-Text2.StyledText.Value if x < 0 then return 0 else return x end
-
Code:
Select all
-
{
Tools = ordered() {
Text1 = TextPlus {
Inputs = {
GlobalIn = Input { Value = 1, },
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
StyledText = Input {
Value = "23",
Expression = "Text(time)",
},
Font = Input { Value = "Open Sans", },
Style = Input { Value = "Bold", },
VerticalJustificationNew = Input { Value = 3, },
HorizontalJustificationNew = Input { Value = 3, },
ManualFontKerningPlacement = Input {
Value = StyledText {
Array = {
},
Value = ""
},
},
},
ViewInfo = OperatorInfo { Pos = { 570, 193.424 } },
},
Text2 = TextPlus {
NameSet = true,
Inputs = {
GlobalIn = Input { Value = 1, },
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
StyledText = Input {
Value = "-13",
Expression = "Text(-time+10)",
},
Font = Input { Value = "Open Sans", },
Style = Input { Value = "Bold", },
VerticalJustificationNew = Input { Value = 3, },
HorizontalJustificationNew = Input { Value = 3, },
ManualFontKerningPlacement = Input {
Value = StyledText {
Array = {
},
Value = ""
},
},
},
ViewInfo = OperatorInfo { Pos = { 725.333, 192.818 } },
},
Text3 = TextPlus {
Inputs = {
GlobalIn = Input { Value = 1, },
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
StyledText = Input {
Value = "36",
Expression = "Text(iif(Text1.StyledText.Value-Text2.StyledText.Value < 0, 0, Text1.StyledText.Value-Text2.StyledText.Value))",
},
Font = Input { Value = "Open Sans", },
Style = Input { Value = "Bold", },
VerticalJustificationNew = Input { Value = 3, },
HorizontalJustificationNew = Input { Value = 3, },
ManualFontKerningPlacement = Input {
Value = StyledText {
Array = {
},
Value = ""
},
},
},
ViewInfo = OperatorInfo { Pos = { 938.667, 184.939 } },
},
Text3_1 = TextPlus {
CtrlWZoom = false,
Inputs = {
GlobalIn = Input { Value = 1, },
Width = Input { Value = 1920, },
Height = Input { Value = 1080, },
["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
StyledText = Input {
Value = "32",
Expression = ": x = Text1.StyledText.Value-Text2.StyledText.Value if x < 0 then return 0 else return x end",
},
Font = Input { Value = "Open Sans", },
Style = Input { Value = "Bold", },
VerticalJustificationNew = Input { Value = 3, },
HorizontalJustificationNew = Input { Value = 3, },
ManualFontKerningPlacement = Input {
Value = StyledText {
Array = {
},
Value = ""
},
},
},
ViewInfo = OperatorInfo { Pos = { 1117.33, 174.03 } },
},
Merge3 = Merge {
Inputs = {
Background = Input {
SourceOp = "Merge2",
Source = "Output",
},
Foreground = Input {
SourceOp = "Text3_1",
Source = "Output",
},
Center = Input { Value = { 0.738541666666667, 0.5 }, },
PerformDepthMerge = Input { Value = 0, },
},
ViewInfo = OperatorInfo { Pos = { 1117.33, 355.515 } },
},
Merge2 = Merge {
Inputs = {
Background = Input {
SourceOp = "Merge1",
Source = "Output",
},
Foreground = Input {
SourceOp = "Text3",
Source = "Output",
},
Center = Input { Value = { 0.634375, 0.5 }, },
PerformDepthMerge = Input { Value = 0, },
},
ViewInfo = OperatorInfo { Pos = { 938.667, 355.515 } },
},
Merge1 = Merge {
Inputs = {
Background = Input {
SourceOp = "Text2",
Source = "Output",
},
Foreground = Input {
SourceOp = "Text1",
Source = "Output",
},
Center = Input { Value = { 0.3546875, 0.5 }, },
PerformDepthMerge = Input { Value = 0, },
},
ViewInfo = OperatorInfo { Pos = { 725.333, 355.515 } },
}
}
}
UserNoah wrote:
The text() turns everything into a string so the Text+ tool can display it as such. But you can't subtract two strings like numbers. So just get rid of the Text() functions inside the iif.
Try something like this:
Text(iif(Text1.StyledText.Value-Text2.StyledText.Value < 0, 0, Text1.StyledText.Value-Text2.StyledText.Value))
Thank You so much
, that worked perfectly.
You are awesome
.
All items on this website are copyright Blackmagic Design Pty. Ltd. 2019, all rights reserved. All trademarks are property of their respective owners.
For questions about the forum, please contact the
forum administrators
.
Powered by
phpBB
® Forum Software © phpBB Group.