Skip to content

Instantly share code, notes, and snippets.

@MikeUdin
Last active June 26, 2017 11:09
Show Gist options
  • Save MikeUdin/1728371e92d144014cebe4bacf49f09f to your computer and use it in GitHub Desktop.
Save MikeUdin/1728371e92d144014cebe4bacf49f09f to your computer and use it in GitHub Desktop.
Toggle Tools Example
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