How to get/set SweepMesh Custom attributes?

How to get/set SweepMesh Custom attributes?

Mike_Isaakidis
Advocate Advocate
816 Views
2 Replies
Message 1 of 3

How to get/set SweepMesh Custom attributes?

Mike_Isaakidis
Advocate
Advocate

Hi I am making a tool using PYTHON that copies the data of a sweep_mesh and pastes is in another.

I've got everything pretty much figured out, apart from the Custom option of the tool. 

 

MikeIsaakidis_1-1691444206897.png

I tried everything I can think of to retrieve the values of a mesh that has custom sweep profile type assigned.
Listing attributes makes me thing that maybe the info I need is within the ['sweepProfileData'] but I cannot access that with getAttr command.
Get this error:

// Error: The data is not a numeric or string value, and cannot be displayed. //



All I need to retrieve is the Custom Sweep Profile type and Profile. 
And set it to another sweep curve. 

MikeIsaakidis_2-1691444409546.png
Any ideas on where I should look for this???

 

Accepted solutions (1)
817 Views
2 Replies
Replies (2)
Message 2 of 3

Kahylan
Advisor
Advisor
Accepted solution

Hi!

 

When you use the Custom Profile option, Maya creates a "sweepProfileConverter" node. This node calculates the profile from the input you give it.

Converter.png

If you want to copy the input of another sweep mesh you have two options:

1) just find the sweepMeshConverter node via the inputConnections command and connect it's "customSweepProfileData"  attribute to the "customSweepProfileData" on the sweepMeshCreator node.

2) find the sweepMeshConverter node via the inputConnections command. duplicate it including it's incoming history nodes and connections. Then connect the "customSweepProfileData" attributes

 

The first option will leave both sweeps linked, so if you change the input on one, it will also change on the other. The second way will allow you to change the custom profile separately.

 

I hope it helps!

 

0 Likes
Message 3 of 3

Mike_Isaakidis
Advocate
Advocate

Ah thanks that was the exact info I needed 😀
Already implemented it 👍