Fusion: Accessing EXR Metadata in simple expressions

Get answers to your questions about color grading, editing and finishing with DaVinci Resolve.
  • Author
  • Message
Offline
User avatar

Bryan Ray

  • Posts: 2616
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Fusion: Accessing EXR Metadata in simple expressions

PostThu Jun 21, 2018 10:50 pm

Anyone know how this is done? I am happy to see that I can now display the metadata in the sub-view, and I can access it in the console:

Code: Select all
==MediaIn1.Output[comp.CurrentTime].Metadata


I haven't been able to figure out how to get to it with an expression, though. For instance, the following Text+ node should display the name of the software that rendered the frame:

Code: Select all
{
   Tools = ordered() {
      Text1_1 = TextPlus {
         CtrlWZoom = false,
         Inputs = {
            GlobalOut = Input { Value = 29, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Center = Input { Value = { 0.583333333333333, 0.640740740740741 }, },
            StyledText = Input { Expression = "MediaIn2.Output.Metadata.Creator", },
            Font = Input { Value = "Open Sans", },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 126.667, -146.303 } },
      }
   },
   ActiveTool = "Text1_1"
}


Neither the expression 'MediaIn2.Output.Metadata.Creator' or 'Text(MediaIn2.Output.Metadata.Creator)' work.

On the plus side, the Fuse I wrote to convert Redshift's camera metadata into Euler angles works great. I just can't get the transformations into a Camera3D yet. Here's a sample Camera3D node with expressions that work in Fusion 9 but not in Resolve. The attached zip file contains the RSCameraExtractor Fuse and a sample EXR frame with Redshift Metadata:

Code: Select all
{
   Tools = ordered() {
      Camera3D1 = Camera3D {
         CtrlWZoom = false,
         NameSet = true,
         CurrentSettings = 6,
         CustomData = { Settings = { [1] = { Tools = ordered() { Camera3D1 = Camera3D { Inputs = { ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1 }, ApertureW = Input { Value = 0.831496062992126 }, AoV = Input { Value = 19.2642683071402 }, ["MtlStdInputs.MaterialID"] = Input { Value = 1 }, FilmGate = Input { Value = FuID { "BMD_URSA_4K_16x9" } }, ApertureH = Input { Value = 0.467716535433071 }, ImageInput = Input { SourceOp = "RSCameraExtractor1", Source = "Output" }, ["Stereo.Mode"] = Input { Value = FuID { "OffAxis" } } }, CtrlWZoom = false, ViewInfo = OperatorInfo { Pos = { 275, -610.5 } }, CustomData = {
                        } } } }, [6] = { Tools = ordered() { Camera3D1 = Camera3D { Inputs = { FLength = Input { Value = 29.2559007887564 }, ["Transform3DOp.Translate.Z"] = Input { Value = 5.694136, Expression = "self.ImageInput.Metadata.Translate.Z" }, ImagePlaneEnabled = Input { Value = 0 }, AoV = Input { Value = 45.076904, Expression = "self.ImageInput.Metadata.RSCameraFOV" }, AovType = Input { Value = 1 }, ["Transform3DOp.Rotate.Y"] = Input { Value = 229.336887022334, Expression = "self.ImageInput.Metadata.Rotate.Y" }, ApertureH = Input { Value = 0.794 }, FilmGate = Input { Value = FuID { "HD" } }, ["Transform3DOp.Rotate.X"] = Input { Value = -177.295424854842, Expression = "self.ImageInput.Metadata.Rotate.X" }, ["Transform3DOp.Translate.X"] = Input { Value = 6.253959, Expression = "self.ImageInput.Metadata.Translate.X" }, PlaneOfFocus = Input { Value = 100, Expression = "self.ImageInput.Metadata.RSCameraDOFFocusDistance" }, ImageInput = Input { SourceOp = "RSCameraExtractor1", Source = "Output" }, FilmBack = Input { Value = 1 }, ["Transform3DOp.Rotate.Z"] = Input { Value = -181.98980649338, Expression = "self.ImageInput.Metadata.Rotate.Z" }, ["Transform3DOp.Rotate.RotOrder"] = Input { Value = FuID { "ZXY" } }, ApertureW = Input { Value = 0.956 }, ["Stereo.Mode"] = Input { Value = FuID { "OffAxis" } }, ResolutionGateFit = Input { Value = FuID { "Stretch" } }, ["Transform3DOp.Translate.Y"] = Input { Value = 0.630876, Expression = "self.ImageInput.Metadata.Translate.Y" }, ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1 }, ["MtlStdInputs.MaterialID"] = Input { Value = 1 } }, Name = "Camera3D1", CtrlWZoom = false, ViewInfo = OperatorInfo { Pos = { 275, -610.5 } }, CustomData = {
                        } } } } } },
         Inputs = {
            ["Transform3DOp.Translate.X"] = Input {
               Value = -10.394806,
               Expression = "self.ImageInput.Metadata.Translate.X",
            },
            ["Transform3DOp.Translate.Y"] = Input {
               Value = 0.362959,
               Expression = "self.ImageInput.Metadata.Translate.Y",
            },
            ["Transform3DOp.Translate.Z"] = Input {
               Value = 116.633461,
               Expression = "self.ImageInput.Metadata.Translate.Z",
            },
            ["Transform3DOp.Rotate.RotOrder"] = Input { Value = FuID { "ZXY" }, },
            ["Transform3DOp.Rotate.X"] = Input {
               Value = -180,
               Expression = "self.ImageInput.Metadata.Rotate.X+CustomTool1_1.NumberIn1",
            },
            ["Transform3DOp.Rotate.Y"] = Input {
               Value = 175.113049302563,
               Expression = "self.ImageInput.Metadata.Rotate.Y+CustomTool1_1.NumberIn2",
            },
            ["Transform3DOp.Rotate.Z"] = Input {
               Value = 180,
               Expression = "self.ImageInput.Metadata.Rotate.Z+CustomTool1_1.NumberIn3",
            },
            PerspNearClip = Input {
               Value = 0.05,
               Expression = "self.ImageInput.Metadata.RSCameraNearPlane",
            },
            PerspFarClip = Input {
               Value = 0.05,
               Expression = "self.ImageInput.Metadata.RSCameraFarPlane",
            },
            AovType = Input { Value = 1, },
            AoV = Input {
               Value = 0.001,
               Expression = "self.ImageInput.Metadata.RSCameraFOV",
            },
            FLength = Input { Value = 1000000, },
            PlaneOfFocus = Input {
               Value = 0.05,
               Expression = "self.ImageInput.Metadata.RSCameraDOFFocusDistance",
            },
            ["Stereo.Mode"] = Input { Value = FuID { "Mono" }, },
            FilmBack = Input { Value = 1, },
            FilmGate = Input { Value = FuID { "HD" }, },
            ApertureW = Input { Value = 1.6, },
            ApertureH = Input { Value = 0.9, },
            LensShiftX = Input { Expression = "self.ImageInput.Metadata.LensShift.X", },
            LensShiftY = Input { Expression = "self.ImageInput.Metadata.LensShift.Y", },
            ImagePlaneEnabled = Input { Value = 0, },
            ["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
            ["MtlStdInputs.MaterialID"] = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 296, -16.2727 } },
      }
   },
   ActiveTool = "Camera3D1"
}



In addition, although I see the metadata for EXRs, I don't yet see it for other file types—I have tested a DPX and a Jpeg. Both show metadata in Fusion 9, but neither do in Resolve.
Attachments
RSCameraExtractor.zip
(357.34 KiB) Downloaded 109 times
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com

Return to DaVinci Resolve

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 319 guests