Jump to: Board index » General » Fusion

CoordTransform Position Usage (or limitations)

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

Ignacio de La Cierva

  • Posts: 163
  • Joined: Tue Apr 26, 2016 12:20 pm

CoordTransform Position Usage (or limitations)

PostSun Jan 21, 2018 8:40 pm

Hi. Today I've been trying to apply all I've learnt this week about expressions to do somethig I'd love to have at hand:

A Customized Camera Crane with hothead. 8-)

Tricky till I got the parenting/linking interactions, but after a couple of hours it works perfect. In one single control panel I have Zoom, Pan, Tilt, Crane lift angle, Crane orientation, and Crane Arm lenght (telescopic, yeah, it's free). Later Ill send there Shake/perturb controllers too.

Now, there are two important features I want to implement to finisg the set, but I've been trying and testing, fighting for hours, but I'm stucked:

- Target Camera: My current crane works perfect with free camera. Would be perfect if I could switch on the camera target and link it to any object in my scene. (In that case, rotation angles are offsets to the camera target angle. As it works with normal cameras.

- AutoFocus. With a dist3d() function I can set an expression linking focus.dist to the camera target or any other object distance to my scene. I want to have a crane cam with autofocus to target if it's a target camera, or to my "focustarget" object if I'm using a free camera in the crane.

The problem with both features is that the camera and it's target have now altered coordinates, as they are at the end of a chain of rotating and telescopic geometry.

I know I need the CoordTransform Position modifier. I've learnt how to use it to make a "world object" follow a "offseted coords" object. Nice but:

It only works if the looking at object, the one receiving the modifier, is referenced to world coordinates. But, if that object is also "offseted" becasuse he also is part of a hierarchy, then it does not work. In that case, do I need nested CoordTransform modifiers? Too much for my mind.

this is an example with a simplified scene:

CoordTransform Position working perfect, untill you offset his coordinate system.

¿Can anyone solve this and make the plane keep looking at the ball even after moving his parent merge? Is it imppossible or is just too difficult for me?

Code: Select all
{
   Tools = ordered() {
      Crane = Shape3D {
         NameSet = true,
         Inputs = {
            SceneInput = Input {
               SourceOp = "LookAtMe",
               Source = "Output",
            },
            ["Transform3DOp.Translate.Y"] = Input {
               Value = 1,
               Expression = "SurfaceCylinderInputs.Height/2",
            },
            Shape = Input { Value = FuID { "SurfaceCylinderInputs" }, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 2, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 3, },
            ["SurfaceCylinderInputs.Radius"] = Input { Value = 0.04, },
            ["SurfaceCylinderInputs.ObjectID.ObjectID"] = Input { Value = 4, }
         },
         ViewInfo = OperatorInfo { Pos = { 1123.11, 69.6027 } },
      },
      LookAtMe = Shape3D {
         NameSet = true,
         Inputs = {
            ["Transform3DOp.Translate.Y"] = Input { Value = 1.019, },
            Shape = Input { Value = FuID { "SurfaceSphereInputs" }, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 1, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
            ["SurfaceSphereInputs.Radius"] = Input { Value = 0.3, },
            ["SurfaceSphereInputs.ObjectID.ObjectID"] = Input { Value = 2, }
         },
         ViewInfo = OperatorInfo {
            Pos = { 1007.24, 68.6937 },
            Flags = {
               ShowPic = true
            }
         },
      },
      Text3D1_1_1 = Text3D {
         Inputs = {
            Size = Input { Value = 0.38, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input { Value = "LOCAL MERGE\n(transformed)\n\n", },
            Style = Input { Value = "Bold", },
            ExtrusionProfile = Input {
               SourceOp = "Text3D1_1_1ExtrusionProfile",
               Source = "Value",
            },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1302.24, 121.14 } },
      },
      Text3D1_1_1ExtrusionProfile = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.0666666666666667, 0.333333333333333 }, Flags = { Linear = true } },
               [0.2] = { 1, LH = { 0.133333333333333, 0.666666666666667 }, RH = { 0.4, 1 }, Flags = { Linear = true } },
               [0.8] = { 1, LH = { 0.6, 1 }, RH = { 0.866666666666667, 0.666666666666667 }, Flags = { Linear = true } },
               [1] = { 0, LH = { 0.933333333333333, 0.333333333333333 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         NameSet = true,
      },
      Merge3D1 = Merge3D {
         CtrlWZoom = false,
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Value = -4.5288, },
            ["Transform3DOp.Rotate.X"] = Input {
               SourceOp = "Merge3D1XRotation",
               Source = "Value",
            },
            ["Transform3DOp.Scale.X"] = Input {
               SourceOp = "Merge3D1XScale",
               Source = "Value",
            },
            SceneInput2 = Input {
               SourceOp = "Text3D1_1_1",
               Source = "Output",
            },
            SceneInput3 = Input {
               SourceOp = "Crane",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1282, 152 } },
      },
      Merge3D1XRotation = BezierSpline {
         SplineColor = { Red = 255, Green = 128, Blue = 128 },
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 27, 0 }, Flags = { Loop = true, Pingpong = true } },
            [81] = { 22, LH = { 54, 22 }, Flags = { Loop = true, Pingpong = true } }
         }
      },
      Merge3D1XScale = BezierSpline {
         SplineColor = { Red = 251, Green = 22, Blue = 119 },
         NameSet = true,
         KeyFrames = {
            [0] = { 0.912, RH = { 15.6666666666667, 0.912 }, Flags = { Loop = true, Pingpong = true } },
            [47] = { 2.68, LH = { 31.3333333333333, 2.68 }, Flags = { Loop = true, Pingpong = true } }
         }
      },
      WORLD = Merge3D {
         NameSet = true,
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Expression = "0.0", },
            ["Transform3DOp.Translate.Y"] = Input { Expression = "0.0", },
            ["Transform3DOp.Translate.Z"] = Input { Expression = "0.0", },
            ["Transform3DOp.Rotate.X"] = Input { Expression = "0.0", },
            ["Transform3DOp.Rotate.Y"] = Input { Expression = "0.0", },
            ["Transform3DOp.Rotate.Z"] = Input { Expression = "0.0", },
            ["Transform3DOp.Scale.X"] = Input { Expression = "1", },
            SceneInput1 = Input {
               SourceOp = "NOW_MOVE_THIS",
               Source = "Output",
            },
            SceneInput2 = Input {
               SourceOp = "Merge3D1",
               Source = "Output",
            },
            SceneInput3 = Input {
               SourceOp = "Text3D1",
               Source = "Output",
            },
            SceneInput4 = Input {
               SourceOp = "PointLight1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1568.79, 152.886 } },
      },
      Text3D1 = Text3D {
         Inputs = {
            Size = Input { Value = 0.26, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input { Value = "\nworld 0,0,0", },
            Style = Input { Value = "Bold", },
            ExtrusionProfile = Input {
               SourceOp = "Text3D1ExtrusionProfile",
               Source = "Value",
            },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1559.3, 114.855 } },
      },
      Text3D1ExtrusionProfile = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.0196116135138184, 0.098058067569092 }, Flags = { Linear = true } },
               [0.2] = { 1, LH = { 0.180388386486182, 0.901941932430908 }, RH = { 0.3, 1 }, Flags = { Linear = true } },
               [0.8] = { 1, LH = { 0.7, 1 }, RH = { 0.819611613513818, 0.901941932430908 }, Flags = { Linear = true } },
               [1] = { 0, LH = { 0.980388386486182, 0.098058067569092 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         NameSet = true,
      },
      PointLight1 = LightPoint {
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Value = -3.942, },
            ["Transform3DOp.Translate.Z"] = Input { Value = 4.12914104087048, },
         },
         ViewInfo = OperatorInfo { Pos = { 1558.67, 190.276 } },
      },
      NOW_MOVE_THIS = Merge3D {
         NameSet = true,
         Inputs = {
            SceneInput1 = Input {
               SourceOp = "Text3D1_1",
               Source = "Output",
            },
            SceneInput2 = Input {
               SourceOp = "autoalignplane",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1805.69, 150.851 } },
      },
      Text3D1_1 = Text3D {
         Inputs = {
            Size = Input { Value = 0.38, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input { Value = "LOCAL MERGE\nnow, move this\n\n", },
            Style = Input { Value = "Bold", },
            ExtrusionProfile = Input {
               SourceOp = "Text3D1_1ExtrusionProfile",
               Source = "Value",
            },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1805.67, 119.883 } },
      },
      Text3D1_1ExtrusionProfile = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.0666666666666667, 0.333333333333333 }, Flags = { Linear = true } },
               [0.2] = { 1, LH = { 0.133333333333333, 0.666666666666667 }, RH = { 0.4, 1 }, Flags = { Linear = true } },
               [0.8] = { 1, LH = { 0.6, 1 }, RH = { 0.866666666666667, 0.666666666666667 }, Flags = { Linear = true } },
               [1] = { 0, LH = { 0.933333333333333, 0.333333333333333 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         NameSet = true,
      },
      autoalignplane = Shape3D {
         NameSet = true,
         Inputs = {
            SceneInput = Input {
               SourceOp = "Helper",
               Source = "Output",
            },
            ["Transform3DOp.Translate.Y"] = Input { Value = 1.134, },
            ["Transform3DOp.Rotation"] = Input { Value = 0, },
            ["Transform3DOp.UseTarget"] = Input { Value = 1, },
            ["Transform3DOp.Target.X"] = Input {
               SourceOp = "CoordTransform3D1",
               Source = "Position.X",
            },
            ["Transform3DOp.Target.Y"] = Input {
               SourceOp = "CoordTransform3D1",
               Source = "Position.Y",
            },
            ["Transform3DOp.Target.Z"] = Input {
               SourceOp = "CoordTransform3D1",
               Source = "Position.Z",
            },
            ["MtlStdInputs.MaterialID"] = Input { Value = 3, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 5, }
         },
         ViewInfo = OperatorInfo {
            Pos = { 1952.97, 12.8575 },
            Flags = {
               ShowPic = true
            }
         },
      },
      CoordTransform3D1 = CoordTransform3D {
         CtrlWZoom = false,
         Inputs = {
            TargetObject = Input {
               SourceOp = "LookAtMe",
               Source = "Output",
            },
            SceneInput = Input {
               SourceOp = "Merge3D1",
               Source = "Output",
            },
         },
      },
      Helper = Shape3D {
         NameSet = true,
         Inputs = {
            ["Transform3DOp.Translate.Z"] = Input {
               Value = 3,
               Expression = "SurfaceCubeInputs.Depth/2",
            },
            Shape = Input { Value = FuID { "SurfaceCubeInputs" }, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 4, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 6, },
            ["SurfaceCubeInputs.SizeLock"] = Input { Value = 0, },
            ["SurfaceCubeInputs.Width"] = Input { Value = 0.04, },
            ["SurfaceCubeInputs.Height"] = Input { Value = 0.04, },
            ["SurfaceCubeInputs.Depth"] = Input { Value = 6, },
            ["SurfaceCubeInputs.ObjectID.ObjectID"] = Input { Value = 7, }
         },
         ViewInfo = OperatorInfo { Pos = { 2064.62, 13.037 } },
      }
   }
}
Last edited by Ignacio de La Cierva on Sun Jan 21, 2018 9:03 pm, edited 1 time in total.
Offline

