FANDOM


Tutorial videos Edit

See the Maya video tutorialscontributed by rip_shot.

ScriptsEdit

MEL script to batch fix your materials ready for rendering, contributed by reddit user cptplutonic and improved by Hal-9007. See the original post and the update for details on using the script.

MainWindow;


global proc MainWindow()
{
    // check first for another instance of this window..
    if((`window -exists "MainWindow"`) == true) {
        // ..if there is, close it
        deleteUI MainWindow;
    }
    // create the window
    createMainWindow("MainWindow");
}

proc createMainWindow(string $name) {

    // set our window sizes
    $windowHeight = 256;
    $windowWidth = 450;

    string $windowName = `window -widthHeight 300 200 -title $name $name`;

    frameLayout -l "jMC2obj Batch Helper" -mh 5 -mw 5;

    columnLayout -adjustableColumn true -columnAttach "both" 10;

    text -label "\nMenu" -align "center";
    separator -height 10;

    // Use on ALL materials in the scene to remove the pixel filter //
    button -label "Batch remove Pixel Filter" -command pixelFilter;
    // Use on ALL materials in the scene to apply transparency //
    button -label "Batch apply Transparency" -command attatchTransparency;

    showWindow $windowName;
}

global proc pixelFilter() {

    string $materials[] = `ls -selection`;

    if ($materials[0] == "") {
        print "//You must select at least one material.\n";        
    }

    else {
        for($material in $materials){
            catch ( `select -r ($material + "F")` );
            catch ( `setAttr ($material + "F.filterType") 0 ` );    
        }
    }    
}

global proc attatchTransparency() {   

    string $materials[] = `ls -selection`;

    if ($materials[0] == "") {
        print "//You must select at least one material.\n";        
    }

    else {
        for($material in $materials){
            catch ( `select -r $material`  );
            if (($material != "initialShadingGroup") && ($material != "initialParticleSE")) {
                if (`getAttr ($material + "F.fha")` == true) {
                    catch ( `connectAttr -force ($material + "F.outTransparency") ($material + ".transparency")`  );
                }
            }
        }
    } 
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.