Scripting tutorials

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!


downloadButton

Autorig python module scripting:

button

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

11 thoughts on “Scripting tutorials

  1. Pingback: Using Python in Maya to Create an Auto-Rig Tool - Lesterbanks

  2. Pingback: Python Scripting a Follicle Constraint Tool in Maya - Lesterbanks

  3. Pingback: Scripting a Copy Skin Weights Tool With Python - Lesterbanks

  4. 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

      • \\\\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

  5. 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!

Leave a comment