I've just taken a moment to look at your sample EXR image coming from Red Shift.
Probing the Metadata Values
In its simplest form this lets you access the raw "RSCameraTransform" metadata tag using Lua:
Code: Select all
xform = Loader1.Output:GetValue().Metadata.RSCameraTransform
-- Result = 0.962218,0.000000,0.272280,0.000000,-0.018337,0.997730,0.064803,0.000000,0.271662,0.067347,-0.960033,0.000000,-1077.789185,253.851807,4898.295410,1.000000
You could split these comma separated values into a Lua table format using:
Code: Select all
xform = Loader1.Output:GetValue().Metadata.RSCameraTransform
xformTable = split(xform, ",")
dump(xformTable)
-- Result: table: 0x77a965b0
-- 1 = 0.962218
-- 2 = 0.000000
-- 3 = 0.272280
-- 4 = 0.000000
-- 5 = -0.018337
-- 6 = 0.997730
-- 7 = 0.064803
-- 8 = 0.000000
-- 9 = 0.271662
-- 10 = 0.067347
-- 11 = -0.960033
-- 12 = 0.000000
-- 13 = -1077.789185
-- 14 = 253.851807
-- 15 = 4898.295410
-- 16 = 1.000000
You can print a list to the console tab of all the entries in an image's metadata records with:
Code: Select all
dump(Loader1.Output:GetValue().Metadata)
-- table: 0x77ac3650
-- RSCameraBlackCrushThreshold = 0.250000
-- RSCameraDOFRadius = 1.000000
-- CreationTime = 2017:10:17:20:01:26
-- RSVersion = 2.5.35
-- RSCameraAspect = 1.777000
-- RSCamera2DTo3DVector = -0.359999,0.000375,0.202588,-0.000375
-- screenWindowWidth = 1
-- RSCameraWhitepoint = 1.000000,1.000000,1.000000
-- Filename = /Users/andrew/Desktop/RedShift.exr
-- type = scanlineimage
-- RSCameraISO = 100.000000
-- RSHostname = Maverick
-- RSCameraVignetting = 5.000000
-- RSCameraFarPlane = 100000.000000
-- RSCameraShutterRatio = 100.000000
-- RSCameraTransform = 0.962218,0.000000,0.272280,0.000000,-0.018337,0.997730,0.064803,0.000000,0.271662,0.067347,-0.960033,0.000000,-1077.789185,253.851807,4898.295410,1.000000
-- RSCameraBlackCrushAmount = 0.000000
-- dwaCompressionLevel = 45
-- RSCameraShift = 0.000000,0.000000
-- RSCameraDOFAspect = 1.000000
-- RSCameraAperture = 1.417320,0.797591
-- RSCameraAllowedOverexposure = 0.200000
-- screenWindowCenter = table: 0x77ac3698
-- 1 = 0
-- 2 = 0
-- RSCameraFOV = 39.597660
-- RSCameraDOFFocusDistance = 5100.000000
-- RSCameraCDM2 = 10000.000000
-- RSCameraFStop = 8.000000
-- RSCameraSaturation = 1.000000
-- RSCameraNearPlane = 1000.000000
Sample Fusion Comp
red-shift-metadata-node-flow.png
This is the starting point of an example Fusion composite that sets up a Camera3D node automatically using the metadata coming from a Loader node.
(Chad or Kristof might be able to show you how to process the comma separated RSCameraTransform 4x4 matrix data into the required XYZ rotation and transform based position values. I don't have any insight on that process.)
RedShift Camera3D Metadata.comp
The loader node is wirelessly linked to the Camera3D node with the help of a UserControls "ImageControl" attribute called MetadataSource that was added manually using a text editor to the bottom of Camera3D node.
red-shift-metadata-tags.png
At the moment the following Red Shift attributes are processed:
RSCameraFOV is used to drive the Angle Of View
RSCameraDOFFocusDistance is used to drive the Plane of Focus (for depth of field)
RSCameraNearPlane is used to drive the Near Clip
RSCameraFarPlane is used to drive the Far Clip
RSCameraTransform is added to the Comments text field section
red-shift-transform-in-comments.png
Todo:
Process the RSCameraTransform camera matrix to strip the commas and then convert it from a 16 cell 4x4 matrix into a XYZ rotation and transform based position
Process RSCameraAperture into the Aperture Width and Height values (Fusion might make it hard to expression link these controls via the GUI.)
Process RSCameraShift into Lens Shift X/Y
You do not have the required permissions to view the files attached to this post.