Python tag plugin - updating userdata?

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?

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

Ah, got it.

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