Friday 27 March 2009

messing around with mel!

I Realised that I didn't freeze the transformations of the feet controls correctly when I was setting up the rig, so instead of going back and doing it again, and I don't want to remember the XYZ values for each foot control, I've decided to make a little Mel script to do it for me.. so after doing a little bit of reading.. this is what I came up with:

if (`window -exists ConWindow`)
deleteUI ConWindow;

window -widthHeight 260 100 -title "Convict Editor" ConWindow;

columnLayout -columnAttach "both" 5 -rowSpacing 10 -columnWidth 250;

button -label "Zero Left Foot" -command "ZeroLFProcedure" ZeroLFButton;
proc ZeroLFProcedure()
{
select -r leftFootControl ;
setAttr "leftFootControl.translateX" 0.01;
setAttr "leftFootControl.translateY" -0.16;
setAttr "leftFootControl.translateZ" 0.215;
}

button -label "Zero Right Foot" -command "ZeroRFProcedure" ZeroRFButton;
proc ZeroRFProcedure()
{
select -r rightFootControl ;
setAttr "rightFootControl.translateZ" 0.212;
setAttr "rightFootControl.translateY" -0.16;
setAttr "rightFootControl.translateX" 0;
}

showWindow ConWindow;


This creates a little box with two buttons inside it, once clicked, moves the feet controls to the default positioning. So, added to the custom shelf makes a nice little control I can distribute to the group for when they're animating with him..





(I'll probably go back and correct it properly later on, but this will do for now, and I wanted to have a mess about with Mel!)

I've been sorting out the weights more, and its looking better, should be all finalised soon and ready to start animating with..

anyway, probably time for bed.

No comments: