Welcome to WSL!

Make yourself at home, but before posting, please may I ask you to read the following topics.


Posting 101
Server space, screenshots, and you

Thank you!

PS. please pretty please:


Image

[Submission] Redshift Camera Extractor Fuse  [SUBMITTED]

Moderator: SecondMan

User avatar
Midgardsormr
Fusionator
Posts: 1920
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 18
Location: Los Angeles, CA, USA
Been thanked: 145 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:
You do not have the required permissions to view the files attached to this post.
Last edited by Midgardsormr on Tue May 26, 2020 6:44 pm, edited 1 time in total.

User avatar
SecondMan
Site Admin
Posts: 4546
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 28
Location: Vancouver, Canada
Been thanked: 128 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: 1920
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 18
Location: Los Angeles, CA, USA
Been thanked: 145 times
Contact:

Re: [Submission] Redshift Camera Extractor Fuse

#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:
You do not have the required permissions to view the files attached to this post.

User avatar
SecondMan
Site Admin
Posts: 4546
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 28
Location: Vancouver, Canada
Been thanked: 128 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: 346
Joined: Tue Aug 05, 2014 8:04 am
Location: Nashville, TN
Been thanked: 1 time
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: 1920
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 18
Location: Los Angeles, CA, USA
Been thanked: 145 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: 346
Joined: Tue Aug 05, 2014 8:04 am
Location: Nashville, TN
Been thanked: 1 time
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!

User avatar
sdhains
Posts: 23
Joined: Thu Dec 12, 2019 6:07 am
Contact:

Re: [Submission] Redshift Camera Extractor Fuse

#8

Post by sdhains » Wed Dec 18, 2019 1:33 pm

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

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

Re: [Submission] Redshift Camera Extractor Fuse

#9

Post by Midgardsormr » Wed Dec 18, 2019 1:53 pm

sdhains wrote:
Wed Dec 18, 2019 1:33 pm
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
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.
Last edited by Midgardsormr on Wed Dec 18, 2019 9:12 pm, edited 1 time in total.

User avatar
sdhains
Posts: 23
Joined: Thu Dec 12, 2019 6:07 am
Contact:

Re: [Submission] Redshift Camera Extractor Fuse

#10

Post by sdhains » Wed Dec 18, 2019 2:01 pm

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 :)

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

Re: [Submission] Redshift Camera Extractor Fuse

#11

Post by Midgardsormr » Wed Dec 18, 2019 2:34 pm

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.

User avatar
sdhains
Posts: 23
Joined: Thu Dec 12, 2019 6:07 am
Contact:

Re: [Submission] Redshift Camera Extractor Fuse

#12

Post by sdhains » Wed Dec 18, 2019 2:46 pm

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

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

Re: [Submission] Redshift Camera Extractor Fuse

#13

Post by Midgardsormr » Wed Dec 18, 2019 2:50 pm

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.

User avatar
SecondMan
Site Admin
Posts: 4546
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 28
Location: Vancouver, Canada
Been thanked: 128 times
Contact:

Re: [Submission] Redshift Camera Extractor Fuse

#14

Post by SecondMan » Wed Dec 18, 2019 6:10 pm

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

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

Re: [Submission] Redshift Camera Extractor Fuse

#15

Post by Midgardsormr » Wed Dec 18, 2019 9:12 pm

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.