<?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: Custom Transform Node &amp;amp; xform in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10928219#M3866</link>
    <description>&lt;P&gt;When you retrieve world-space rotation using xform it takes the rotation channel and multiplies it by the rotation extracted from the (decomposed) exclusiveMatrix.&lt;BR /&gt;&lt;BR /&gt;In the other case you are extracting the rotation from the (decomposed) inclusiveMatrix. They are different calculations so saying one is more correct than the other is a bit like comparing apples to oranges.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are infinitely many ways to decompose a 4x4 matix. Especially when you start introducing non-uniform scaling which can introduce skew which gets tangled up with rotation in the 4x4 matrix.&lt;BR /&gt;&lt;BR /&gt;A good reference for all the various ways that you can permute common transformations is "Transformation Identities" by Ned Greene in Graphics Gems I.&lt;BR /&gt;e.g.&lt;BR /&gt;"a rotation can be expressed as 3 skews"&lt;BR /&gt;"a skew can be expressed as two rotations and a scale"&lt;BR /&gt;"anisotropic scaling following rotation introduces skew"&lt;/P&gt;</description>
    <pubDate>Fri, 04 Feb 2022 10:34:40 GMT</pubDate>
    <dc:creator>brentmc</dc:creator>
    <dc:date>2022-02-04T10:34:40Z</dc:date>
    <item>
      <title>Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10495112#M3835</link>
      <description>&lt;P&gt;Is it possible to add a rotation offset to a custom transform node while making the rest of maya be aware of it? I get the following issues with it:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Getting the transform's world rotation using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;xform&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;doesn't work, it always return without the offset. I couldn't find what else I need to override in my node to make it work. The default&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;joint&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;hikEffector&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;both have extra pre-rotation/offset, and they do return the correct results, so there must be a way to do it.&amp;nbsp;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;maya.cmds.xform(obj,&amp;nbsp;query=True,&amp;nbsp;rotation=True,&amp;nbsp;worldSpace=True)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;Using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Modify-&amp;gt;Match Transformations-&amp;gt;Match Rotation&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;command also fails to take the offset into account. It might be related to issue #1 using xform.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Is there some documentation somewhere what those commands expects to make them aware of the new rotation offset?&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jul 2021 22:13:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10495112#M3835</guid>
      <dc:creator>chirieacam</dc:creator>
      <dc:date>2021-07-25T22:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10495977#M3836</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Are you using the rockingTransform SDK example to model your custom transform?&lt;BR /&gt;&lt;BR /&gt;If so you might want to try the following changes as I think the custom rotation should be applied in asRotateMatrix() and not in asMatrix().&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;DIV id="1621360196.003900" class="c-virtual_list__item" tabindex="-1" role="listitem" aria-expanded="false" data-qa="virtual-list-item"&gt;
