Last active
November 5, 2017 22:40
-
-
Save jm991/7970c43ad919cf3e544a6f32f09153d6 to your computer and use it in GitHub Desktop.
Toggles visibility of multiple selected transforms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//--------------------------------------------------------------------------------- | |
// Source: https://gist.github.com/jm991/ | |
// Author: John Mac | |
// Date: 11-05-2017 | |
// | |
// Description: | |
// Toggles visibility of multiple selected transforms | |
// Installation: | |
// 1. Copy toggleVisible.mel to C:\Users\[USER]\Documents\maya\[MAYAVERSION]\prefs\scripts\jm991 | |
// 2. Restart maya | |
// Instructions: | |
// 1. CTRL or SHIFT select the transforms you want to hide or show in the Outliner | |
// 2. Run this script | |
// Dependencies: | |
// printextensions.mel https://gist.github.com/jm991/29cc46b5b8e5fa4709ee4be0a7911095 | |
global proc toggleVisible() | |
{ | |
string $objs[] = `ls -sl -type "transform"`; | |
// printarray($objs); | |
for ($obj in $objs) | |
{ | |
$attr = $obj + ".visibility"; | |
string $val = `getAttr $attr`; | |
// println($val); | |
if ($val == "1") | |
{ | |
setAttr $attr 0; | |
} | |
else | |
{ | |
setAttr $attr 1; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remove the ".c" from the filename when you download this (git doesn't support .mel syntax highlighting)