Maya 2022 SweepMesh Python Command?

Maya 2022 SweepMesh Python Command?

eldron2323
Observer Observer
1,107 Views
1 Reply
Message 1 of 2

Maya 2022 SweepMesh Python Command?

eldron2323
Observer
Observer

Is there a way to create a sweepmesh and control the attributes with python? I didn't find a command for it in the reference.

0 Likes
1,108 Views
1 Reply
Reply (1)
Message 2 of 2

Rourker27
Contributor
Contributor

hmmm, not sure if it is exposed to python yet. You can run the 'sweepMeshMenuCallback;' command through python though like this.

 

 

import maya.mel as mel
mel.eval('sweepMeshMenuCallback;')

 

 

 

as long as your curve is selected that should work.

then if you want to change the profile you will have to get access to the sweepMeshCreator and change it's attribute sweepProfileType

 

It would look something like this

 

 

mel.eval('setAttr "sweepMeshCreator1.sweepProfileType" 2;')
# the integer at the end references what profile you want to select in the menu
# 0 - Poly, 1 - Rectangle, 2 - Line, 3 - Arc, 4 - Wave, 5 - Custom
# also the default name for thet sweepMeshCreators is in typical Maya fashion with them being called sweepMeshCreator1 , sweepMeshCreator2 . . . and so on

 

 

 

If you want to get a full list of the attributes you can look them up by printing the list of them using listAttr in mel like this:

 

 

listAttr sweepMeshCreator1;

//which will return a long list of things you can access.