&lt;DIV class="c-message_kit__background p-message_pane_message__message c-message_kit__message p-message_pane_message__message--showing_context_bar" role="document" data-qa="message_container" data-qa-unprocessed="false" data-qa-placeholder="false"&gt;
&lt;DIV class="c-message_kit__hover" role="document" data-qa-hover="true"&gt;
&lt;DIV class="c-message_kit__actions c-message_kit__actions--default"&gt;
&lt;DIV class="c-message_kit__gutter"&gt;
&lt;DIV class="c-message_kit__gutter__right" data-qa="message_content"&gt;
&lt;DIV class="c-message_kit__blocks c-message_kit__blocks--rich_text"&gt;
&lt;DIV class="c-message__message_blocks c-message__message_blocks--rich_text"&gt;
&lt;DIV class="p-block_kit_renderer" data-qa="block-kit-renderer"&gt;
&lt;DIV class="p-block_kit_renderer__block_wrapper p-block_kit_renderer__block_wrapper--first"&gt;
&lt;DIV class="p-rich_text_block" dir="auto"&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;//&lt;BR /&gt;// This method will be used to return information to&lt;BR /&gt;// Maya.  Use the attributes which are outside of&lt;BR /&gt;// the regular transform attributes to build a new&lt;BR /&gt;// matrix.  This new matrix will be passed back to&lt;BR /&gt;// Maya.&lt;BR /&gt;//&lt;BR /&gt;MMatrix rockingTransformMatrix::asMatrix() const&lt;BR /&gt;{&lt;BR /&gt;	// Note: rocking rotation is handled in asRotateMatrix method&lt;BR /&gt;	return ParentClass::asMatrix();&lt;BR /&gt;}&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV id="1621360214.004100" class="c-virtual_list__item" tabindex="-1" role="listitem" aria-expanded="false" data-qa="virtual-list-item"&gt;
&lt;DIV class="c-message_kit__background c-message_kit__background--hovered p-message_pane_message__message c-message_kit__message p-message_pane_message__message--showing_context_bar" role="document" data-qa="message_container" data-qa-unprocessed="false" data-qa-placeholder="false"&gt;
&lt;DIV class="c-message_kit__hover c-message_kit__hover--hovered" role="document" data-qa-hover="true"&gt;
&lt;DIV class="c-message_kit__actions c-message_kit__actions--above"&gt;
&lt;DIV class="c-message_kit__gutter"&gt;
&lt;DIV class="c-message_kit__gutter__left"&gt;
&lt;DIV class="p-message_pane_message__compact_timestamp p-message_pane_message__compact_timestamp--light p-message_pane_message__compact_timestamp--adjacent"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="c-message_kit__gutter__right" data-qa="message_content"&gt;
&lt;DIV class="c-message_kit__blocks c-message_kit__blocks--rich_text"&gt;
&lt;DIV class="c-message__message_blocks c-message__message_blocks--rich_text"&gt;
&lt;DIV class="p-block_kit_renderer" data-qa="block-kit-renderer"&gt;
&lt;DIV class="p-block_kit_renderer__block_wrapper p-block_kit_renderer__block_wrapper--first"&gt;
&lt;DIV class="p-rich_text_block" dir="auto"&gt;
&lt;PRE class="c-mrkdwn__pre" data-stringify-type="pre"&gt;MMatrix	rockingTransformMatrix::asRotateMatrix() const&lt;BR /&gt;{&lt;BR /&gt;	MTransformationMatrix tm;&lt;BR /&gt;	tm.setRotatePivot(rotatePivot(), MSpace::kTransform, /*balance*/false);&lt;BR /&gt;	tm.setRotatePivotTranslation(rotatePivotTranslation(), MSpace::kTransform);&lt;BR /&gt;	tm.rotateTo(rotation());	DegreeRadianConverter conv;&lt;BR /&gt;	double newTheta = conv.degreesToRadians( getRockInX() );&lt;BR /&gt;	MQuaternion quat; quat.setToXAxis( newTheta );&lt;BR /&gt;	// Apply the rocking rotation to the existing rotation&lt;BR /&gt;	tm.addRotationQuaternion( quat.x, quat.y, quat.z, quat.w, MSpace::kTransform );&lt;BR /&gt;	// Let Maya know what the matrix should be&lt;BR /&gt;	return tm.asMatrix();&lt;BR /&gt;}&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;--&lt;/P&gt;
&lt;P&gt;Brent&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 09:45:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10495977#M3836</guid>
      <dc:creator>brentmc</dc:creator>
      <dc:date>2021-07-26T09:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496181#M3837</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1220770"&gt;@brentmc&lt;/a&gt;&amp;nbsp;for replying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried what you said: used the &lt;EM&gt;rockingTransform&lt;/EM&gt; example and moved the custom rotation to&lt;STRONG&gt; asRotateMatrix()&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Unfortunately it still doesn't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Modify-&amp;gt;Match Transformations-&amp;gt;Match Rotation&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;maya.cmds.xform(obj,&amp;nbsp;query=True,&amp;nbsp;rotation=True,&amp;nbsp;worldSpace=True)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;still doesn't take notice of the extra rotation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any other ideas I can try?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 11:12:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496181#M3837</guid>
      <dc:creator>chirieacam</dc:creator>
      <dc:date>2021-07-26T11:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496734#M3838</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately it appears that those commands are explicitly taking jointOrient into account so I don't think you will be able to get them to work with your custom transform in their current form.&lt;BR /&gt;&lt;BR /&gt;We are aware of some limitations with custom transforms (trying to replicate joint-like rotation offsets) so I will log an issue for this.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;--&lt;/P&gt;
&lt;P&gt;Brent&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 14:36:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496734#M3838</guid>
      <dc:creator>brentmc</dc:creator>
      <dc:date>2021-07-26T14:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496784#M3839</link>
      <description>&lt;P&gt;Oh, I see... But that means that those commands also takes into account the pre-rotation of the&amp;nbsp;&lt;STRONG&gt;hikEffector&lt;/STRONG&gt;? HumanIK seems to be a plugin, so I was thinking that wouldn't be hardcoded into those commands. It is possible that HumanIK makes it work somehow?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If indeed there's nothing we can do, I'll have to continue to use the joint and its jointOrient/parentOffsetMatrix/inverseScale to have pre-transform values.&lt;/P&gt;&lt;P&gt;But there is an issue with that: &lt;STRONG&gt;inverseScale&amp;nbsp;&lt;/STRONG&gt;acts like a parent scale, so if I rotate the object while having non-uniform scaling, the objects gets skewed.&lt;/P&gt;&lt;P&gt;Is it possible to fix that somehow, applying the scale after the rotation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All of this is to use constraints without having the channels locked, and without using extra offsets nodes. Using the joint's extra pre-transform attributes works pretty good, except for non-uniform scaling because of how inverseScale works.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 14:52:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496784#M3839</guid>
      <dc:creator>chirieacam</dc:creator>
      <dc:date>2021-07-26T14:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496850#M3840</link>
      <description>&lt;P&gt;Actually it seems the&amp;nbsp;&lt;STRONG&gt;hikEffector&lt;/STRONG&gt;'s pre-rotation is only used for xform. Match Rotation doesn't work for it either.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 15:19:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496850#M3840</guid>
      <dc:creator>chirieacam</dc:creator>
      <dc:date>2021-07-26T15:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496895#M3841</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The hikEffector derives directly from Maya's Ttransform class and is using a preRotation (which is effectively the same as jointOrient) that is not exposed through MPxTransform. (and this is the limitation I mentioned in my last reply)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for inverseScale. Each joint's inverseScale is directly connected to its parent's scaling attribute. Have you tried removing that connection in the Node Editor? (though I admit this is not my area of expertise)&lt;/P&gt;
&lt;P&gt;--&lt;/P&gt;
&lt;P&gt;Brent&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 15:34:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496895#M3841</guid>
      <dc:creator>brentmc</dc:creator>
      <dc:date>2021-07-26T15:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496923#M3842</link>
      <description>&lt;P&gt;Match rotation (which is a fairly recent addition to Maya) is based on the orient constraint so I'm guessing that won't work either and we will need to update the match rotation command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;--&lt;/P&gt;
&lt;P&gt;Brent&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 15:48:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496923#M3842</guid>
      <dc:creator>brentmc</dc:creator>
      <dc:date>2021-07-26T15:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496960#M3843</link>
      <description>&lt;P&gt;Oh, then indeed, exposing that preRotation to&amp;nbsp;&lt;SPAN&gt;MPxTransform would be great.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As for the inverseScale, yes, I don't have it connected to another joint. I'm connecting it to an object I want to match the scale from. Since it's an inverse, I divide each value from 1 (1 / scaleValue). Here's an example (both cubes should be the same, but the one under the joint is skewed if the joint is rotated):&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joint_inverseScale.jpg" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/945214i931F06B86E13DB5C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="joint_inverseScale.jpg" alt="joint_inverseScale.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 16:03:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10496960#M3843</guid>
      <dc:creator>chirieacam</dc:creator>
      <dc:date>2021-07-26T16:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10504883#M3844</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have a simple example script or scene shwoing the hikEffector match rotation issue that I could attach to the issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, can you describe in more detail the workflow. e.g. are you trying to match the hikEffector to another hikEffector or a different transform/joint?&lt;BR /&gt;&lt;BR /&gt;Just want to make sure we have good repro steps.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;
&lt;P&gt;--&lt;/P&gt;
&lt;P&gt;Brent&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 10:15:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10504883#M3844</guid>
      <dc:creator>brentmc</dc:creator>
      <dc:date>2021-07-29T10:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10506712#M3845</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a little script to be run in an empty scene. I think that's clear enough.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import maya.cmds as cmds

effector = cmds.createNode('hikEffector')
cmds.setAttr(effector + '.preRotationX', 45)

cube = cmds.polyCube()[0]
cmds.matchTransform(cube, effector)

print cmds.xform(effector, query=True, rotation=True, worldSpace=True)
print cmds.xform(cube, query=True, rotation=True, worldSpace=True)

# result:
# [45.000000000000014, 0.0, 0.0]
# [0.0, 0.0, 0.0] - should be as above&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 29 Jul 2021 21:38:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10506712#M3845</guid>
      <dc:creator>chirieacam</dc:creator>
      <dc:date>2021-07-29T21:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10507788#M3846</link>
      <description>&lt;P&gt;Thanks for the script, it was very helpful.&lt;BR /&gt;&lt;BR /&gt;Also wanted to mention that you can workaround this by applying a temporary orient constraint and then deleting it right after.&lt;BR /&gt;&lt;BR /&gt;Note: The orientConstraint is connecting the preRotation on the hikEffector into the jointOrient attribute on the constraint which is why it works there while matchTransform was only looking for jointOrient.&lt;/P&gt;
&lt;P&gt;--&lt;/P&gt;
&lt;P&gt;Brent&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 09:31:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10507788#M3846</guid>
      <dc:creator>brentmc</dc:creator>
      <dc:date>2021-07-30T09:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10910432#M3847</link>
      <description>&lt;P&gt;For anyone interested, the 2022.3 Update fixes the match transform problem and also makes the pre-rotation available&amp;nbsp;&lt;A href="https://help.autodesk.com/view/MAYAUL/2022/ENU/?guid=Maya_SDK_What_s_New_What_s_Changed_2022_3_Whats_New_in_API_html" target="_blank"&gt;https://help.autodesk.com/view/MAYAUL/2022/ENU/?guid=Maya_SDK_What_s_New_What_s_Changed_2022_3_Whats_New_in_API_html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Awesome! Thanks to anyone who listened and did this.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 13:30:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10910432#M3847</guid>
      <dc:creator>chirieacam</dc:creator>
      <dc:date>2022-01-27T13:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10910787#M3848</link>
      <description>&lt;P&gt;You're welcome!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My team worked on both those issues and we appreciate your feedback in bringing them to our attention!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 15:16:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10910787#M3848</guid>
      <dc:creator>brentmc</dc:creator>
      <dc:date>2022-01-27T15:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10915669#M3849</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1220770"&gt;@brentmc&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I attempted to make use of the new classes, but there's still an issue. I've used the rockingTransform example that is using the newly PreRotation classes, but the xform still doesn't return the pre-rotation:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;cmds.xform('rockingTransform', query=True, rotation=True, worldSpace=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The rotate manipulator and the match transform command are working, which is great. Is this a new issue, or there's something extra I need to do that the rockingTransform doesn't do?&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jan 2022 18:16:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10915669#M3849</guid>
      <dc:creator>chirieacam</dc:creator>
      <dc:date>2022-01-29T18:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10915742#M3850</link>
      <description>&lt;P&gt;I've also added a &lt;STRONG&gt;pre-translation&lt;/STRONG&gt; and &lt;STRONG&gt;pre-scale&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;xform&lt;/STRONG&gt; returns those extra pre-values when retrieving the matrix or scale:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;cmds.xform('rockingTransform', query=True, matrix=True, worldSpace=True)
cmds.xform('rockingTransform', query=True, scale=True, worldSpace=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;But the translation and rotation are ignored:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;cmds.xform('rockingTransform', query=True, translation=True, worldSpace=True)
cmds.xform('rockingTransform', query=True, rotation=True, worldSpace=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've added the values in &lt;STRONG&gt;MPxTransformationMatrixPreRotation::asMatrix.&lt;/STRONG&gt; Should we do extra things in other functions for translation and rotation to be retrieved correctly using xform?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jan 2022 19:41:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10915742#M3850</guid>
      <dc:creator>chirieacam</dc:creator>
      <dc:date>2022-01-29T19:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10916201#M3851</link>
      <description>&lt;P&gt;I've also tested the match transform command and that also doesn't work with pre-translation and pre-scale. It seems that xform and match transform command doesn't read the values from the matrix returned by &lt;STRONG&gt;asMatrix()&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jan 2022 04:38:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10916201#M3851</guid>
      <dc:creator>chirieacam</dc:creator>
      <dc:date>2022-01-30T04:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10918067#M3852</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, not all the issues with custom transforms are addressed in 2022.3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The additional fixes shown below also need to be applied to the rockingTransform example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) move the preRotation calculations from asMatrix to asRotateMatrix&lt;BR /&gt;2) override setRotatePivot&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;MMatrix rockingTransformMatrix::asMatrix() const
{
	return ParentClass::asMatrix();
}

MMatrix	rockingTransformMatrix::asRotateMatrix() const
{
	MMatrix Ro = rotateOrientationValue.asMatrix();
	MMatrix R  = rotationValue.asMatrix();
	MMatrix Rr = preRotation().asMatrix();

	MMatrix Rt;
	Rt[3][0] = rotatePivotTranslationValue.x;
	Rt[3][1] = rotatePivotTranslationValue.y;
	Rt[3][2] = rotatePivotTranslationValue.z;

	MMatrix Rp;
	Rp[3][0] = rotatePivotValue.x;
	Rp[3][1] = rotatePivotValue.y;
	Rp[3][2] = rotatePivotValue.z;

	MMatrix RpInv;
	RpInv[3][0] = -rotatePivotValue.x;
	RpInv[3][1] = -rotatePivotValue.y;
	RpInv[3][2] = -rotatePivotValue.z;

	return (RpInv * Ro * R * Rr * Rp * Rt);
}

MStatus rockingTransformMatrix::setRotatePivot(const MPoint &amp;amp;rotatePivot, MSpace::Space space, bool balance)
{
	MPoint newPivot(rotatePivot);
	if (space != MSpace::kTransform) {
		if (space == MSpace::kPostTransform) {
			newPivot *= asMatrixInverse();
		}
		newPivot *= asScaleMatrix();
	}

	if (balance) {
		MMatrix Ro = rotateOrientationValue.asMatrix();
		MMatrix R = rotationValue.asMatrix();
		MMatrix Rr = preRotation().asMatrix();

		MMatrix Rp;
		Rp[3][0] = newPivot.x;
		Rp[3][1] = newPivot.y;
		Rp[3][2] = newPivot.z;

		MMatrix RpInv;
		RpInv[3][0] = -newPivot.x;
		RpInv[3][1] = -newPivot.y;
		RpInv[3][2] = -newPivot.z;

		MMatrix leftMat = RpInv * Ro * R * Rr * Rp;

		MMatrix mat = leftMat.inverse() * asRotateMatrix();

		rotatePivotTranslationValue[0] = mat[3][0];
		rotatePivotTranslationValue[1] = mat[3][1];
		rotatePivotTranslationValue[2] = mat[3][2];
	}

	rotatePivotValue = newPivot;
	return MS::kSuccess;
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps. Note: we are continuing to track issues in this area.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 11:25:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10918067#M3852</guid>
      <dc:creator>brentmc</dc:creator>
      <dc:date>2022-01-31T11:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10918095#M3853</link>
      <description>&lt;P&gt;Hi Brent,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for tips, will try those.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also moved the pre-rotation to asRotateMatrix since without it I couldn't move the object correctly in object-space. But, I did it differently, is there anything wrong in doing it like this?&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;MMatrix CustomTransformationMatrix::asRotateMatrix() const
{
    MMatrix mtx = ParentClass::asRotateMatrix();

    MTransformationMatrix tm(mtx);

    MQuaternion rot = rotateBuffer.asQuaternion();
    tm.addRotationQuaternion(rot.x, rot.y, rot.z, rot.w, MSpace::kTransform);

    return tm.asRotateMatrix();
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll play around with setRotatePivot and other methods to see if I can get xform to return rotate/translate/scale values for world space. But, even without those, I'm still happy. I can find some workarounds to the the xform issues since I'm not using it directly anyway, but wrapped around.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 11:45:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10918095#M3853</guid>
      <dc:creator>chirieacam</dc:creator>
      <dc:date>2022-01-31T11:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Transform Node &amp; xform</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10918244#M3854</link>
      <description>&lt;P&gt;One big question I have is why most of the methods to retrieve translation or rotation receive a&amp;nbsp;&lt;STRONG&gt;MSpace::kTransform&amp;nbsp;&lt;/STRONG&gt;instead of&amp;nbsp;&lt;STRONG&gt;MSpace::kWorld&amp;nbsp;&lt;/STRONG&gt;when xform is used with worldSpace set to true.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the jointOrient is basically the preRotation of the transform, is the joint implementation doing anything extra, maybe overriding a specific method when a world rotation is requested, or this is another issue that needs to be fixed internally?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe a little more details in what xform does/calls could help me find the right method to override.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 12:49:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/custom-transform-node-amp-xform/m-p/10918244#M3854</guid>
      <dc:creator>chirieacam</dc:creator>
      <dc:date>2022-01-31T12:49:29Z</dc:date>
    </item>
  </channel>
</rss>

