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

    Limiting user data entries

    PYTHON Development
    0
    3
    531
    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.
    • H
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 24/06/2011 at 21:18, xxxxxxxx wrote:

      Hello fine Gents and ladies! 🙂I was hoping to find out If there is a way to dynamically limit the Maximum limit for a user data entry.

      for example....

      i have a user data value, a float.

      width     = op[c4d.ID_USERDATA,6]

      and another

      bevRadius  = op[c4d.ID_USERDATA,5]

      and i want to dynamically set the limit of the bevRadius based on the width. i have been able to get it to hapen within the code, but i was hoping there might be a way to just stop the value from exceeding a certain limit while the user is sliding the control.

      thanks for the help! ... again. 😕

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 25/06/2011 at 03:53, xxxxxxxx wrote:

        Try this.

        import      c4d  
          
        myUserDataId        = 1  
        myNewMaxLimitValue  = 2  
        myObject            = doc.GetFirstObject()  
          
        allUserdatas        = myObject.GetUserDataContainer()  
          
        for descId, container in allUserdatas:  
          # get the UserData id from 'descId'  
          id              = descId[1].id  
          
          if id == myUserDataId:  
              # the id for the maximum value is 6  
              container[6]    = myNewMaxLimitValue  
              myObject.SetUserDataContainer(descId, container)
        

        Cheers,

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 25/06/2011 at 15:44, xxxxxxxx wrote:

          perfection😄! thanks nux!

          EDIT: not only did you help me with this, but that simple loop through User data containers is awesome! thanks so much man!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post