Add my own update= to existing property?

Hello All,

I am wondering if it is possible to add my own update=def to an existing property?

For instance, I have a node with a standard update event. When I change the color of the node an update() event is fired. What I would like to do is route that update to another def, like bpy properties can.

Does anyone know of a way to install such an override to a class? Perhaps in the init() of the class itself?

Thanks

you can only register a property (or node class?) again with a callback contained. Don’t think it’s a good idea though. I once tried to attach an update callback to the Object.name property, by registering bpy.types.Object.name myself, and it sort of worked. It crashed blender sporadically however, so this seems like a no-go. If a node was defined by another py script, then it shouldn’t be as much of a problem.

Thanks for the info. I have abandoned that approach as well. Instead of changing the background color of the node with a timer (which issues tons of update() events) I am using OpenGL to just draw an indicator on top. OpenGL draw does not seem to generate any new events within the node which is what I was looking for.

PS: Do have handy a code example of your failed attempt? I am mainly trying to intercept an update() event and cancel it rather than do special work. That may not crash Blender…?

I did it directly in py console. Tried it again in 2.69 and it’s pretty useless actually, datablock name persists, but script access to Object.name will return the string of the new StringProperty.

Can’t see a way to get a hold of an existing callback function :frowning: