Saori Yoshimoto work notes since 2018

Showing posts with label MAYA/MEL. Show all posts
Showing posts with label MAYA/MEL. Show all posts

Saturday, July 18, 2020

[MA:MEL] Check on/off several state on render layer

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

for ($myNode in $selection) {
 
    editRenderLayerAdjustment ($myNode + ".castsShadows");
    $csState = `getAttr ($myNode + ".castsShadows")`;
    $csState = 0;
    setAttr ( $myNode + ".castsShadows") $csState;

Tuesday, June 23, 2020

[MA:MEL] add custom string attribute

int $i = 0;
string  $allObjects[];
string  $obj;
   
$allObjects = `ls -sl`;
string $shapes[]     = `listRelatives $allObjects`;
string $myMaterial[] = `listConnections -type "shadingEngine" $shapes`;

Thursday, February 13, 2020

[MA:MEL] toggle on/off smooth preview and display preview with MEL?

https://forums.cgsociety.org/t/toggle-on-off-smooth-preview-with-mel/1347685

Thx for shearing!
string $selection[] = `ls -sl`;

for ($myNode in $selection) {

    $smoothState = `getAttr ($myNode + ".displaySmoothMesh")`;
    if($smoothState != 2) {
        $smoothState = 2; 
    }
    
    $displaySubdCompState = `getAttr ($myNode + ".displaySubdComps")`;
    if($displaySubdCompState != 1){
        $displaySubdCompState = 1;
    }
    
 setAttr ( $myNode + ".displaySmoothMesh") $smoothState;
 setAttr ( $myNode + ".displaySubdComps") $displaySubdCompState;
}
Edit: it doesnt work in sub-object mode.