- Posts: 177
- Joined: Fri Mar 11, 2016 11:16 pm
First, you'll need to reposition the Tracker's Unstable Position. The value at the reference frame is (0.5, 0.5), which is inconvenient for multiplication, so reset it to (0,0). So first, Connect Point In 1 to the Tracker's Unsteady Position.
Next, set an expression on Point In 2 that subtracts 0.5 from Point In 1:
Point(PointIn1.X-0.5, PointIn1.Y-0.5)
Point In 3 gets your multiplier:
Point(PointIn2.X * NumberIn1, PointIn2.Y * NumberIn1)
Finally, Point In 4 moves the reference frame back to (0.5, 0.5):
Point(PointIn3.X + 0.5, PointIn3.Y + 0.5)
You can then use an expression to read PointIn4 on any Center control where you wish to use it. This is how FlexiTrack works.
You could, of course, do it all in one go with a long expression, but it gets confusing and difficult to troubleshoot.
- Code: Select all
{
Tools = ordered() {
Tracker1 = Tracker {
Trackers = {
{
PatternTime = 0,
PatternX = 0.5390625,
PatternY = 0.305555555555556
}
},
CtrlWZoom = false,
Inputs = {
Name1 = Input { Value = "Tracker 1", },
PatternCenter1 = Input { Value = { 0.5390625, 0.305555555555556 }, },
TrackedCenter1 = Input {
SourceOp = "Tracker1Tracker1Path",
Source = "Position",
},
},
ViewInfo = OperatorInfo { Pos = { 550, 16.5 } },
},
Tracker1Tracker1Path = PolyPath {
ShowKeyPoints = false,
ShowHandles = false,
DrawMode = "ModifyOnly",
CtrlWZoom = false,
NameSet = true,
Inputs = {
Displacement = Input {
SourceOp = "Path1Displacement",
Source = "Value",
},
PolyLine = Input {
Value = Polyline {
Points = {
{ Linear = true, LockY = true, X = 0.0390625000000001, Y = -0.194444444444444, RX = -1.62760416666889e-05, RY = -2.89351851851897e-05 },
{ Linear = true, LockY = true, X = 0.039013671875, Y = -0.19453125, LX = 1.62760416666889e-05, LY = 2.89351851851897e-05 }
}
},
},
},
},
Path1Displacement = BezierSpline {
SplineColor = { Red = 255, Green = 0, Blue = 255 },
NameSet = true,
KeyFrames = {
[0.513719956429306] = { 0, RH = { 0.847053289762639, 0.333333333333333 }, Flags = { Linear = true, LockedY = true } },
[1.51371995642931] = { 1, LH = { 1.18038662309597, 0.666666666666667 }, Flags = { Linear = true, LockedY = true } }
}
},
CustomTool1 = Custom {
Inputs = {
PointIn1 = Input {
SourceOp = "Tracker1",
Source = "UnsteadyPosition",
},
PointIn2 = Input {
Value = { -0.018609619140625, 0.0965928819444445 },
Expression = "Point(PointIn1.X-0.5, PointIn1.Y-0.5)",
},
PointIn3 = Input {
Value = { -0.0148504760742187, 0.0770811197916667 },
Expression = "Point(PointIn2.X * NumberIn1, PointIn2.Y * NumberIn1)",
},
PointIn4 = Input {
SourceOp = "Publish1",
Source = "Value",
Expression = "Point(PointIn3.X+0.5, PointIn3.Y+0.5)",
},
NumberIn1 = Input { Value = 0.798, },
LUTIn1 = Input {
SourceOp = "CustomTool1LUTIn1",
Source = "Value",
},
LUTIn2 = Input {
SourceOp = "CustomTool1LUTIn2",
Source = "Value",
},
LUTIn3 = Input {
SourceOp = "CustomTool1LUTIn3",
Source = "Value",
},
LUTIn4 = Input {
SourceOp = "CustomTool1LUTIn4",
Source = "Value",
},
},
ViewInfo = OperatorInfo { Pos = { 550, 49.5 } },
},
Publish1 = PublishPoint {
},
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 },
NameSet = true,
},
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 },
NameSet = true,
},
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 },
NameSet = true,
},
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 },
NameSet = true,
},
Transform1 = Transform {
Inputs = {
Center = Input {
Value = { 0.503151611328125, 0.499497178819444 },
Expression = "CustomTool1.PointIn4",
},
InvertTransform = Input { Value = 1, },
},
ViewInfo = OperatorInfo { Pos = { 550, 82.5 } },
}
}
}