Ignacio de La Cierva

  • Posts: 163
  • Joined: Tue Apr 26, 2016 12:20 pm

Re: CoordTransform Position Usage (or limitations)

PostSun Jan 21, 2018 8:51 pm

Well, actually, what I need to solve is probably much easier than that example I posted.

I don't need to link two objects when both have their coord. system changed. I would like to know how, but I can live without. For the moment.


My problem today is easier:

I can now make a "world" object follow a "linked" object: What I need is learn to use CoordTranform to make the opposite: The "offset coord object" (my camera target) linked to a "world coord object" . So simple.

I mean; solve this minimalistic crane:

Code: Select all
{
   Tools = ordered() {
      PointLight1 = LightPoint {
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Value = -3.942, },
            ["Transform3DOp.Translate.Z"] = Input { Value = 4.12914104087048, },
         },
         ViewInfo = OperatorInfo { Pos = { 1558.67, 190.276 } },
      },
      WORLD = Merge3D {
         NameSet = true,
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Expression = "0.0", },
            ["Transform3DOp.Translate.Y"] = Input { Expression = "0.0", },
            ["Transform3DOp.Translate.Z"] = Input { Expression = "0.0", },
            ["Transform3DOp.Rotate.X"] = Input { Expression = "0.0", },
            ["Transform3DOp.Rotate.Y"] = Input { Expression = "0.0", },
            ["Transform3DOp.Rotate.Z"] = Input { Expression = "0.0", },
            ["Transform3DOp.Scale.X"] = Input { Expression = "1", },
            SceneInput2 = Input {
               SourceOp = "Merge3D1",
               Source = "Output",
            },
            SceneInput4 = Input {
               SourceOp = "PointLight1",
               Source = "Output",
            },
            SceneInput5 = Input {
               SourceOp = "LookAtMe",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1568.79, 152.886 } },
      },
      Merge3D1 = Merge3D {
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Value = -4.5288, },
            ["Transform3DOp.Rotate.X"] = Input {
               SourceOp = "Merge3D1XRotation",
               Source = "Value",
            },
            ["Transform3DOp.Rotate.Z"] = Input { Value = -31.1, },
            ["Transform3DOp.Scale.X"] = Input {
               SourceOp = "Merge3D1XScale",
               Source = "Value",
            },
            SceneInput2 = Input {
               SourceOp = "Text3D1_1_1",
               Source = "Output",
            },
            SceneInput3 = Input {
               SourceOp = "Crane",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1282, 152 } },
      },
      Merge3D1XRotation = BezierSpline {
         SplineColor = { Red = 255, Green = 128, Blue = 128 },
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 27, 0 }, Flags = { Loop = true, Pingpong = true } },
            [81] = { 22, LH = { 54, 22 }, Flags = { Loop = true, Pingpong = true } }
         }
      },
      Merge3D1XScale = BezierSpline {
         SplineColor = { Red = 251, Green = 22, Blue = 119 },
         NameSet = true,
         KeyFrames = {
            [0] = { 0.912, RH = { 15.6666666666667, 0.912 }, Flags = { Loop = true, Pingpong = true } },
            [47] = { 2.68, LH = { 31.3333333333333, 2.68 }, Flags = { Loop = true, Pingpong = true } }
         }
      },
      Text3D1_1_1 = Text3D {
         Inputs = {
            Size = Input { Value = 0.38, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input { Value = "LOCAL MERGE\n(transformed)\n\n", },
            Style = Input { Value = "Bold", },
            ExtrusionProfile = Input {
               SourceOp = "Text3D1_1_1ExtrusionProfile",
               Source = "Value",
            },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1302.24, 121.14 } },
      },
      Text3D1_1_1ExtrusionProfile = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.0666666666666667, 0.333333333333333 }, Flags = { Linear = true } },
               [0.2] = { 1, LH = { 0.133333333333333, 0.666666666666667 }, RH = { 0.4, 1 }, Flags = { Linear = true } },
               [0.8] = { 1, LH = { 0.6, 1 }, RH = { 0.866666666666667, 0.666666666666667 }, Flags = { Linear = true } },
               [1] = { 0, LH = { 0.933333333333333, 0.333333333333333 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
      },
      Text3D1_1 = Text3D {
         CtrlWZoom = false,
         Inputs = {
            Size = Input { Value = 0.38, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input { Value = "Look at me!\n\n", },
            Style = Input { Value = "Bold", },
            ExtrusionProfile = Input {
               SourceOp = "Text3D1_1ExtrusionProfile",
               Source = "Value",
            },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1809.21, 95.0822 } },
      },
      Text3D1_1ExtrusionProfile = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.0666666666666667, 0.333333333333333 }, Flags = { Linear = true } },
               [0.2] = { 1, LH = { 0.133333333333333, 0.666666666666667 }, RH = { 0.4, 1 }, Flags = { Linear = true } },
               [0.8] = { 1, LH = { 0.6, 1 }, RH = { 0.866666666666667, 0.666666666666667 }, Flags = { Linear = true } },
               [1] = { 0, LH = { 0.933333333333333, 0.333333333333333 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         NameSet = true,
      },
      LookAtMe = Shape3D {
         NameSet = true,
         Inputs = {
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
            SceneInput = Input {
               SourceOp = "Text3D1_1",
               Source = "Output",
            },
            ["Transform3DOp.Translate.Y"] = Input { Value = 1.6689981323823, },
            Shape = Input { Value = FuID { "SurfaceSphereInputs" }, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 1, },
            ["SurfaceSphereInputs.Radius"] = Input { Value = 0.3, },
            ["SurfaceSphereInputs.ObjectID.ObjectID"] = Input { Value = 2, }
         },
         ViewInfo = OperatorInfo {
            Pos = { 1574.12, 23.816 },
            Flags = {
               ShowPic = true
            }
         },
      },
      Crane = Shape3D {
         NameSet = true,
         Inputs = {
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 3, },
            SceneInput = Input {
               SourceOp = "camplate",
               Source = "Output",
            },
            ["Transform3DOp.Translate.Y"] = Input {
               Value = 1,
               Expression = "SurfaceCylinderInputs.Height/2",
            },
            Shape = Input { Value = FuID { "SurfaceCylinderInputs" }, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 2, },
            ["SurfaceCylinderInputs.Radius"] = Input { Value = 0.04, },
            ["SurfaceCylinderInputs.ObjectID.ObjectID"] = Input { Value = 4, }
         },
         ViewInfo = OperatorInfo { Pos = { 1123.11, 69.6027 } },
      },
      camplate = Shape3D {
         NameSet = true,
         Inputs = {
            SceneInput = Input {
               SourceOp = "Camera3D1",
               Source = "Output",
            },
            ["Transform3DOp.Translate.Y"] = Input {
               Value = 1,
               Expression = "Crane.Transform3DOp.Translate.Y",
            },
            ["Transform3DOp.Rotate.X"] = Input {
               Value = -21.2455418381344,
               Expression = "-Merge3D1.Transform3DOp.Rotate.X",
            },
            ["Transform3DOp.Rotate.Y"] = Input { Expression = "-Merge3D1.Transform3DOp.Rotate.Y", },
            ["Transform3DOp.Rotate.Z"] = Input {
               Value = 31.1,
               Expression = "-Merge3D1.Transform3DOp.Rotate.Z",
            },
            Shape = Input { Value = FuID { "SurfaceCubeInputs" }, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 3, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
            ["SurfaceCubeInputs.Width"] = Input { Value = 0.34, },
            ["SurfaceCubeInputs.ObjectID.ObjectID"] = Input { Value = 3, }
         },
         ViewInfo = OperatorInfo { Pos = { 1124.62, 24.295 } },
      },
      Camera3D1 = Camera3D {
         Inputs = {
            ["Transform3DOp.Translate.Y"] = Input { Value = 0.292090917626569, },
            ["Transform3DOp.UseTarget"] = Input { Value = 1, },
            ["Transform3DOp.Target.Z"] = Input { Value = 3.27, },
            AoV = Input { Value = 19.2642683071402, },
            ["Stereo.Mode"] = Input { Value = FuID { "Mono" }, },
            FilmGate = Input { Value = FuID { "BMD_URSA_4K_16x9" }, },
            ApertureW = Input { Value = 0.831496062992126, },
            ApertureH = Input { Value = 0.467716535433071, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 5, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 4, },
         },
         ViewInfo = OperatorInfo { Pos = { 1111.63, -41.8406 } },
      }
   }
}

Return to Fusion

Who is online

Users browsing this forum: No registered users and 20 guests