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

    Changing description properties dynamically

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 412 Views
    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 Offline
      Helper
      last edited by

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

      On 23/07/2012 at 00:13, xxxxxxxx wrote:

      Hi everybody,

      I'm getting stuck on my task to change the DESC_MAX value of a field in my tag-plugin. The value is initialized via the description-file.

      I've tried the same way as for userdata and many other possibilities but I can't solve this problem.
      I even can't read the information for DESC_MAX out of the field because of getting only an 'int object is subscriptable' error.

      Here the read part of my code:

        
      data = tag.GetDataInstance()  
      for descId, container in data:  
                #if descId[1].id == 1003:                  doesn't work with description properties...???  
                if descId == 1003:  
                    print container[c4d.DESC_MAX]
      

      Isn't it possible to read or change the description properties?

      Cheers,
      Sven

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

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

        On 23/07/2012 at 02:50, xxxxxxxx wrote:

        Hi Sven,

        First, GetDataInstance() returns the data container, not the description container.
        And it is not possible to access and change the description of standard parameters. Only the description of dynamic parameters (user data) can be retrieved and modified.

        Here is how to change the DESC_MAX in a user data description:

        import c4d
          
        def main() :
            for descid, container in op.GetUserDataContainer() :
                if descid[1].id==1: # User data is a float created with limit to 1000 (real unit)
                    container[c4d.DESC_MAX] = 2000 # Set limit to 2000
                    op.SetUserDataContainer(descid, container)
                    c4d.EventAdd()
          
        if __name__=='__main__':
            main()
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          On 23/07/2012 at 03:04, xxxxxxxx wrote:

          Hi Yannick,

          oh,... yeah...  Could be helpfull for me to master reading again...

          The procedure for changing user data is no problem - or let's say it works in my scripts. 😉

          Ok, thank you very much Yannick.
          Then I'll catch values out of range in the function itself.

          Have a nice day,
          Sven

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