Saori Yoshimoto work notes since 2018

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.

No comments:

Post a Comment