Sie sind auf Seite 1von 2

//---------------------------------------------------------------------------

// buildeyeSetup.mel - MEL Script


//---------------------------------------------------------------------------
//Copyright (c) 2010 Wasim Khan creaturerigs.com
//
//Permission is hereby granted, free of charge, to any person obtaining a copy of
//this software and associated documentation files (the "Software"), to deal in
//the Software without restriction, including without limitation the rights to
//use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
//the Software, and to permit persons to whom the Software is furnished to do so,
//subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
//FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
//COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
//IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
//CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// DESCRIPTION:
// eye setup
//
// REQUIRES:
// cr_buildWorld.mel
// cr_curveUtilitiesLib.mel
// cr_charUtilsLib.mel
// libString.mel
// snaps.mel
//
// AUTHOR:
// Wasim Khan - wasim.cg@gmail.com
//----------------------------------------------------------------------------

eval("source \"cr_buildWorld.mel\";");
source "snaps.mel";
cr_charUtilsLib;
cr_curveUtilitiesLib;
libString;

global proc cr_buildEyeSetup(string $name, string $side, string $leftEye, string


$rightEye, int $cr_buildWorld, float $scale)
{

string $partGrp = `group -em -n ($name + $side + "eyesParts_grp#")`;

if($cr_buildWorld)
{
string $cleanGrp[] = cr_buildWorld ($name, $scale);
parent $partGrp $cleanGrp[0];
}

//controls creation
select -r $leftEye;
string $leftEyeOriControl[0] = `cr_curveControl cone curve`;
$leftEyeOriControl[0] = `rename ($leftEye + "_orient_ctrl")`;
setAttr ($leftEyeOriControl[0] + ".r") 0 0 0;
cr_fixFacingAxis Z 1;
cr_resizeCurves {} 1 1 1 0.9;
string $leftEyeOriGrp[0] = `cr_quickZeroOut $leftEyeOriControl[0]`;
cr_lockAndHide $leftEyeOriControl[0] cr_locknHide "trans scale vis";

select -r $rightEye;
string $rightEyeOriControl[0] = `cr_curveControl cone curve`;
$rightEyeOriControl[0] = `rename ($rightEye + "_orient_ctrl")`;
setAttr ($rightEyeOriControl[0] + ".r") 0 0 0;
cr_fixFacingAxis Z 1;
cr_resizeCurves {} 1 1 1 0.9;
string $rightEyeOriGrp[0] = `cr_quickZeroOut $rightEyeOriControl[0]`;
cr_lockAndHide $rightEyeOriControl[0] cr_locknHide "trans scale vis";

string $eyeControl[0] = `cr_curveControl cross curve`;


$eyeControl[0] = `rename ($name + $side + "eyeMain_ctrl#")`;
string $tempCon[] = `pointConstraint -offset 0 0 0 -weight 1 $leftEye
$rightEye $eyeControl[0]`;
delete $tempCon; refresh;
cr_fixFacingAxis Z 1;
cr_resizeCurves {} 1 1 1 1.1;
string $eyeConGrp[0] = `cr_quickZeroOut $eyeControl[0]`;
cr_lockAndHide $eyeControl[0] cr_locknHide "rot scale vis";

select -r $leftEye;
string $leftEyeAimControl[0] = `cr_curveControl circleCross curve`;
$leftEyeAimControl[0] = `rename ($leftEye + "_aim_ctrl")`;
setAttr ($leftEyeAimControl[0] + ".r") 0 0 0;
cr_fixFacingAxis Z 1;
cr_resizeCurves {} 1 1 1 0.3;
string $leftEyeAimGrp[0] = `cr_quickZeroOut $leftEyeAimControl[0]`;
cr_lockAndHide $leftEyeAimControl[0] cr_locknHide "rot scale vis";

select -r $rightEye;
string $rightEyeAimControl[0] = `cr_curveControl circleCross

Das könnte Ihnen auch gefallen