<?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 VRED 2024, Python, Access to core attachments in VRED Forum</title>
    <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-access-to-core-attachments/m-p/12913820#M313</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i have some special case this time.&lt;/P&gt;&lt;P&gt;When have a (transform) node, Going to Transform-&amp;gt;RotationPivot. I can change the Alignment to "Direction Vector". (#1 in my picture)&lt;/P&gt;&lt;P&gt;Having a look to the node attribute editor, this will create a new attachment to the "core Transform3D (xxxxx)"&lt;/P&gt;&lt;P&gt;See picture #2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to create this attachment and access the values via python, in order to change the rotation pivot alignment to Direction Vector and add new values?&lt;/P&gt;&lt;P&gt;With field access attachment i can only reach the attachments directly under the node. (like "Name")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2024 06:53:56 GMT</pubDate>
    <dc:creator>andreasK3K4G</dc:creator>
    <dc:date>2024-07-23T06:53:56Z</dc:date>
    <item>
      <title>VRED 2024, Python, Access to core attachments</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-access-to-core-attachments/m-p/12913820#M313</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i have some special case this time.&lt;/P&gt;&lt;P&gt;When have a (transform) node, Going to Transform-&amp;gt;RotationPivot. I can change the Alignment to "Direction Vector". (#1 in my picture)&lt;/P&gt;&lt;P&gt;Having a look to the node attribute editor, this will create a new attachment to the "core Transform3D (xxxxx)"&lt;/P&gt;&lt;P&gt;See picture #2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to create this attachment and access the values via python, in order to change the rotation pivot alignment to Direction Vector and add new values?&lt;/P&gt;&lt;P&gt;With field access attachment i can only reach the attachments directly under the node. (like "Name")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 06:53:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-access-to-core-attachments/m-p/12913820#M313</guid>
      <dc:creator>andreasK3K4G</dc:creator>
      <dc:date>2024-07-23T06:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: VRED 2024, Python, Access to core attachments</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-access-to-core-attachments/m-p/12953326#M314</link>
      <description>&lt;P&gt;Hi Andreas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;long story short:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;my_node = findNode("my_node")

# create the attachment and add it to the node
attachment = createAttachment("StringAttributeMap")
vrFieldAccess(attachment ).setBool("internal",False)
vrFieldAccess(attachment ).setMString("keys",["rotationDirection"])
vrFieldAccess(attachment ).setMString("values",["0 0 1 0"])
vrFieldAccess(my_node.fields().getFieldContainer('transform')).addAttachment(attachment)

# set the rotation_pivot direction
vrFieldAccess(vrFieldAccess(my_node.fields().getFieldContainer('transform')).getAttachment("StringAttributeMap")).setMString('values',['0 1 0 0'])

# get the rotation_pivot direction
print(vrFieldAccess(vrFieldAccess(my_node.fields().getFieldContainer('transform')).getAttachment("StringAttributeMap")).getMString('values'))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess the ui is not updating to the rotation mode, but the data is set, so i think it should work &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;best regards&lt;/P&gt;&lt;P&gt;VREDuardt&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 10:59:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-access-to-core-attachments/m-p/12953326#M314</guid>
      <dc:creator>Eduardt_AlbergEZ998</dc:creator>
      <dc:date>2024-08-12T10:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: VRED 2024, Python, Access to core attachments</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-access-to-core-attachments/m-p/12995261#M315</link>
      <description>&lt;P&gt;Hi Eduardt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this looks promising. Unfortunately I get the error in line 8.&lt;BR /&gt;"&lt;SPAN&gt;vrFieldAccess::getField: Couldn't find field 'transform'"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I guess the field container name is something different. Tried "core Transform3D" and also "Transform3D" with no luck.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 07:34:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-access-to-core-attachments/m-p/12995261#M315</guid>
      <dc:creator>andreasK3K4G</dc:creator>
      <dc:date>2024-09-02T07:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: VRED 2024, Python, Access to core attachments</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-access-to-core-attachments/m-p/12997262#M316</link>
      <description>&lt;P&gt;Hi Andreas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i guess you want to modify a group node. The difference is that a group node itself has the transform fieldcontainer as core. In a geometry node the transform field container is a child of the core Geometry field container. You can see structure in the node attribute editor. I modified the script to work on a group node:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;my_node = findNode("myGroup")

# create the attachment and add it to the node
attachment = createAttachment("StringAttributeMap")
vrFieldAccess(attachment ).setBool("internal",False)
vrFieldAccess(attachment ).setMString("keys",["rotationDirection"])
vrFieldAccess(attachment ).setMString("values",["0 0 1 0"])
my_node.fields().addAttachment(attachment)

# set the rotation_pivot direction
vrFieldAccess(my_node.fields().getAttachment("StringAttributeMap")).setMString('values',['0 1 0 0'])

# get the rotation_pivot direction
print(vrFieldAccess(my_node.fields().getAttachment("StringAttributeMap")).getMString('values'))&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 Sep 2024 09:01:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-access-to-core-attachments/m-p/12997262#M316</guid>
      <dc:creator>Eduardt_AlbergEZ998</dc:creator>
      <dc:date>2024-09-03T09:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: VRED 2024, Python, Access to core attachments</title>
      <link>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-access-to-core-attachments/m-p/12997780#M317</link>
      <description>&lt;P&gt;Hi Eduardt,&lt;/P&gt;&lt;P&gt;thanks a lot, this is working.&lt;/P&gt;&lt;P&gt;Just to figure out, how to "update" the group, so the new rotation pivot orientation is also visible and working in render window then.&lt;/P&gt;&lt;P&gt;Right now, i need to go to RotationPivot Alignment and hit return on the x value to make the changes active.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 13:17:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/vred-2024-python-access-to-core-attachments/m-p/12997780#M317</guid>
      <dc:creator>andreasK3K4G</dc:creator>
      <dc:date>2024-09-03T13:17:42Z</dc:date>
    </item>
  </channel>
</rss>

