<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting XYZ Rotation Data from an IK Bone in 3ds Max Animation and Rigging Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9784589#M2597</link>
    <description>&lt;P&gt;I'm still learning how to work with Max matrices but here's a script that might yield the results you need.&amp;nbsp; The angles output are the relative angles&amp;nbsp; of rotation (in degrees) of the lower arm with respect to the upper arm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;ua = $UpperArm.transform
la = $LowerArm.transform
XYZrot =  (la * inverse(ua)) as eulerangles
format "\nX Y Z rotation = %" XYZrot&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Oct 2020 14:44:21 GMT</pubDate>
    <dc:creator>leeminardi</dc:creator>
    <dc:date>2020-10-05T14:44:21Z</dc:date>
    <item>
      <title>Getting XYZ Rotation Data from an IK Bone</title>
      <link>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9783475#M2596</link>
      <description>&lt;P&gt;Let's say I made a typical simple arm joint (UpperArm, LowerArm, Hand), linked as a hierarchy, and assign them an IK Limb Solver.&lt;/P&gt;&lt;P&gt;As I manipulate the IK, What's the best way to access the XYZ Rotations of the LowerArm (in parent space) through a Script Controller in real time?&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"in coordsys parent (LowerArm.transform.rotation.z)"&lt;/P&gt;&lt;P&gt;but that produces world space rotation data.&lt;/P&gt;&lt;P&gt;The only solution I came up with was to make an independent Helper Bone, assign it "orientation constraint" to the LowerArm Bone, set its constraint rules to Local-&amp;gt;Local. Then, I can read the axis data from that Helper Bone using a Float Script or an Expression Controller.&lt;/P&gt;&lt;P&gt;But, Is there a way to access the parent space XYZ Rotation data directly from the Bone in the IK system?&lt;/P&gt;</description>
      <pubDate>Sun, 04 Oct 2020 22:14:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9783475#M2596</guid>
      <dc:creator>joefearstone</dc:creator>
      <dc:date>2020-10-04T22:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Getting XYZ Rotation Data from an IK Bone</title>
      <link>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9784589#M2597</link>
      <description>&lt;P&gt;I'm still learning how to work with Max matrices but here's a script that might yield the results you need.&amp;nbsp; The angles output are the relative angles&amp;nbsp; of rotation (in degrees) of the lower arm with respect to the upper arm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;ua = $UpperArm.transform
la = $LowerArm.transform
XYZrot =  (la * inverse(ua)) as eulerangles
format "\nX Y Z rotation = %" XYZrot&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 14:44:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9784589#M2597</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2020-10-05T14:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Getting XYZ Rotation Data from an IK Bone</title>
      <link>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9785042#M2598</link>
      <description>&lt;P&gt;Thanks for the Reply!&lt;/P&gt;&lt;P&gt;Right, multiplying by the inverse of the parent should give local space rotation of an IK bone.&lt;/P&gt;&lt;P&gt;I had previously tried to implement this approach, but I'm too unfamiliar with the syntax to do it right.&lt;/P&gt;&lt;P&gt;So let's say I wanted an independent object to mimic the parent space Z rotation of the LowerArm.&lt;/P&gt;&lt;P&gt;I would assign a Script Controller to this independent object's Z rotation, and in the ScriptController window I would create variables "ua" and "la". I assign "ua" to the node "upperarm", and "la" to the node "lowerarm".&lt;/P&gt;&lt;P&gt;In the Expression window I should be able to go:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(la * inverse(ua))&lt;/P&gt;&lt;P&gt;But I get a "no inverse function for upperarm" error.&lt;/P&gt;&lt;P&gt;However, if I avoid setting "ua" and "la" in the Variable section, and make them directly in the Expression window as you have described, I get a different error, "unable to convert euler angles to type matrix"&lt;/P&gt;&lt;P&gt;I just can't tell if I'm doing something wrong or if I'm hitting limitations of the Script Controller.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, how would I set an independent object, or a slider, or whatever to extract only the local Z rotation Value of that LowerArm IK bone?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 18:16:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9785042#M2598</guid>
      <dc:creator>joefearstone</dc:creator>
      <dc:date>2020-10-05T18:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Getting XYZ Rotation Data from an IK Bone</title>
      <link>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9785653#M2599</link>
      <description>&lt;P&gt;I assigned the following transform script to boxA which will rotate to the angle equal to the z rotation of the lower arm relative to the upper arm.&amp;nbsp; lat is assigned to the transform of the lower arm bone.&amp;nbsp; I used the format statement to check the angle value.&amp;nbsp; I think this is what you wanted.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 681px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/827418iB4205F779ED1EAC3/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;rotationAngles = laT as eulerangles
format "\nrotation angles = % " rotationAngles
rotateZMatrix rotationAngles.z&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 03:02:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9785653#M2599</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2020-10-06T03:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Getting XYZ Rotation Data from an IK Bone</title>
      <link>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9785818#M2600</link>
      <description>&lt;P&gt;Leeminardi, you're a miracle worker. I've spent hours, and there was no way I would have ever found these mystery functions, how to use them, or which of the script controllers to use them in. With just this extracted data alone, one could make muscle bulgers, skin pushers, twister bones, etc...Who knows how many other wonder functions are hidden in these controllers, lost to time.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 05:22:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9785818#M2600</guid>
      <dc:creator>joefearstone</dc:creator>
      <dc:date>2020-10-06T05:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Getting XYZ Rotation Data from an IK Bone</title>
      <link>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9786472#M2601</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6290604"&gt;@joefearstone&lt;/a&gt;&amp;nbsp;thank you for the very kind words.&amp;nbsp; I'm glad that you will find the solution useful.&amp;nbsp; I have&amp;nbsp; to say that the script did not come to me immediately and was surprised that the final code is so concise.&lt;/P&gt;&lt;P&gt;I found the following links were helpful in dealing with matrices and rotations.&lt;/P&gt;&lt;P&gt;&lt;A href="http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help/index.html?url=files/GUID-D77C780A-4E8A-4528-949F-CC09AAE048DA.htm,topicNumber=d30e164623" target="_blank" rel="noopener"&gt;Matrix3 values&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help/index.html?url=files/GUID-D77C780A-4E8A-4528-949F-CC09AAE048DA.htm,topicNumber=d30e164623" target="_blank" rel="noopener"&gt;Euler Angles Values&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 11:35:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9786472#M2601</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2020-10-06T11:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting XYZ Rotation Data from an IK Bone</title>
      <link>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9787755#M2602</link>
      <description>&lt;P&gt;Awesome, thanks for the info!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 21:45:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-animation-and-rigging/getting-xyz-rotation-data-from-an-ik-bone/m-p/9787755#M2602</guid>
      <dc:creator>joefearstone</dc:creator>
      <dc:date>2020-10-06T21:45:51Z</dc:date>
    </item>
  </channel>
</rss>

