{"id":2409,"date":"2017-05-30T21:42:02","date_gmt":"2017-05-30T21:42:02","guid":{"rendered":"http:\/\/julius-ihle.de\/?p=2409"},"modified":"2018-04-04T08:38:39","modified_gmt":"2018-04-04T08:38:39","slug":"maintain-constraint-offset-in-katana","status":"publish","type":"post","link":"https:\/\/julius-ihle.de\/?p=2409","title":{"rendered":"Maintain Constraint Offset in Katana"},"content":{"rendered":"<p><a href=\"https:\/\/julius-ihle.de\/?p=2409\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-2420 size-full\" src=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/katana_constraint_offset1.jpg\" alt=\"katana_constraint_offset\" width=\"800\" height=\"333\" srcset=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/katana_constraint_offset1.jpg 1280w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/katana_constraint_offset1-300x125.jpg 300w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/katana_constraint_offset1-1024x426.jpg 1024w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>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 &#8220;maintaining offset&#8221; 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&#8217;d out transforms) it can be a bit frustrating to not have that option when you are working on shots, so here&#8217;s my hacky way of maintaining constraint-offsets.<!--more--><\/p>\n<p>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 <em>Gaffer<\/em> node and constraint it before adding any lights. That way you don&#8217;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:<br \/>\n<a href=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/01_KatanaScene.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2413\" src=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/01_KatanaScene.png\" alt=\"01_KatanaScene\" width=\"1316\" height=\"1016\" srcset=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/01_KatanaScene.png 1316w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/01_KatanaScene-300x232.png 300w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/01_KatanaScene-1024x791.png 1024w\" sizes=\"auto, (max-width: 1316px) 100vw, 1316px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>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:<\/p>\n<p><a href=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/02_PCC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2414\" src=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/02_PCC.png\" alt=\"02_PCC\" width=\"1316\" height=\"1016\" srcset=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/02_PCC.png 1316w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/02_PCC-300x232.png 300w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/02_PCC-1024x791.png 1024w\" sizes=\"auto, (max-width: 1316px) 100vw, 1316px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Bummer&#8230; However luckily with a few steps you can re-center your rig to where it was before constraining it.<br \/>\nTo do that first of all add a <em>ConstraintResolve<\/em> 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 <em>Attributes-Tab<\/em> may not really be too much of a help right off the bat. You can add a <em>TransformEdit<\/em> Node and plug in your constrained rig into the path to to show you the actual transforms:<br \/>\n<a href=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/03_CR_xformEdit.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2415\" src=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/03_CR_xformEdit.png\" alt=\"03_CR_xformEdit\" width=\"1316\" height=\"1016\" srcset=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/03_CR_xformEdit.png 1316w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/03_CR_xformEdit-300x232.png 300w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/03_CR_xformEdit-1024x791.png 1024w\" sizes=\"auto, (max-width: 1316px) 100vw, 1316px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>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:<br \/>\n-Add a new child-rig to the rig you have constrained to your object and move all your lights below it<br \/>\n-Copy over the transform values from your <em>TransformEdit<\/em> Node to your constraintOffset rig and negate them (-22 becomes 22 \/\/ 749 becomes -749 \/\/ etc.)<br \/>\n-Inverse the <em>transformOrder<\/em> (<em>Scale Rotate Translate<\/em> becomes <em>Translate Rotate Scale<\/em>, etc.) and the <em>rotationOrder<\/em> (<em>XYZ<\/em> becomes <em>ZYX<\/em>, etc.). This is assuming you have used the defaults in your rig &#8211; adjust them if you have used different orders.<\/p>\n<p>This way your constraintOffset rig should be perfectly centered out again and your lights should be where they belong:<br \/>\n<a href=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/04_constraintOffset.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2416\" src=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/04_constraintOffset.png\" alt=\"04_constraintOffset\" width=\"1316\" height=\"1016\" srcset=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/04_constraintOffset.png 1316w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/04_constraintOffset-300x232.png 300w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2017\/05\/04_constraintOffset-1024x791.png 1024w\" sizes=\"auto, (max-width: 1316px) 100vw, 1316px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<br \/>\n<span style=\"color: #808080;\">_________________________________________________<\/span><br \/>\n<span style=\"color: #808080;\"><span style=\"font-size: small;\"> If this post has helped you in any way you can express your gratefulness by using the <em>Donate\u00a0<\/em>Button below to buy me a coffee! :)<\/span><\/span><br \/>\n<a href=\"https:\/\/www.paypal.com\/cgi-bin\/webscr?cmd=_s-xclick&amp;hosted_button_id=VH5RW3YDWDJSQ\" target=\"_blank\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/www.paypal.com\/en_US\/i\/btn\/x-click-but21.gif\" alt=\"\" \/><\/a><\/p>\n<div class=\"moz-text-html\" lang=\"x-unicode\">\n<div><span style=\"font-size: small;\"><span style=\"color: #808080;\">3M5xNSV7g2NzVpHMqzYKhgoKJZ8CWa644m<\/span><\/span><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2576\" src=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2018\/03\/bc_ldgr_qrcode.png\" alt=\"bc_ldgr_qrcode\" width=\"128\" height=\"128\" \/><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8220;maintaining offset&#8221; when you are constraining one object or a lightrig to something else. While this is generally not an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[91,93,130,129,136,27,133,131,132,134,135,24,92,28],"class_list":["post-2409","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-cgi","tag-computer-graphics","tag-constraining","tag-constraints","tag-foundry","tag-katana","tag-orientconstraint","tag-parentchildconstraint","tag-pointconstraint","tag-transform","tag-transformation","tag-vfx","tag-visual-effects","tag-workflow"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3MXK6-CR","jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/julius-ihle.de\/index.php?rest_route=\/wp\/v2\/posts\/2409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/julius-ihle.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/julius-ihle.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/julius-ihle.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/julius-ihle.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2409"}],"version-history":[{"count":8,"href":"https:\/\/julius-ihle.de\/index.php?rest_route=\/wp\/v2\/posts\/2409\/revisions"}],"predecessor-version":[{"id":2589,"href":"https:\/\/julius-ihle.de\/index.php?rest_route=\/wp\/v2\/posts\/2409\/revisions\/2589"}],"wp:attachment":[{"href":"https:\/\/julius-ihle.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/julius-ihle.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/julius-ihle.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}