<?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 copy/paste Transform attributes into the Offset Parent Matrix in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/copy-paste-transform-attributes-into-the-offset-parent-matrix/m-p/12071001#M972</link>
    <description>&lt;DIV class=""&gt;&lt;SPAN&gt;Hey everyone, could you help me with a script that copy/paste Transform attributes into the Offset Parent Matrix on selected object, and finally sets the Transform Attributes to zero? Thanks a lot. I tryed this, but it add values from parent Transforms to child too. Thank you.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;'''import maya.cmds as cmds&lt;BR /&gt;&lt;BR /&gt;def copy_transform_to_offset_parent():&lt;BR /&gt;&lt;BR /&gt;selected_objects = cmds.ls(selection=True)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;translate = cmds.getAttr(obj + ".translate")[0]&lt;BR /&gt;rotate = cmds.getAttr(obj + ".rotate")[0]&lt;BR /&gt;scale = cmds.getAttr(obj + ".scale")[0]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;transform_matrix = cmds.xform(obj, query=True, matrix=True, worldSpace=True)&lt;BR /&gt;&lt;BR /&gt;cmds.setAttr(obj + ".offsetParentMatrix", transform_matrix, type="matrix")&lt;BR /&gt;&lt;BR /&gt;cmds.setAttr(obj + ".translate", 0, 0, 0)&lt;BR /&gt;cmds.setAttr(obj + ".rotate", 0, 0, 0)&lt;BR /&gt;cmds.setAttr(obj + ".scale", 1, 1, 1)'''&lt;/DIV&gt;</description>
    <pubDate>Fri, 30 Jun 2023 06:23:23 GMT</pubDate>
    <dc:creator>PSkala</dc:creator>
    <dc:date>2023-06-30T06:23:23Z</dc:date>
    <item>
      <title>copy/paste Transform attributes into the Offset Parent Matrix</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/copy-paste-transform-attributes-into-the-offset-parent-matrix/m-p/12071001#M972</link>
      <description>&lt;DIV class=""&gt;&lt;SPAN&gt;Hey everyone, could you help me with a script that copy/paste Transform attributes into the Offset Parent Matrix on selected object, and finally sets the Transform Attributes to zero? Thanks a lot. I tryed this, but it add values from parent Transforms to child too. Thank you.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;'''import maya.cmds as cmds&lt;BR /&gt;&lt;BR /&gt;def copy_transform_to_offset_parent():&lt;BR /&gt;&lt;BR /&gt;selected_objects = cmds.ls(selection=True)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;translate = cmds.getAttr(obj + ".translate")[0]&lt;BR /&gt;rotate = cmds.getAttr(obj + ".rotate")[0]&lt;BR /&gt;scale = cmds.getAttr(obj + ".scale")[0]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;transform_matrix = cmds.xform(obj, query=True, matrix=True, worldSpace=True)&lt;BR /&gt;&lt;BR /&gt;cmds.setAttr(obj + ".offsetParentMatrix", transform_matrix, type="matrix")&lt;BR /&gt;&lt;BR /&gt;cmds.setAttr(obj + ".translate", 0, 0, 0)&lt;BR /&gt;cmds.setAttr(obj + ".rotate", 0, 0, 0)&lt;BR /&gt;cmds.setAttr(obj + ".scale", 1, 1, 1)'''&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 Jun 2023 06:23:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/copy-paste-transform-attributes-into-the-offset-parent-matrix/m-p/12071001#M972</guid>
      <dc:creator>PSkala</dc:creator>
      <dc:date>2023-06-30T06:23:23Z</dc:date>
    </item>
  </channel>
</rss>

