<?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: VRED 2024 - Python vrdTransformNode.setTranslation local mode in VRED Forum</title>
    <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13023378#M263</link>
    <description>&lt;P&gt;Sorry but maybe i didn't understand...&lt;/P&gt;
&lt;P&gt;The "Local Mode" Switch is to manage the transform manipulator while working in render window.&lt;/P&gt;
&lt;P&gt;It doesn't change the transformation of the object. i suppose only change the behavior the user interact while&amp;nbsp; graphically move objects.&lt;/P&gt;
&lt;P&gt;Via Api you should use&amp;nbsp;&lt;CODE class="sig-prename descclassname"&gt;&lt;SPAN class="pre"&gt;vrdTransformNode.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;CODE class="sig-name descname"&gt;&lt;SPAN class="pre"&gt;&lt;SPAN class="highlighted"&gt;setTranslation&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN class="sig-paren"&gt;(&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class="n"&gt;&lt;SPAN class="pre"&gt;translation&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN class="sig-paren"&gt;) if you want to set a transform on a specific node, so it&amp;nbsp;inherits transforms from the parent tree (it follow the parents transformation).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="sig-paren"&gt;Instead, if you need to input a global transformation, no matter the parent tree, you should use &lt;CODE class="sig-prename descclassname"&gt;&lt;SPAN class="pre"&gt;vrdTransformNode.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;CODE class="sig-name descname"&gt;&lt;SPAN class="pre"&gt;setWorldTranslation&lt;/SPAN&gt;&lt;/CODE&gt;(&lt;EM&gt;&lt;SPAN class="n"&gt;&lt;SPAN class="pre"&gt;translation&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="sig-paren"&gt;otherwise... i didn't understand what you need...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="sig-paren"&gt;Best&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="sig-paren"&gt;Chris&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 12:16:27 GMT</pubDate>
    <dc:creator>Christian_Garimberti</dc:creator>
    <dc:date>2024-09-16T12:16:27Z</dc:date>
    <item>
      <title>VRED 2024 - Python vrdTransformNode.setTranslation local mode</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13023123#M260</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there a way to set&amp;nbsp;&lt;SPAN class=""&gt;vrdTransformNode.&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;setTranslation&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;with the option we have in the editor to use "local mode"?&lt;/P&gt;&lt;P&gt;So we can move along the groups orientation?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 10:07:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13023123#M260</guid>
      <dc:creator>andreasK3K4G</dc:creator>
      <dc:date>2024-09-16T10:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: VRED 2024 - Python vrdTransformNode.setTranslation local mode</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13023198#M261</link>
      <description>&lt;P&gt;Hi, like written in the help.&amp;nbsp;&lt;SPAN class=""&gt;vrdTransformNode.&lt;/SPAN&gt;&lt;SPAN class=""&gt;setTranslation is in Local Mode.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Instead,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;CODE class="sig-prename descclassname"&gt;&lt;SPAN class="pre"&gt;vrdTransformNode.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;CODE class="sig-name descname"&gt;&lt;SPAN class="pre"&gt;setWorldTranslation&lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN class="sig-paren"&gt;(&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class="n"&gt;&lt;SPAN class="pre"&gt;translation&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN class="sig-paren"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class="sig-paren"&gt;Is for World Space&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class="sig-prename descclassname"&gt;&lt;SPAN class="pre"&gt;vrdTransformNode.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;CODE class="sig-name descname"&gt;&lt;SPAN class="pre"&gt;&lt;SPAN class="highlighted"&gt;setTranslation&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN class="sig-paren"&gt;(&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class="n"&gt;&lt;SPAN class="pre"&gt;translation&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN class="sig-paren"&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Sets the translation in local space.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 10:52:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13023198#M261</guid>
      <dc:creator>Christian_Garimberti</dc:creator>
      <dc:date>2024-09-16T10:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: VRED 2024 - Python vrdTransformNode.setTranslation local mode</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13023231#M262</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;setTranslation is in local space.&lt;/P&gt;&lt;P&gt;But i mean the option to switch to local mode, like the option in the GUI Transform Button.&lt;/P&gt;&lt;P&gt;So when the group has an modified rotation pivot, that i can put setTranslation(10,0,0) and&lt;/P&gt;&lt;P&gt;the group get moved along the modified x-axis.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 11:09:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13023231#M262</guid>
      <dc:creator>andreasK3K4G</dc:creator>
      <dc:date>2024-09-16T11:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: VRED 2024 - Python vrdTransformNode.setTranslation local mode</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13023378#M263</link>
      <description>&lt;P&gt;Sorry but maybe i didn't understand...&lt;/P&gt;
&lt;P&gt;The "Local Mode" Switch is to manage the transform manipulator while working in render window.&lt;/P&gt;
&lt;P&gt;It doesn't change the transformation of the object. i suppose only change the behavior the user interact while&amp;nbsp; graphically move objects.&lt;/P&gt;
&lt;P&gt;Via Api you should use&amp;nbsp;&lt;CODE class="sig-prename descclassname"&gt;&lt;SPAN class="pre"&gt;vrdTransformNode.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;CODE class="sig-name descname"&gt;&lt;SPAN class="pre"&gt;&lt;SPAN class="highlighted"&gt;setTranslation&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN class="sig-paren"&gt;(&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class="n"&gt;&lt;SPAN class="pre"&gt;translation&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN class="sig-paren"&gt;) if you want to set a transform on a specific node, so it&amp;nbsp;inherits transforms from the parent tree (it follow the parents transformation).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="sig-paren"&gt;Instead, if you need to input a global transformation, no matter the parent tree, you should use &lt;CODE class="sig-prename descclassname"&gt;&lt;SPAN class="pre"&gt;vrdTransformNode.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;CODE class="sig-name descname"&gt;&lt;SPAN class="pre"&gt;setWorldTranslation&lt;/SPAN&gt;&lt;/CODE&gt;(&lt;EM&gt;&lt;SPAN class="n"&gt;&lt;SPAN class="pre"&gt;translation&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="sig-paren"&gt;otherwise... i didn't understand what you need...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="sig-paren"&gt;Best&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="sig-paren"&gt;Chris&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 12:16:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13023378#M263</guid>
      <dc:creator>Christian_Garimberti</dc:creator>
      <dc:date>2024-09-16T12:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: VRED 2024 - Python vrdTransformNode.setTranslation local mode</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13023641#M264</link>
      <description>&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;thanks for the fast response. No worry, sometimes it is hard to describe.&lt;/P&gt;&lt;P&gt;The idea is to save me some line of code, cause i guess it is already inside of VRED.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lets start from zero:&lt;/P&gt;&lt;P&gt;1. I have a line in VRED which present my direction vector. This line should be the new rotation axis.&lt;/P&gt;&lt;P&gt;2. My script is calculating the direction vector and set the rotation pivot orientation for the group the user wants to animate.&lt;/P&gt;&lt;P&gt;3. The user can now put in a value and choose the axis, and the group gets rotated around the new axis.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; The script can directly use&amp;nbsp;anim_group.setRotationAsEuler(QVector3D(0,0,33))&amp;nbsp; (for example)&lt;/P&gt;&lt;P&gt;4. The user wants to move the group along the new axis, just typing in a value an choosing the axis.&lt;/P&gt;&lt;P&gt;5. Now it would be nice, to directly use&amp;nbsp;anim_group.setTranslation(QVector3D(50,0,0)) (for example)&lt;/P&gt;&lt;P&gt;But for sure, it takes the local space and not along the custom axis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can write a function to get the new position with a given vector and a distance. I guess this is what happens anyway internal when the user use local mode in viewport. So it calculates the direction vector from the rotation pivot orientation values? and sets the new postion x,y,z with a proper math function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So at the end it is just the question or as far i can imagine from your answers, more like a "nice to have", setRotationAsEuler takes the&amp;nbsp;rotation pivot orientation into account, is setTranslation able to do aswell?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe it is just me who needs this to save some line of code. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&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="translate_mode_.png" style="width: 389px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1409702iDC9F0DEBCE431C7D/image-size/large?v=v2&amp;amp;px=999" role="button" title="translate_mode_.png" alt="translate_mode_.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 13:56:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13023641#M264</guid>
      <dc:creator>andreasK3K4G</dc:creator>
      <dc:date>2024-09-16T13:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: VRED 2024 - Python vrdTransformNode.setTranslation local mode</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13040539#M265</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6639038"&gt;@andreasK3K4G&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yes, in local mode the translation vector is essentially rotated. We can use the quaternion (QQuaternion) representation of the rotation and pivot rotation to get the rotated vector:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;b = vrScenegraphService.getSelectedNode()
qr = b.getRotationAsQuaternion()
qro = b.getRotationOrientationAsQuaternion()
tr = (qr * qro).rotatedVector( QVector3D(100,0,0))
t = b.getTranslation()
b.setTranslation( tr + t) # or just tr&lt;/LI-CODE&gt;
&lt;P&gt;Using this, the object moves along its "local" x-axis, for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 08:20:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13040539#M265</guid>
      <dc:creator>sinje_thiedemann</dc:creator>
      <dc:date>2024-09-24T08:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: VRED 2024 - Python vrdTransformNode.setTranslation local mode</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13040778#M266</link>
      <description>&lt;P&gt;Thank you, works perfect!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 10:23:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-vrdtransformnode-settranslation-local-mode/m-p/13040778#M266</guid>
      <dc:creator>andreasK3K4G</dc:creator>
      <dc:date>2024-09-24T10:23:34Z</dc:date>
    </item>
  </channel>
</rss>

