Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    Set "Strength" on Constraint tag via Python Xpresso Node?

    Cinema 4D SDK
    1
    2
    400
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      joel-mic
      last edited by

      Hey Folks,

      I am very uninitiated in Python, but I assume this is a very easy setup.

      I have an Object in a hierarchy with a Constraint tag.

      I want a Python Xpresso node where I can pipe in an Object link and a float value. I need the code to then set the "Strength" (Constraint Tag, Aim tab) to the Float value I plug in.

      Can anyone spell out for me how to set this up? Thanks!

      1 Reply Last reply Reply Quote 0
      • J
        joel-mic
        last edited by joel-mic

        Ok, nevermind... I got something working about 3 minutes after posting this question. I'll paste below what worked for my needs. Maybe this will help someone else, or maybe you all have a more direct method to achieve this.

        def main():
            #inputs to the Xpresso Node are Link (named "LayerLink") and Float (named "FieldtInfluence")
        
            myObject = LayerLink
            myTag = myObject.GetTag(1019364)
        
            myTag.SetParameter(c4d.ID_CA_CONSTRAINT_TAG_AIM_TWEIGHT, FieldInfluence, c4d.DESCFLAGS_SET_0)
        1 Reply Last reply Reply Quote 1
        • First post
          Last post