検索 - User list
Full Version: Transform from centroid
Root » Technical Discussion » Transform from centroid
coccarolla
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?
Christos Stavridis
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.
coccarolla
Christos Stavridis
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.

Thanks! Any way for us query these aliases in the future? Something like an echo command maybe?!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB