Scripts for Maya: AddCurve, ToggleLRA, MergeVerts

(WIP) Rig for my original character, Niya

For the past few weeks, I’ve been working on modeling and rigging my monster girl OC, Niya. I decided to make some scripts (using the nifty PyMEL documentation) to automate a bunch of mouse clicks! Feel free to use them or modify them however you’d like.

AddCurve (Python)

This one is simple. Select a bone joint (or joints), use the AddCurve script (or put it on a shelf for easy access), click “ADD”, and presto–a NURB curve appears at the exact same location with the same rotation as the joint! Helpful for when you want to create a bunch of controls.

Change the “Curve Shape Name” and “Shape Scale” fields to edit the curve’s suffix and size, respectively. Note that it automatically freezes the curve’s transformation after applying its new transformation / rotation / scale.

ToggleLRA (Python)

This script was derived from bm_axisDisplay made by benmorgantd. Thanks!

It force toggles the Local Rotation Axis displays of ALL joints in the scene (or just the the selected joints) to be on or off. Helpful for when you want to see axis displays quickly in order to orient joints in a rig.

If you have any joints selected, the script will only toggle the LRA displays of those joints. If you don’t have anything selected, then all LRA displays will toggle.

MergeVerts (Python)

If you’ve ever been in a situation where you have a bunch of vertices overlapping each other and you don’t know why and you’re about to have a stress-induced breakdown, I got you. Also, I’ve been there way too many times. I don’t know why I never figured out that Maya already has a command for this (select all vertices, Edit Mesh > Merge (click options box) > set a Threshold value (maybe something like 0.001).

Anyway, I thought I would make my own script that puts all of those clicks into one window, and also iterates through all selected meshes. You can specify what your merge threshold value will be.

Sorry that the interfaces are kind of rough! I’m planning on learning how to make fancy layouts soon. I kinda overworked my hands over the weekend from mouse-clicking and cooking/cleaning a bunch, so I’m taking it easy. Everyone remember to take breaks and do stretches and posture checks!!! Take care of your precious limbs!!!

Leave a Reply

Your email address will not be published. Required fields are marked *