Page 1 of 3

[Submission] Redshift Camera Extractor Fuse

Posted: Mon Jun 11, 2018 11:25 am
by Midgardsormr
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:

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Wed Jun 13, 2018 6:08 pm
by SecondMan
And submitted (with a change to the Atom filename) :cheer:

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Tue Jul 24, 2018 12:18 pm
by Midgardsormr
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:

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Tue Jul 24, 2018 1:55 pm
by SecondMan
And updated in Reactor (try the new update filter to find it real quick :)).

Thanks Bryan!

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Wed Aug 22, 2018 11:54 am
by French_Fry
Hey Bryan,
when you use the rs_CameraExtractor, do you then have to manually connect the translation, rotation through expressions in the camera node?

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Wed Aug 22, 2018 12:25 pm
by Midgardsormr
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.

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Wed Aug 22, 2018 12:42 pm
by French_Fry
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!

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Wed Dec 18, 2019 1:33 pm
by sdhains
this is incredible. thank you so much for making this :). I keep finding these gems by exploring WSL forums. its so addictive.

to be clear, the flow goes:

EXR with meta data -> RS Camera extractor -> Camera with expressions ?

Right now i'm testing this on a Redshift/c4D exported puzzlematte pass, and it says it is not finding the X offset parameter. possible that I didn't export metadata properly from c4d, or theres a c4d compatibility issue also. will keep investigating

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Wed Dec 18, 2019 1:53 pm
by Midgardsormr
sdhains wrote: Wed Dec 18, 2019 1:33 pmEXR with meta data -> RS Camera extractor -> Camera with expressions ?

Right now i'm testing this on a Redshift/c4D exported puzzlematte pass, and it says it is not finding the X offset parameter. possible that I didn't export metadata properly from c4d, or theres a c4d compatibility issue also. will keep investigating
Yes, that's the correct order of operations. When you view the RSCameraExtractor node and view the metadata, do you see new fields called Translate and Rotate containing tables with X, Y, and Z values?

Image

Apologies for my messy handwriting. Hope it's legible.

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Wed Dec 18, 2019 2:01 pm
by sdhains
Yep thats all there. Ah, i See from your photo that there is a way to look at metadata in the viewport. Awesome. So it turns out my images don't have any metadata so that is the problem. Will dig into redshift when I'm on my desktop and see if I can get that working.

Thank you :)

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Wed Dec 18, 2019 2:34 pm
by Midgardsormr
That's odd; I don't think it's possible to turn the metadata off if you render EXR.

edit: Unless you're using an old version of Redshift? I don't recall when they added the metadata, but it's been in there for a while.

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Wed Dec 18, 2019 2:46 pm
by sdhains
yeah i tested with houdini and it works fine, as expected. but for some reason metadata doesn't seem to happen by default with cinema 4d redshift? i am going to post of the redshift forums as i can't find anything in the manual.

Added in 1 minute 56 seconds:
Ah ok, so they responded quickly. FYI if anyone is trying to do this with Cinema 4D
You get metadata in C4D only when rendering in direct mode, everythign else is using the C4D mechanics for saving and C4D it’s ditching any metadata on save.

Cheers

A

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Wed Dec 18, 2019 2:50 pm
by Midgardsormr
Good to know; thanks!

edit: I glanced at the question you posted at Redshift. You should be able to get the necessary metadata by making a very small and low-quality render. It shouldn't make a difference, but I'd keep the aspect ratio the same as your full-size render, just in case.

I gave the same answer there, for the benefit of anyone not watching both places.

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Wed Dec 18, 2019 6:10 pm
by SecondMan
Midgardsormr wrote: Wed Dec 18, 2019 1:53 pmApologies for my messing handwriting.
Forget about the handwriting - what's that in your render? Looks intriguing :)

Re: [Submission] Redshift Camera Extractor Fuse

Posted: Wed Dec 18, 2019 9:12 pm
by Midgardsormr
Strictly speaking I shouldn't show that since it hasn't aired yet, but it was the closest Redshift render to hand. And lacking any context, it's safe enough. ;)

It's FumeFX—the colors came from the plate projected onto the initial state voxels, plus some strong back light.