Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Maxon Cinema 4D How do I create a python script for a specific tag?

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

    Posted by Petkov Stankov on November 18, 2016 at 8:13 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()

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

    Adam Trachtenberg replied 9 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy