Message 1 of 2
Python script using Mash to duplicate along curve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am trying to make a script that takes in an object input and curve input which then duplicates this object on the curve. I am currently having trouble with setting up a connection between the curve and the Mash curve Node. I also would appreciate if anyone could share any resources with me for scripting with mash, the docs are aren't very clear. Thanks.
import maya.cmds as cmds
import MASH.api as mapi
import flux.core as fx
def runPreset():
# Add labels for each step of the smart preset
steps = [
'Step 1: Drag in your object:',
'Step 2: Drag in your curve to duplicate on:'
]
fx.DropWindow.getDrop(steps, lambda data: smartPreset.send(data), title = "DuplicateAlongCurve" )
node = yield
nodes = node.split('\n')
# create a new MASH network
mashNetwork = mapi.Network()
mashNetwork.createNetwork(name = "MASH")
# get the second step drop
node = yield
print(node)
#Create Curve Node with Curve
Curvenode = mashNetwork.addNode("MASH_Curve")
#This is where I am stuck
cmds.connectAttr('MASH_Curve' + 'node', force=1)
yield
#run the preset
smartPreset = runPreset()
smartPreset.next()