MASH distribute: link to Selection Set via python?

MASH distribute: link to Selection Set via python?

Anonymous
Not applicable
1,215 Views
3 Replies
Message 1 of 4

MASH distribute: link to Selection Set via python?

Anonymous
Not applicable

I can link the MASH distribute node to a selection set in the UI.  But I am not able to properly do it in code.  Is there a python call to create the link?  I tried simply connecting the attributes like this:
    cmds.connectAttr(vertSet+".message", mashNetwork.distribute+".selectionSetMessage")


Which appears to work (the UI thinks it's connected), but the network doesn't function properly.  Is there a special call to do this, or just some maya connections I can set up so scripting it works identically to doing it manually in the UI?

0 Likes
Accepted solutions (1)
1,216 Views
3 Replies
Replies (3)
Message 2 of 4

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

It should be connectNode function of MASH_QLineEditExtend in Maya\plug-ins\MASH\scripts\MASHsingleInputQtWidget.py.

 

You could write own script base on it.

 

BTW: For selectionSetMessage, post command should be 'SwitchToVtxSetMode'

 

Yours,

Li

 

 

0 Likes
Message 3 of 4

Mike_Isaakidis
Advocate
Advocate

Im not a python expert can someone share the code for it to work?
as above I get the same issue where its connected but doesn't work. 

Looked in the MAsh api

meshDistribute(mesh, mode=1)



tried:

mashNetwork.meshDistribute("sel_set", 7)


but that doesnt work either

0 Likes
Message 4 of 4

Mike_Isaakidis
Advocate
Advocate

Ah managed to solve it, went exactly where you mentioned and was an easy fix after that.
Thanks Cheng

0 Likes