Last active
October 20, 2021 22:13
-
-
Save L0Lock/c1330ee50b0775b23b34ec969f73906e to your computer and use it in GitHub Desktop.
a simple attribute toggle script that you can use as a shelf button or in the script editor
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
// *************************************************** | |
// README | |
// *************************************************** | |
// *************************************************** | |
// As the examples show, put your arrtribute IDs in | |
// the list after line 16 between quotation marks like | |
// these: "" and with a coma , at the end. EXCEPT for | |
// the very last element of the list. | |
// If you don't know your attribute id, open your | |
// script editor, clear the top-part history, and | |
// toggle the attribute manually. The script history | |
// should show something like : | |
// setAtt "yourObject.attribute" | |
// Copy what's between the quotes. | |
string $attrList[] = { | |
"myObject.holdOut", | |
"myOtherObject.holdOut" | |
}; | |
for ($i = 0; $i < `size $myAttr`; $i++){ | |
setAttr $attrList[$i] (!`getAttr $attrList[$i]`); | |
} | |
// Written by Loïc "L0Lock" DAUTRY | |
// Source: | |
// https://gist.github.com/L0Lock/c1330ee50b0775b23b34ec969f73906e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As the examples show, put your attribute IDs in the list after line 8, between quotation marks like these:
""
and with a coma,
at the end, except for the very last element of the list.If you don't know your attribute id, open your script editor, clear the top-part history, and toggle the attribute manually. The script history should show something like :
setAtt "yourObject.attribute"
Copy what's between the quotes.