Last active
June 26, 2017 11:09
-
-
Save MikeUdin/1728371e92d144014cebe4bacf49f09f to your computer and use it in GitHub Desktop.
Toggle Tools Example
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
import c4d | |
# Toggle selecting between different tools | |
# Author: Mike Udin | |
# http://mikeudin.net | |
def main(): | |
values = (200000083, # Live Selection | |
200000088, # Move | |
200000085, # Lasso Selection | |
200000086) # Polygon Selection | |
done = False | |
for num,x in enumerate(values): | |
if x == doc.GetAction(): | |
new_v = values[(num+1)%len(values)] | |
doc.SetAction(new_v) | |
done = True | |
break | |
if not done: | |
doc.SetAction(values[0]) | |
c4d.EventAdd() | |
if __name__=='__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment