Created
September 19, 2012 09:33
-
-
Save 990adjustments/3748704 to your computer and use it in GitHub Desktop.
A Cinema 4D Python script that adds an expresso tag to selected objects. Has undo support.
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 | |
def main(): | |
doc.StartUndo() | |
# Flags | |
# 0 GETACTIVEOBJECTFLAGS_0 | |
# 1 GETACTIVEOBJECTFLAGS_CHILDREN | |
# 2 GETACTIVEOBJECTFLAGS_SELECTIONORDER | |
objs = doc.GetActiveObjects(1) | |
if not objs: | |
print("No objects selected.") | |
return | |
for i in objs: | |
tag = i.MakeTag(c4d.Texpresso) | |
doc.AddUndo(c4d.UNDOTYPE_NEW, tag) | |
c4d.EventAdd() | |
doc.EndUndo() | |
if __name__=='__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment