Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. EugeneNUA
    E
    • Profile
    • Following 1
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    EugeneNUA

    @EugeneNUA

    0
    Reputation
    2
    Profile views
    2
    Posts
    0
    Followers
    1
    Following
    Joined Last Online

    EugeneNUA Unfollow Follow

    Latest posts made by EugeneNUA

    • RE: Setting an object to the target section of a Transform Constraint Tag

      Hello! @ferdinand

      Proud to be a part of the community.

      Wow, how close the solution to the problem was, but I couldn't find any mention of it anywhere.

      Thank you so much for the ready-made solution and quick help!

      posted in Cinema 4D SDK
      E
      EugeneNUA
    • Setting an object to the target section of a Transform Constraint Tag

      Hi everyone!

      I'm trying to set up the constraint tag, so this will pick the movement from another object. I need to do it strictly with Transform Constraint Tag.

      I was playing around with code and different parameters, but one is driving me crazy, I just can't figure out how to set an object as a target. Likewise, I used SearchObject, I got GUID nothing is going to help.

      I digged through the forums and found out that the UI ID of the target matters (10001), but I find no samples how to use the ID properly in Python scripts. Appreciate any help!

      I work on Windows 11
      Cinema 4D 2023.2.2

      import c4d
      from c4d import gui
      
      doc = c4d.documents.GetActiveDocument()
      
      target_obj = doc.SearchObject("Test")
      
      
      def addConstraint():
          objects = doc.GetActiveObjects(1)
          print(objects)
          my_obj = doc.SearchObject("Test")
          
          for obj in objects:
              tag = obj.MakeTag(c4d.Tcaconstraint)
              print(f"Your tag: {tag}")
              my_obj = doc.SearchObject("Test")
              tag()[c4d.ID_CA_CONSTRAINT_TAG_PSR] = True
              tag()[c4d.ID_CA_CONSTRAINT_TAG_PSR_LINK] = my_obj
              tag()[c4d.ID_CA_CONSTRAINT_TAG_PSR_P_OFFSET] = c4d.Vector(5,0,0)
              tag()[c4d.ID_CA_CONSTRAINT_TAG_PSR_MAINTAIN] = True
              tag.SetName("Boo")
              c4d.EventAdd()
      addConstraint()
      
      posted in Cinema 4D SDK 2023 python windows
      E
      EugeneNUA