Transform from centroid

   269   1   0
User Avatar
Member
165 posts
Joined: 8月 2013
オンライン
Hi, I'm trying to find how the 'transform from centroid' is run from the tab menu. Is it a sequence of commands, a shelf tool? How can I add to it radial menu for example?
User Avatar
スタッフ
9 posts
Joined: 6月 2018
オフライン
Hi!

Transform from Centroid is an alias that uses the Transform SOP with specific parameter values. Therefore, it won't appear in the library for adding to a radial menu.

Instead, you'll need to use a Script Action, which you can find under the Utilities tab.

Set the label to "Transform from Centroid" and choose an icon. Then, in the script section, add the following script:

import soptoolutils
node = soptoolutils.genericTool(kwargs, 'xform', exact_node_type=False)
node.setParmExpressions({
    'px': 'centroid(0, D_X)',
    'py': 'centroid(0, D_Y)',
    'pz': 'centroid(0, D_Z)'
})
node.setName('transform_from_centroid1', True)

I've attached an image as well.

Let me know if that works for you.

Attachments:
Screenshot 2026-03-19 at 09.07.41.png (782.3 KB)

Christos Stavridis
Technical Artist
SideFX Labs
  • Quick Links