Page 1 of 1

2d tracker from 3d locator (SOLVED)

PostPosted: Mon Jan 19, 2015 1:31 pm
by Kyriakos Rissakis
Hi, i have a simple but important question.
If i have a solved camera and a static
3d Locator how do i transfer locator's 2d
translation on the renderer's view to a
tracker for matchmoving ,corner pining etc?

Re: 2d tracker from 3d locator.

PostPosted: Mon Jan 19, 2015 2:03 pm
by Eric Westphal
Hi Kyriakos.

The trick is to add a 3DLocator, which transfers any 3D location
to 2D X/Y Coordinates.
You can RMB on any point in your PointCloud and select
PointCloud -> Create Locator.

In the locator itself you have to define the camera you are rendering your scene with
as well as the resolution of the rendere image to achieve the correct result.

Code: Select all
{
   Tools = ordered() {
      Camera3D1 = Camera3D {
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input {
               SourceOp = "Camera3D1XOffset",
               Source = "Value",
            },
            ["Transform3DOp.Translate.Y"] = Input {
               SourceOp = "Camera3D1YOffset",
               Source = "Value",
            },
            ["Transform3DOp.Translate.Z"] = Input {
               SourceOp = "Camera3D1ZOffset",
               Source = "Value",
            },
            ["Transform3DOp.Rotate.X"] = Input {
               SourceOp = "Camera3D1XRotation",
               Source = "Value",
            },
            ["Transform3DOp.Rotate.Y"] = Input {
               SourceOp = "Camera3D1YRotation",
               Source = "Value",
            },
            ["Transform3DOp.Rotate.Z"] = Input {
               SourceOp = "Camera3D1ZRotation",
               Source = "Value",
            },
            FLength = Input { Value = 18.2123442718302, },
            ["Stereo.Mode"] = Input { Value = FuID { "Mono", }, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 3, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 2, },
         },
         ViewInfo = OperatorInfo { Pos = { 440, 82.5, }, },
      },
      Camera3D1XOffset = BezierSpline {
         SplineColor = { Red = 250, Green = 59, Blue = 49, },
         NameSet = true,
         KeyFrames = {
            [0] = { 1.19012571830465, RH = { 33.3333333333333, 0.892105545681506, }, Flags = { Linear = true, }, },
            [100] = { 0.296065200435218, LH = { 66.6666666666667, 0.594085373058362, }, Flags = { Linear = true, }, },
         },
      },
      Camera3D1YOffset = BezierSpline {
         SplineColor = { Red = 252, Green = 131, Blue = 47, },
         NameSet = true,
         KeyFrames = {
            [0] = { 2.25341052978214, RH = { 33.3333333333333, 1.73061481542768, }, Flags = { Linear = true, }, },
            [100] = { 0.685023386718751, LH = { 66.6666666666667, 1.20781910107321, }, Flags = { Linear = true, }, },
         },
      },
      Camera3D1ZOffset = BezierSpline {
         SplineColor = { Red = 254, Green = 207, Blue = 46, },
         NameSet = true,
         KeyFrames = {
            [0] = { 3.28299600903452, RH = { 33.3333333333333, 3.29879147288646, }, Flags = { Linear = true, }, },
            [100] = { 3.33038240059032, LH = { 66.6666666666667, 3.31458693673839, }, Flags = { Linear = true, }, },
         },
      },
      Camera3D1XRotation = BezierSpline {
         SplineColor = { Red = 255, Green = 128, Blue = 128, },
         NameSet = true,
         KeyFrames = {
            [0] = { -32.7999992370605, RH = { 33.3333333333333, -27.8666659037272, }, Flags = { Linear = true, }, },
            [100] = { -17.9999992370605, LH = { 66.6666666666667, -22.9333325703939, }, Flags = { Linear = true, }, },
         },
      },
      Camera3D1YRotation = BezierSpline {
         SplineColor = { Red = 128, Green = 255, Blue = 128, },
         NameSet = true,
         KeyFrames = {
            [0] = { 19.6000003814697, RH = { 33.3333333333333, 15.3333337148031, }, Flags = { Linear = true, }, },
            [100] = { 6.80000038146973, LH = { 66.6666666666667, 11.0666670481364, }, Flags = { Linear = true, }, },
         },
      },
      Camera3D1ZRotation = BezierSpline {
         SplineColor = { Red = 128, Green = 128, Blue = 255, },
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 33.3333333333333, 0, }, Flags = { Linear = true, }, },
            [100] = { 0, LH = { 66.6666666666667, 0, }, Flags = { Linear = true, }, },
         },
      },
      Text1 = TextPlus {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            Center = Input {
               SourceOp = "Locator3D1",
               Source = "Position",
            },
            Font = Input { Value = "Arial", },
            StyledText = Input { Value = "Corner", },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = "",
               },
            },
            Alignment = Input { Value = 1, },
            HorizontalJustification = Input { Value = 0, },
            VerticalJustification = Input { Value = 2, },
            ShadingGradient1 = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1, },
                     [1] = { 1, 1, 1, 1, },
                  },
               },
            },
            RenderToDPTFile = Input { Disabled = true, },
            DPTType = Input { Disabled = true, },
            DPTResolution = Input { Disabled = true, },
         },
         ViewInfo = OperatorInfo { Pos = { 935, 82.5, }, },
      },
      Shape3D1 = Shape3D {
         CtrlWZoom = false,
         Inputs = {
            Shape = Input { Value = FuID { "SurfaceCubeInputs", }, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 1, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
            ["SurfaceCubeInputs.SubdivisionWidth"] = Input { Value = 2, },
            ["SurfaceCubeInputs.Wireframe"] = Input { Value = 1, },
            ["SurfaceCubeInputs.ObjectID.ObjectID"] = Input { Value = 2, },
         },
         ViewInfo = OperatorInfo { Pos = { 330, 181.5, }, },
      },
      Locator3D1 = Locator3D {
         Inputs = {
            SceneInput = Input {
               SourceOp = "Merge3D1",
               Source = "Output",
            },
            ["Transform3DOp.Translate.X"] = Input { Value = 0.5, },
            ["Transform3DOp.Translate.Y"] = Input { Value = 0.5, },
            ["Transform3DOp.Translate.Z"] = Input { Value = 0.5, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
         },
         ViewInfo = OperatorInfo { Pos = { 660, 181.5, }, },
      },
      Renderer3D1 = Renderer3D {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            SceneInput = Input {
               SourceOp = "Locator3D1",
               Source = "Output",
            },
            RendererType = Input { Value = FuID { "RendererOpenGL", }, },
         },
         ViewInfo = OperatorInfo { Pos = { 825, 181.5, }, },
      },
      Merge1 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Renderer3D1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Text1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 935, 181.5, }, },
      },
      Merge3D1 = Merge3D {
         Inputs = {
            SceneInput1 = Input {
               SourceOp = "Shape3D1",
               Source = "Output",
            },
            SceneInput2 = Input {
               SourceOp = "Camera3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 495, 181.5, }, },
      },
   },
}


