Scripts with flags
I've been busy for the last couple of days and haven't done any new rigging. But I've been putting a couple of hours here and there to address some script inefficiency and figure out some vital scripting tricks.
This has been bothering me for a few days, and I finally decided to do something about it.
Up to now, I've had a bunch of separate scripts with similar functionality. It goes something like this: make a locator, align the locator, constrain the object it was aligned to, to the new locator. Or a non-shading, non-rendering sphere. Or parent instead of constrain. Or align the point only. I just modified the script and saved it as a different script for each purpose.
This seemed inefficient. Especially at 2am, when I couldn't remember which script did what.
So I decided to start merging all these scripts into one uber script, and add some options along the way. Now, when I type the script name, a dialog box pops up, which lists all the flags, including the choice between sphere and locator, and I'll add poly cube, circles and squares (and maybe some other things as well) on Monday. Maybe I'll add color choice too.
Nice thing about this is that at 2am, I won't have to remember the flags either.
I've parsed the flags in such a way that I can list the flags in any order, including the radius option which is followed by a number, and sort them all afterward.
This will, of course, come in handy for other things, particularly my interim rig building tools until I start doing some interface building.
Drawbacks:
Lots of positives for this technique, but I'm annoyed by the fact that I can't just arrow up and recall the options. For now, I have it echoing the input options so I can copy and paste them at least. If this becomes an annoyance, I'll just make some sort of interface that stays available with radio buttons.
This has been bothering me for a few days, and I finally decided to do something about it.
Up to now, I've had a bunch of separate scripts with similar functionality. It goes something like this: make a locator, align the locator, constrain the object it was aligned to, to the new locator. Or a non-shading, non-rendering sphere. Or parent instead of constrain. Or align the point only. I just modified the script and saved it as a different script for each purpose.
This seemed inefficient. Especially at 2am, when I couldn't remember which script did what.
So I decided to start merging all these scripts into one uber script, and add some options along the way. Now, when I type the script name, a dialog box pops up, which lists all the flags, including the choice between sphere and locator, and I'll add poly cube, circles and squares (and maybe some other things as well) on Monday. Maybe I'll add color choice too.
Nice thing about this is that at 2am, I won't have to remember the flags either.
I've parsed the flags in such a way that I can list the flags in any order, including the radius option which is followed by a number, and sort them all afterward.
This will, of course, come in handy for other things, particularly my interim rig building tools until I start doing some interface building.
Drawbacks:
Lots of positives for this technique, but I'm annoyed by the fact that I can't just arrow up and recall the options. For now, I have it echoing the input options so I can copy and paste them at least. If this becomes an annoyance, I'll just make some sort of interface that stays available with radio buttons.

0 Comments:
Post a Comment
<< Home