{"id":184,"date":"2014-07-05T21:11:55","date_gmt":"2014-07-06T02:11:55","guid":{"rendered":"http:\/\/sugarandcyanide.com\/blog\/?p=184"},"modified":"2014-07-05T21:11:55","modified_gmt":"2014-07-06T02:11:55","slug":"aimconstraints-with-no-up-vector","status":"publish","type":"post","link":"http:\/\/sugarandcyanide.com\/blog\/2014\/07\/05\/aimconstraints-with-no-up-vector\/","title":{"rendered":"aimConstraints with no up vector"},"content":{"rendered":"<p>I&#8217;m pretty good about looking at the docs for nodes I use in Maya, because often there&#8217;s hidden functionality or switches that make nodes behave completely differently, and these things are often not apparent.  A good example is on the extendCurve node&#8211; there&#8217;s a &#8220;join&#8221; attribute that&#8217;s completely hidden, but I found that setting it to zero was the difference between having a useful node and not.<\/p>\n<p>A few weeks ago I discovered, much to my embarrassment, that I had not done my homework on aimConstraints.  It turns out that the aimConstraint node&#8217;s up vector type can be set to &#8220;none&#8221;, which converts the aimConstraint into a quaternion-slerp-based orienter.  This means that whatever you&#8217;ve picked will still aim at the target, but it won&#8217;t twist on the aim axis relative to the parent transform.<\/p>\n<p>This is a lot like the SingleChainIK solver, but it has one important benefit: Not being an IK solver.  IK solvers \/ handles in Maya have some very strange and esoteric bugs that don&#8217;t show themselves in every situation or even on every show, but when they hit, they hit hard.  The more I use Maya, the more I find that skipping an IK handle wherever possible is the Right Thing.<\/p>\n<p>The SingleChain solver is extremely useful for a variety of setups, but one problem I&#8217;ve encountered is that the handle itself doesn&#8217;t like to be scaled.  I had some rigs where if the character were scaled below 0.5 or above 2.0, Maya would freeze for a few seconds and the SC solver would be broken once that number was passed.  I fixed the issue by moving the IK handle into a group outside the hierarchy and pointConstraining it to the IK goal object, but the extra work bugged me.  With an up-vectorless aimConstraint, I can remove a few extra transforms.<\/p>\n<p>Another interesting node is that the RPSolver behaves exactly the same as both the SCSolver and the up-vectorless aimConstraint if its poleVector attribute is set to (0,0,0), and the solver is operating on a single bone chain.  Not sure what use this is, but it&#8217;s in there.<\/p>\n<p>How about an example use?<\/p>\n<p><center><br \/>\n<a href=\"http:\/\/sugarandcyanide.com\/blog\/files\/aimConstraintNoUpVector\/arm_example.ma\"><img decoding=\"async\" src=\"http:\/\/sugarandcyanide.com\/blog\/files\/aimConstraintNoUpVector\/aimConstraintNoUpVector_arm_01.png\" alt=\"arm with pole chain\" \/><br \/>( download example .ma )<\/a><br \/>\n<\/center><\/p>\n<p>Adding an SCsolver chain from the shoulder to the wrist (aimed at the wrist control), then using it to move the pole vector around, can often be a very good way to extend the reach of a character&#8217;s IK arms without forcing the animator to constantly move the pole vector control.  Give it a go&#8211; you&#8217;ll see what I mean.  This setup doesn&#8217;t work on legs, depending on the animator, but for arms it&#8217;s not bad and with space switching you can still have the standard pole vector placement behind the chest if so desired.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m pretty good about looking at the docs for nodes I use in Maya, because often there&#8217;s hidden functionality or switches that make nodes behave completely differently, and these things are often not apparent. A good example is on the extendCurve node&#8211; there&#8217;s a &#8220;join&#8221; attribute that&#8217;s completely hidden, but I found that setting it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,13,16],"tags":[],"class_list":["post-184","post","type-post","status-publish","format-standard","hentry","category-3d","category-maya","category-rigging"],"_links":{"self":[{"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/posts\/184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/comments?post=184"}],"version-history":[{"count":0,"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/posts\/184\/revisions"}],"wp:attachment":[{"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/media?parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/categories?post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sugarandcyanide.com\/blog\/wp-json\/wp\/v2\/tags?post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}