Scripts
I’ve been learning how to script for a few months now and the hardest part has been thinking of finding a way to use what I’ve been learning. Not being a programmer or having any kind of formal training in that field, it’s been very interesting since I didn’t know where to begin, but it was still a fascinating thing to me to be able to make things that help the process, that automate things. So I just want to post two little things that I managed to make and learn from.
This first script flips/mirrors the selected objects position in world space.
I made a little thing that goes through the steps of mirroring an objects position, and then I started asking well what if I wanted a choice to duplicate it or not, and also what if I wanted to mirror across a different axis. So that’s what this script does organized in a window. It’s very simple but handy, to me at least.
This next script is extremely simple, but it was really confusing to understand as I was just starting to learn this stuff. For awhile I had tried making For Loops for arrays, but kept getting errors. Then I found something someone posted stating the obvious that made sense.
My error was that I was trying to do something like this
//store selection
$sel = `ls -sl`;
//run for loop renaming objects
for ($obj in $sel){
rename ($sel + “something”);
}
When I should’ve done it like this
//store selection
$sel = `ls -sl`;
//run for loop renaming objects
//using $obj, not $sel
for ($obj in $sel){
rename $obj ($obj+ “something”);
}
This script takes your selected objects, runs a for loop through the selection that self-groups each object, and renames it appropriately. Like selecting a circle, grouping it, renaming the group “grp_circle”.
Hand Rig – Set Driven Keys and Extra finger controls setup
I set up a file to help a friend out with their rig awhile ago. It shows a relatively simple concept of layering a rig to allow for extra overall control. I thought this was pretty nice when I first learned it, so I wanted to share this with anyone starting out who may not be aware of this technique since it’s not something that seems so simple when you’re first learning how to rig.
The file is seperated in three seperate files, showing the steps of how to setup the fingers of a hand rig with Set Driven Keys, that control custom attributes to pose the hand, and extra finger controls that allow for tweaking of the preset poses or to make completely new poses.
The way it works is like this:
You have your basic joints for your finger. Then you have your control objects, like a nurbs circle, fitted around the joints. They will be orient constrained to control the joints after the control heirarchy is set up.
The control objects are then self grouped twice, one to set the SDK on and one as the null node that doesn’t do anything.
Then the null group of the control object is parented under the next control object (not its SDK or null group).
So the idea of layering can be thought of as having one step above that which controls something, and that one thing above controls something else or is being controlled by something else, like a custom attribute in this case.
The files are pretty easy to understand, but if you have any questions please feel free to contact me for help.
You can download the files here.