Extract Transforms from objects parent

   4474   5   2
User Avatar
Member
54 posts
Joined: Aug. 2010
Offline
Hey guys,

I'm looking to output my camera from houdini to nuke - not an issue in itself, but i need the camera to have its transforms accessible

The setup i have is as follows:

Bring in two tracks and cameras from PFtrack into seperate subnetworks
Transform the subnetworks to reposition everything
Blend node to go between these two tracks (keyframed sequence blend)
And finally my new camera parented at the end - meaning camera itself has no transforms

So i'm basically looking to take the transformation coming from the blend node, and reference that onto the final camera - rather than just parent. Seems like it would be simple if i only new the right button to press… !

Thanks,

~ Craig
~ Craig Tonks | CG Supervisor | Outpost VFX
User Avatar
Member
8535 posts
Joined: July 2007
Offline
you can either use Object CHOP to get camera's trasnsforms in world space then export them to unparented camera

or you can use origin() expression to extract world space transforms and put directly to unparented camera parameters

there is also Fetch Obj, but then you need to parent camera to it so it may not be what you need
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
54 posts
Joined: Aug. 2010
Offline
Excellent thanks so much, i'll give those a try
~ Craig Tonks | CG Supervisor | Outpost VFX
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
vtorigin(obj1, obj2) is the function you want. It returns a vector so you can follow it with square brackets to index in to the three vector components.
If you leave obj1 path blank, then the world space positoin of obj2 is returned which is what you want:

tx parm: vtorigin(“”, “/obj/my_cam”)
ty parm: vtorigin(“”, “/obj/my_cam”)
tz parm: vtorigin(“”, “/obj/my_cam”)

Use vrorigin(obj1, obj2) for rotates in the same way.

To get the entire transform matrix, look to the origin() function as mentioned above. This will give you translates, rotates and scales in one go. Hopefully you aren't scaling your camera…
There's at least one school like the old school!
User Avatar
Member
54 posts
Joined: Aug. 2010
Offline
Ah yes that works perfectly, knew there'd be a simple solution! many thanks to you both
~ Craig Tonks | CG Supervisor | Outpost VFX
User Avatar
Member
2 posts
Joined: March 2016
Offline
For clarification, if anyone doesn't understand what indexing is:

tx parm: vtorigin(“”,“/obj/mycam”)…'then 0 in square brackets'
ty parm: vtorigin(“”,“/obj/mycam”)…'then 1 in square brackets'
tz parm: vtorigin(“”,“/obj/mycam”)…'then 2 in square brackets'

rx parm: vrorigin(“”,“/obj/mycam”)…'then 0 in square brackets'
ry parm: vrorigin(“”,“/obj/mycam”)…'then 1 in square brackets'
rz parm: vrorigin(“”,“/obj/mycam”)…'then 2 in square brackets'

Side note: don't copy and paste code from a browser as the quotation marks can sometimes not be translated over correctly which will give you errors even though the code snipet may ‘look’ the same.
Edited by Dan de Carvalho - Aug. 7, 2018 04:15:50
  • Quick Links