Below you will find examples of some of my scripting work. I use Mel, Python and Pymel for automating redundant tasks.
Copy skinweights script:
Very useful for quickly copying not just the skincluster, but also for grabbing all influence joints, adding them to new geo skincluster, and THEN copying the skinweights over.
SkinCopy script can be downloaded here
Quadruped script:
I keep updating the final script and uploading it so make sure to check back if you have already downloaded this tutorial!
Autorig python module scripting:
Mouth rig tutorial:
A very easy beginners tutorial which involves placing joints, creating controllers and constraints.
Mouth Module Autorig can be downloaded here: http://sta.sh/01u1uauo89v0
Matrix math in Maya:
Download file from video here:
https://gumroad.com/l/IUNCH
Follicle script:
A very very very useful tool for creating constraints that are supposed to stick objects to a mesh, but without wierd rotations and other nastiness.
Check it out, you won’t regret it!
Follicle connect script can be downloaded here: Link
Pingback: Using Python in Maya to Create an Auto-Rig Tool - Lesterbanks
Thank you for the feature Lesterbanks.
Pingback: Python Scripting a Follicle Constraint Tool in Maya - Lesterbanks
Pingback: Scripting a Copy Skin Weights Tool With Python - Lesterbanks
Hi Bjorn!
For first…thank you so much!!You are creating great resources for all of us!!
I would like to ask you if is possible to extend the follicle script to a multiple selection of locators…a hint on where to start would be great!!
Thanks alot!!!
Carlo
That is a good idea. I would put the locators in one list and run the script in a for loop for each element in that list.
\\\\A BIT RAW…BUT IT WORKS, JUST NEED TO SELECT GEO FIRST AND THAN THE LOCATORS\\\\\\\
allGeo = cmds.ls( sl=True )
print allGeo,’///ORIG///’
geo = allGeo[0]
print geo,’///GEO///’
del allGeo[-0]
locs = allGeo
print locs,’///LOCS///’
n=0
for loc in locs:
closest= cmds.createNode(‘closestPointOnMesh’)
cmds.connectAttr(geo +’.outMesh’,closest+’.inMesh’)
x=cmds.xform(locs[n],t=True,q=True)
cmds.setAttr(closest+’.inPositionX’, x[0])
cmds.setAttr(closest+’.inPositionY’, x[1])
cmds.setAttr(closest+’.inPositionZ’, x[2])
follicle= cmds.createNode(‘follicle’)
follicleTrans=cmds.listRelatives(follicle,type=’transform’,p=True)
cmds.connectAttr(follicle+’.outRotate’,follicleTrans[0]+’.rotate’)
cmds.connectAttr(follicle+’.outTranslate’,follicleTrans[0]+’.translate’)
cmds.connectAttr(geo+’.worldMatrix’,follicle+’.inputWorldMatrix’)
cmds.connectAttr(geo+’.outMesh’,follicle+’.inputMesh’)
cmds.setAttr(follicle+’.simulationMethod’,0)
u=cmds.getAttr(closest+’.result.parameterU’)
v=cmds.getAttr(closest+’.result.parameterV’)
cmds.setAttr(follicle+’.parameterU’,u)
cmds.setAttr(follicle+’.parameterV’,v)
cmds.parentConstraint(follicleTrans[0],locs[n],mo=True)
cmds.delete(closest)
n=n+1
Hi Bjorn, After copying the follicle script into my ‘scripts’ folder what command would I use to run it? Sorry for being such a dummy!
Hi, just run in Python directly or load it in with import pythonscriptname.py as follicleconnect and then run it like that.
It was only made to be run directly so there is no launcher.
Got it working. Awesome. Thanks so much!
Hey, the stash link for the follicle script doesn’t work. Could you update it? Thank you for your work! D.