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

    Python tag plugin - updating userdata?

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 786 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

      On 29/06/2018 at 09:41, xxxxxxxx wrote:

      I'm working on a python tag plugin, and can't seem to figure out how to do a very simple entry update...

      The plugin was converted from a tag using the prototype converter (which is really awesome, btw). I am capturing the message update from when an entry is changed (using c4d.MSG_DESCRIPTION_CHECKUPDATE), and I can catch the ID of the entry, as well as the value associated to it. I can also (seemingly) set its value - but it isn't propagated in the tag attribute manager view.

      Here's what I mean:

      def Message(self, op, id, data) :

      > bc = op.GetData()

      if id == c4d.MSG_DESCRIPTION_CHECKUPDATE:

      > newID = data['descid'][0].id

      > if(newID > 1002) and (newID < 1007) :
      > > print "ID: ", newID, "Value: ", bc[newID] #>> prints the current ID and value
      >
      >>
      >
      >
      >> bc.SetData(newID, 875.0) #>> sets a new arbitrary value
      >
      >>
      >
      >
      >> print "ID: ", newID, "Value: ", bc[newID]

      The second print gives me 875.0, as expected - but the entryfield in the attribute manager isn't updated... How would I go about that?

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

        On 29/06/2018 at 16:02, xxxxxxxx wrote:

        Ah, got it.

        using op[data[descid']] = value did it!

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