Mel Functions

From bernie's
Jump to: navigation, search

Small objects rig

for($o in `ls -sl`){
    select -cl;
    select -r ($o+".vtx[*]");
    setToolTo moveSuperContext; 
    vector $centerPos = `manipMoveContext -q -position Move`;
    $c = `circle -nr 0 1 0 -c 0 0 0 -sw 360 -ch 0 -r .8 -n "cookieCtrl"`;
    move -r ($centerPos.x) ($centerPos.y) ($centerPos.z);
    float $rr[] = sphrand(40);
    rotate -r ($rr[0]) ($rr[1]) ($rr[2]);
    zero($c[0]);
    select -cl;
    select $c $o;
    performParentConstraint 0;
    performScaleConstraint 0;    
}

'Zero Out' ctrller

proc zero(string $obj){
        select -cl;
        select $obj;
        string $grandParents[] = `listRelatives -p`;
        string $zer = `group -em -w -n ($obj+"_ZERO")`;
        parent $zer $obj;
        setAttr ($zer+".rotateZ") 0;
        setAttr ($zer+".translateX") 0;
        setAttr ($zer+".translateY") 0;
        setAttr ($zer+".translateZ") 0;
        setAttr ($zer+".rotateX") 0;
        setAttr ($zer+".rotateY") 0;
        setAttr ($zer+".scaleZ") 1;
        setAttr ($zer+".scaleX") 1;
        setAttr ($zer+".scaleY") 1;
        if(size($grandParents)==0){
            parent -w $zer; 
        }else{
        parent $zer $grandParents[0];
        }
        parent $obj $zer;
}

Bake Texture Sequence

Particle & instances

Navigate


Select By Edge Angle


Show reflection angle


Create Follicles on selected components