Force UI/custom property refresh/update

So, I’ve got a script that updates a custom property, which in turn drives a shape key value. The thing is, the script fails to update the actual value in the property until you mouse over the UI, and even then the shape key fails to update until manually clicking/unclicking the shape key value. I’ve been told that this is because custom properties aren’t part of the depsgraph. Campbell pointed me to the update_tag() function, but I can’t figure out the minimal information provided in the API docs to save my life. Anyone out there got some more specific advice for me?

Just calling "custompropertyname.ID.update_tag() should do the trick. The optional refresh parameter is for, I suppose, setting what you want to be updated: the object itself, its data and/or its timing. It takes a Python set as its value containing any of the possible keywords, so this would be for instance “custompropertyname.ID.update_tag(refresh={DATA, TIME})” to update display data for the data and the timing.

Ok, so I just deducted this answer from the information in the API, so it could be it wont work. Let me know if it fails and Ill do a live code test to figure out the right solution.

Have fun!

Note that if a property changes on hover, it means that is has already changed, just the interface did not redraw to reflect the change.

You can tag_redraw() areas and regions if necessary to “force” a redraw.