PS:
The Locator needs to be downstream of the Camera.
Else it wouldn't know the camera's position.

Cheers.

Eric.

Re: 2d tracker from 3d locator.

PostPosted: Mon Jan 19, 2015 5:41 pm
by Kyriakos Rissakis
To be more clear i have camera only from Blender ,no point cloud,
created a 3d locator, set as target camera's current position, went
to another frame, fiddled on z axis and now my locator sticks hapilly
to my chosen feature. Now what? I cannot really understand Python
scripts, i need a more straightforward way or i will have to retrack
the rendered locator.
And of course thanks for your response Eric.

Re: 2d tracker from 3d locator.

PostPosted: Mon Jan 19, 2015 6:27 pm
by Stefan Ihringer
you've got everything set up already. now you just need to go to your 2d tool (for example a corner positioner or transform), right click a position input, choose connect to -> (your locator3D) -> position which will get you the 2d coordinates. they will update in real time if you move your locator or camera. but you can bake the position key frames if you like (there's a tool script for it)

Re: 2d tracker from 3d locator.

PostPosted: Mon Jan 19, 2015 7:38 pm
by Kyriakos Rissakis
Yeah, you are right, i tried it with a polygon center and it works.
I was expecting to actually see xy coordinates like in Nuke's
reconcile3d ,that is what confused me.
Thank you both for your time, it seems that there are many non obvious
features in Fusion after all.

Re: 2d tracker from 3d locator.

PostPosted: Mon Jan 19, 2015 8:24 pm
by michael vorberg
the code that eric posted here is an example comp, just copy and paste into fusion.

Re: 2d tracker from 3d locator (SOLVED)

PostPosted: Tue Jan 20, 2015 3:41 pm
by Kyriakos Rissakis
Yes, i opened it and it is helpful, the locator goes after the 3d merge.
Thanks Eric, i got it.

Re: 2d tracker from 3d locator (SOLVED)

PostPosted: Sat Jan 24, 2015 7:09 am
by Tanawat Wattanachinda
In the flow view, Is there any way I can see visually what node connected to what node?
I mean, the sample code, connect "Locator3D1" to "Text1" with no visual indicator what so ever...
In Shake or Nuke, they show an "expression link" the same way node connect but with different line color, If Im not mistaken.

Thank

Re: 2d tracker from 3d locator (SOLVED)

PostPosted: Sat Jan 24, 2015 9:14 am
by Stefan Ihringer
No, unfortunately these "under the hood" connections between tools are not indicated anywhere.

I guess many had hoped this would be implemented in Fusion 7...

Re: 2d tracker from 3d locator (SOLVED)

PostPosted: Sat Jan 24, 2015 3:47 pm
by Kyriakos Rissakis
I always found those green lines annoying. I prefer to color both tools purple or something and write a comment.

Re: 2d tracker from 3d locator (SOLVED)

PostPosted: Sun Jan 25, 2015 4:08 am
by Tanawat Wattanachinda
That is why it should be an option to turn it On/Off.

Re: 2d tracker from 3d locator (SOLVED)

PostPosted: Sun Jan 25, 2015 5:15 am
by Stefan Ihringer
Having it as an option or indicating a connection and just showing the line when you actually select an affected tool... there are many ways to do this in a user-friendly way. In Nuke/Shake it's just as simple as ctrl-E. Manually keeping track with colors or comments seems like having a word processor that forces you to manually keep a list of which words you want to bolden instead of just... well bad analogy but you get the point :-)

Same thing with animated tools... The script that ships with Fusion to highlight them requires you to call it, it won't remove a highlight if the animation is no longer there and it overwrites custom colors. Having an indicator on the node instead would be something I'd prefer.