1
$\begingroup$

My properties don't update (with the update function) when animating them using drivers or keyframe. the value do change in the interface but no update signal is sent! What am i suppose to do? Did i missed something? Is this a known python limitation ?

please don't tell me i need to use a handler to refresh every settings.. :-(

enter image description here

$\endgroup$
3
  • $\begingroup$ Hmm i believe i need to use set=update_fct. instead of the update=update_fct ? it seem that set react to drivers $\endgroup$
    – Fox
    Mar 16, 2021 at 20:36
  • 1
    $\begingroup$ Remember being disappointed this didn't work with 2.5 back in circa 2007. $\endgroup$
    – batFINGER
    Mar 16, 2021 at 21:28
  • $\begingroup$ created a task for this issue devtalk.blender.org/t/… $\endgroup$
    – Fox
    Mar 17, 2021 at 20:10

1 Answer 1

2
$\begingroup$

This issue has been brought up to the developers in a bug report https://developer.blender.org/T63793

It is a known limitation.

The reply from Dr Stüvel from the developers team :

The issue is that an object is not "tagged for update" in the dependency graph when a custom property is changed by Python. "Tagged for update" means that Blender understands that the object (and everything that depends on it) should be updated. This is done for a few reasons:

Tagging the object for update requires a reference to that object. This is available for simple cases like some_ob["prop"], but not for nested cases like some_ob["complex_prop"][3]["something"]. Updating an object could mean recalculating its constraints and modifiers, which can be expensive. This may not even be necessary for that particular custom property, but when exactly this is or is not necessary can be hard to determine. As a result, this could make Blender slower than necessary.

After setting the custom property, call C.object.update_tag(). This should take care of the updates not "being seen" by dependencies. It won't trigger a full redraw of Blender's UI, though, so until that happens things on screen may still show the old status.

So it might work on bpy.types.Object blender objects, but I don't see how to use it in property groups or in objects which have a number of dependencies.

I found that like you pointed in the comments, the set callback of the custom property is rightfully triggered, but not the update one. This is however a bit limiting since the set callback doesn't carry over the current context which may be necessary to have in the following update logic.

$\endgroup$
2
  • $\begingroup$ thanks for the info Note that they don't talk about the same kind of properties $\endgroup$
    – Fox
    Mar 17, 2021 at 20:10
  • $\begingroup$ @DB3D How are they different from the custom properties in your question ? $\endgroup$
    – Gorgious
    Mar 18, 2021 at 7:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .