katana_constraint_offset

Constraining things in Katana works well, but can seem somewhat limited if you are coming from a full-featured 3D application. One of the things that can potentially give you headaches is a missing option for “maintaining offset” when you are constraining one object or a lightrig to something else. While this is generally not an issue when you are doing LookDev (as your assets most likely have zero’d out transforms) it can be a bit frustrating to not have that option when you are working on shots, so here’s my hacky way of maintaining constraint-offsets.

Every now and then you have to constraint lights to an object in your scene. Generally the best practice is to create a rig in the Gaffer node and constraint it before adding any lights. That way you don’t have to worry about fixing anything later. If you are a day-dreamer like me however it may happen that you add a rig and all your lights to your object before you constraint anything:
01_KatanaScene

 

Consequently when you come to the point of constraining your parent rig (which was most likely in the origin) will move to your constraint target and offset all the carefully placed lights you just created:

02_PCC

 

Bummer… However luckily with a few steps you can re-center your rig to where it was before constraining it.
To do that first of all add a ConstraintResolve Node. This will convert the constraint data into a matrix to give you the actual world-space position. The resulting numbers for the matrix visible in the Attributes-Tab may not really be too much of a help right off the bat. You can add a TransformEdit Node and plug in your constrained rig into the path to to show you the actual transforms:
03_CR_xformEdit

 

Now that you know where your rig has been moved to you can reverse this transformation. There are a couple of ways to do that but I personally like to do it in a separate rig:
-Add a new child-rig to the rig you have constrained to your object and move all your lights below it
-Copy over the transform values from your TransformEdit Node to your constraintOffset rig and negate them (-22 becomes 22 // 749 becomes -749 // etc.)
-Inverse the transformOrder (Scale Rotate Translate becomes Translate Rotate Scale, etc.) and the rotationOrder (XYZ becomes ZYX, etc.). This is assuming you have used the defaults in your rig – adjust them if you have used different orders.

This way your constraintOffset rig should be perfectly centered out again and your lights should be where they belong:
04_constraintOffset

 

 

 

 
_________________________________________________
If this post has helped you in any way you can express your gratefulness by using the Donate Button below to buy me a coffee! :)

3M5xNSV7g2NzVpHMqzYKhgoKJZ8CWa644m
bc_ldgr_qrcode