[Submission] Redshift Camera Extractor Fuse  [SUBMITTED]

Moderator: SecondMan

User avatar
Midgardsormr
Fusionator
Posts: 1053
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 1
Location: Los Angeles, CA, USA
Been thanked: 61 times
Contact:

[Submission] Redshift Camera Extractor Fuse

#1

Post by Midgardsormr » Mon Jun 11, 2018 11:25 am

Creating a Fusion camera from render image metadata is efficient and relatively error-proof. The RSCameraExtractor Fuse extracts the transformation matrix values from the metadata's comma-separated list, applies the transformations using the correct ZXY rotation order, and provides the Rotations and Translations in a more easily-accessed table format.

There are no controls at this time.

Changelog

v1.0 - 11.jun.2018
[*]First public release

Atom file contents:

Code: Select all

Atom {
	Name = "Redshift Camera Extractor",
	Category = "Tools/Metadata",
	Author = "Bryan Ray/MuseVFX",
	Version = 1.0,
	Date = {2018, 06, 11},
	
	Description = [[<p>Creating a Fusion camera from render image metadata is efficient and relatively error-proof. The RSCameraExtractor Fuse extracts the transformation matrix values from the metadata's comma-separated list, applies the transformations using the correct ZXY rotation order, and provides the Rotations and Translations in a more easily-accessed table format.]],
	
	Deploy = {
		"Fuses/Metadata/RSCameraExtractor.fuse",
		},
}

Atom directory:
Attachments
com.MuseVFX.RSCameraExtractor.zip
Atom submission
(4.01 KiB) Downloaded 8 times

User avatar
SecondMan
Site Admin
Posts: 3415
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 3
Location: Vancouver, Canada
Been thanked: 78 times
Contact:

Re: [Submission] Redshift Camera Extractor Fuse

#2

Post by SecondMan » Wed Jun 13, 2018 6:08 pm

And submitted (with a change to the Atom filename) :cheer:

User avatar
Midgardsormr
Fusionator
Posts: 1053
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 1
Location: Los Angeles, CA, USA
Been thanked: 61 times
Contact:

Re: [Submission] Redshift Camera Extractor Fuse  [SUBMITTED]

#3

Post by Midgardsormr » Tue Jul 24, 2018 12:18 pm

UPDATE: Redshift changed their metadata field names and changed the comma-separated lists into tables. The Fuse has been updated to accommodate.



Creating a Fusion camera from render image metadata is efficient and relatively error-proof. The RSCameraExtractor Fuse extracts the transformation matrix values from the metadata's comma-separated list, applies the transformations using the correct ZXY rotation order, and provides the Rotations and Translations in a more easily-accessed table format.

There are no controls at this time.

Changelog

v2.0 - 24.jul.2018
[*]Added support for newer Redshift metadata format (tested with RS v2.5.15)

v1.0 - 11.jun.2018
[*]First public release

Atom file contents:

Code: Select all

Atom {
	Name = "Redshift Camera Extractor",
	Category = "Tools/Metadata",
	Author = "Bryan Ray/MuseVFX",
	Version = 2.0,
	Date = {2018, 07, 24},
	
	Description = [[<p>Creating a Fusion camera from render image metadata is efficient and relatively error-proof. The RSCameraExtractor Fuse extracts the transformation matrix values from the metadata's comma-separated list, if necessary, applies the transformations using the correct ZXY rotation order, and provides the Rotations and Translations in a more easily-accessed table format.</p>
	
	<p>At some point prior to version 2.6.15, Redshift's metadata format changed. The Fuse has been updated to detect and account for the change.</p>]],
	
	Deploy = {
		"Fuses/Metadata/RSCameraExtractor.fuse",
		},
}

Atom directory:
Attachments
com.MuseVFX.RSCameraExtractor.zip
(4.33 KiB) Downloaded 5 times

User avatar
SecondMan
Site Admin
Posts: 3415
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 3
Location: Vancouver, Canada
Been thanked: 78 times
Contact:

Re: [Submission] Redshift Camera Extractor Fuse

#4

Post by SecondMan » Tue Jul 24, 2018 1:55 pm

And updated in Reactor (try the new update filter to find it real quick :)).

Thanks Bryan!

User avatar
French_Fry
Fusionista
Posts: 323
Joined: Tue Aug 05, 2014 8:04 am
Location: Nashville, TN
Contact:

Re: [Submission] Redshift Camera Extractor Fuse

#5

Post by French_Fry » Wed Aug 22, 2018 11:54 am

Hey Bryan,
when you use the rs_CameraExtractor, do you then have to manually connect the translation, rotation through expressions in the camera node?

User avatar
Midgardsormr
Fusionator
Posts: 1053
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 1
Location: Los Angeles, CA, USA
Been thanked: 61 times
Contact:

Re: [Submission] Redshift Camera Extractor Fuse

#6

Post by Midgardsormr » Wed Aug 22, 2018 12:25 pm

Yes, you do. Here's a camera node with the expressions already set up:

Code: Select all

{
	Tools = ordered() {
		Camera3D1 = Camera3D {
			CtrlWZoom = false,
			NameSet = true,
			CurrentSettings = 6,
			CustomData = {
				Settings = {
					[1] = {
						Tools = ordered() {
							Camera3D1 = Camera3D {
								CtrlWZoom = false,
								NameSet = true,
								CustomData = {
								},
								Inputs = {
									AoV = Input { Value = 19.2642683071402, },
									["Stereo.Mode"] = Input { Value = FuID { "OffAxis" }, },
									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 = { 550, 214.5 } },
							}
						}
					},
					[6] = {
						Tools = ordered() {
							Camera3D1_8 = Camera3D {
								Inputs = {
									FLength = Input { Value = 49.0568334445481 },
									["Transform3DOp.Translate.Z"] = Input { Expression = "self.ImageInput.Metadata.Translate.Z" },
									ImagePlaneEnabled = Input { Value = 0 },
									AoV = Input {
										Value = 19.2642683071402,
										Expression = "self.ImageInput.Metadata.RSCameraFOV or self.ImageInput.Metadata['rs/camera/fov']"
									},
									AovType = Input { Value = 1 },
									["Transform3DOp.Rotate.Y"] = Input { Expression = "self.ImageInput.Metadata.Rotate.Y" },
									ApertureH = Input { Value = 0.9 },
									FilmGate = Input { Value = FuID { "HD" } },
									["Transform3DOp.Rotate.X"] = Input { Expression = "self.ImageInput.Metadata.Rotate.X" },
									["Transform3DOp.Translate.X"] = Input { Expression = "self.ImageInput.Metadata.Translate.X" },
									PlaneOfFocus = Input { Expression = "self.ImageInput.Metadata.RSCameraDOFFocusDistance or self.ImageInput.Metadata['rs/camera/DOFFocusDistance']" },
									FilmBack = Input { Value = 1 },
									["Transform3DOp.Rotate.RotOrder"] = Input { Value = FuID { "ZXY" } },
									["MtlStdInputs.MaterialID"] = Input { Value = 1 },
									["Stereo.Mode"] = Input { Value = FuID { "OffAxis" } },
									["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1 },
									["Transform3DOp.Translate.Y"] = Input { Expression = "self.ImageInput.Metadata.Translate.Y" },
									ApertureW = Input { Value = 1.6 },
									["Transform3DOp.Rotate.Z"] = Input { Expression = "self.ImageInput.Metadata.Rotate.Z" }
								},
								CtrlWZoom = false,
								ViewInfo = OperatorInfo { Pos = { 550, -676.5 } },
								CustomData = {
								},
								Name = "Camera3D1_8"
							}
						}
					}
				}
			},
			Inputs = {
				["Transform3DOp.Translate.X"] = Input { Expression = "self.ImageInput.Metadata.Translate.X", },
				["Transform3DOp.Translate.Y"] = Input { Expression = "self.ImageInput.Metadata.Translate.Y", },
				["Transform3DOp.Translate.Z"] = Input { Expression = "self.ImageInput.Metadata.Translate.Z", },
				["Transform3DOp.Rotate.RotOrder"] = Input { Value = FuID { "ZXY" }, },
				["Transform3DOp.Rotate.X"] = Input { Expression = "self.ImageInput.Metadata.Rotate.X", },
				["Transform3DOp.Rotate.Y"] = Input { Expression = "self.ImageInput.Metadata.Rotate.Y", },
				["Transform3DOp.Rotate.Z"] = Input { Expression = "self.ImageInput.Metadata.Rotate.Z", },
				AovType = Input { Value = 1, },
				AoV = Input {
					Value = 19.2642683071402,
					Expression = "self.ImageInput.Metadata.RSCameraFOV or self.ImageInput.Metadata['rs/camera/fov']",
				},
				FLength = Input { Value = 49.0568334445481, },
				PlaneOfFocus = Input { Expression = "self.ImageInput.Metadata.RSCameraDOFFocusDistance or self.ImageInput.Metadata['rs/camera/DOFFocusDistance']", },
				["Stereo.Mode"] = Input { Value = FuID { "OffAxis" }, },
				FilmBack = Input { Value = 1, },
				FilmGate = Input { Value = FuID { "HD" }, },
				ApertureW = Input { Value = 1.6, },
				ApertureH = Input { Value = 0.9, },
				ImagePlaneEnabled = Input { Value = 0, },
				["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, },
				["MtlStdInputs.MaterialID"] = Input { Value = 1, },
			},
			ViewInfo = OperatorInfo { Pos = { 550, 214.5 } },
		}
	},
	ActiveTool = "Camera3D1"
}

Just connect your rendered image to the ImageInput of the camera, and it should just work.

Disclaimers: Redshift recently updated their 3DS Max plug-in so it would output metadata, but the Max coordinate system is different. I haven't yet gone back in to adjust the fuse for Max renders. It has not been tested with Cinema4D.

User avatar
French_Fry
Fusionista
Posts: 323
Joined: Tue Aug 05, 2014 8:04 am
Location: Nashville, TN
Contact:

Re: [Submission] Redshift Camera Extractor Fuse

#7

Post by French_Fry » Wed Aug 22, 2018 12:42 pm

Beautiful! Works great. ( I'm testing from Maya RS renders. I've also finally gotten around to testing Cyrptomatte from RS renders. Still working through that... it's working, but I'm looking into the different crypto flavors.)

Thanks!