Page 1 of 1

Aligning Objects

PostPosted: Thu Dec 14, 2017 2:36 pm
by Chris North
Hello,

Couldn't find this in the manual - maybe I've missed something obvious. But is there a way to align 3D objects on a particular axis? Or to centre objects relative to others?

chris

Re: Aligning Objects

PostPosted: Fri Dec 15, 2017 10:52 am
by Marc van Vliet
Hi,

Please copy paste an example comp of what you are trying to accomplish.

Cheers,

Marc

Re: Aligning Objects

PostPosted: Fri Dec 15, 2017 10:55 am
by Chris North
For example, I want to centre the X & Y of the camera with the 3DShape.

Code: Select all
{
   Tools = ordered() {
      Shape3D1 = Shape3D {
         CtrlWZoom = false,
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Value = 0.523223474893334, },
            ["Transform3DOp.Translate.Y"] = Input { Value = -0.503418802189864, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 2, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 2, }
         },
         ViewInfo = OperatorInfo { Pos = { 1265, 247.5 } },
      },
      Merge3D1 = Merge3D {
         Inputs = {
            SceneInput1 = Input {
               SourceOp = "Camera3D1",
               Source = "Output",
            },
            SceneInput2 = Input {
               SourceOp = "Shape3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1210, 379.5 } },
         Colors = {
            TileColor = { R = 0.525490196078431, G = 0, B = 0.00784313725490196 },
            TextColor = { R = 0, G = 0, B = 0 },
         }
      },
      Camera3D1 = Camera3D {
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Value = -0.801984826056138, },
            ["Transform3DOp.Translate.Z"] = Input { Value = 1.0678535408965, },
            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 = 1, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 1100, 247.5 } },
         Colors = {
            TileColor = { R = 0.525490196078431, G = 0, B = 0.00784313725490196 },
            TextColor = { R = 0, G = 0, B = 0 },
         }
      }
   }
}

Re: Aligning Objects

PostPosted: Fri Dec 15, 2017 11:37 am
by Marc van Vliet
OK, I see the comp, silly question probably, but why not just set the xyz of both to 0 and move around the merge xyz.. then camera is centered on shape and locked together ...?

Re: Aligning Objects

PostPosted: Fri Dec 15, 2017 1:27 pm
by Chris North
Yeah, could do. I was just hoping for a quick and easy way to align one object to another (like in Maya/Afx) on a particular axis as I often want to centre the camera or it's target on another object.

Perhaps there isn't a way other than typing in the values like you say.

Re: Aligning Objects

PostPosted: Fri Dec 15, 2017 2:27 pm
by michael vorberg
With some scripting it should doable

Re: Aligning Objects

PostPosted: Fri Dec 15, 2017 3:35 pm
by Marc van Vliet
You can open both camera and shape, then on the coords tab set camera target enabled, then right click xyz and set to expression, then pickwhip to the xyz of the shape..

Code: Select all
{
   Tools = ordered() {
      Merge3D1 = Merge3D {
         Inputs = {
            SceneInput1 = Input {
               SourceOp = "Camera3D1",
               Source = "Output",
            },
            SceneInput2 = Input {
               SourceOp = "Shape3D1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 0, 148.5 } },
         Colors = {
            TileColor = { R = 0.52156862745098, G = 0, B = 0.00784313725490196 },
            TextColor = { R = 0, G = 0, B = 0 },
         }
      },
      Shape3D1 = Shape3D {
         CtrlWZoom = false,
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Value = 0.523223474893334, },
            ["Transform3DOp.Translate.Y"] = Input { Value = -0.503418802189864, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 2, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 2, }
         },
         ViewInfo = OperatorInfo { Pos = { 0, 16.5 } },
      },
      Camera3D1 = Camera3D {
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input { Value = -0.801984826056138, },
            ["Transform3DOp.Translate.Z"] = Input { Value = 1.0678535408965, },
            ["Transform3DOp.UseTarget"] = Input { Value = 1, },
            ["Transform3DOp.Target.X"] = Input {
               Value = 0.523223474893334,
               Expression = "Shape3D1.Transform3DOp.Translate.X",
            },
            ["Transform3DOp.Target.Y"] = Input {
               Value = -0.503418802189864,
               Expression = "Shape3D1.Transform3DOp.Translate.Y",
            },
            ["Transform3DOp.Target.Z"] = Input { Expression = "Shape3D1.Transform3DOp.Translate.Z", },
            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 = 1, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { -165, 148.5 } },
         Colors = {
            TileColor = { R = 0.52156862745098, G = 0, B = 0.00784313725490196 },
            TextColor = { R = 0, G = 0, B = 0 },
         }
      }
   }
}

Re: Aligning Objects

PostPosted: Fri Dec 15, 2017 5:03 pm
by Chris North
Hmmm. I wonder if a script or macro could be setup then to automate that...

Anyway - many thanks.