FORUMS: list search recent posts

How do I create a python script for a specific tag?

COW Forums : Maxon Cinema 4D

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Petkov Stankov
How do I create a python script for a specific tag?
on Nov 18, 2016 at 8:13:15 pm

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.")
return

for i in objs:
tag = i.MakeTag(c4d.Tprotection)
doc.AddUndo(c4d.UNDOTYPE_NEW, tag)

c4d.EventAdd()

doc.EndUndo()

if __name__=='__main__':
main()

******************************


Return to posts index

Adam Trachtenberg
Re: How do I create a python script for a specific tag?
on Nov 19, 2016 at 12:15:52 am

Scripting, not my thing unfortunately. I think you'd have better luck submitting this question at the CGTalk C4D forum: http://forums.cgsociety.org/forumdisplay.php?f=47


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]