-
How do I create a python script for a specific tag?
I have a python script that WORKS (see the end of this message), but it’s about the protection tag. It was the only successful thing I could come up with after many many hours scouring the internet. But I can’t for the life of me, create a python script that puts a collider tag on an object. When I manually assign a hair collider tag on an object, In the “script log” window I see this line…
“CallCommand(100004788, 50045); // New Tag”
So I’m guessing the ID for the hair collider tag is “50045” but how do I actually put that tag ID in a python script? It can be even be a coffee script, I don’t care. Please let me know if you know the answer. Thank you,
Trajko
******************************
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.”)
returnfor i in objs:
tag = i.MakeTag(c4d.Tprotection)
doc.AddUndo(c4d.UNDOTYPE_NEW, tag)c4d.EventAdd()
doc.EndUndo()
if __name__==’__main__’:
main()******************************