Python: Trigger property update in foreach_get/set

Calling `foreach_get/set` on a collection property did not trigger
a property update. In the attribute API, this lead to missing
updates after e.g. setting the values of an attribute.

This adds a call to `RNA_property_update` for the getter/setter
bpy rna function and adds a property update callback to all the
different attribute collection properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/125518
This commit is contained in:
Falk David
2024-07-29 11:14:20 +02:00
committed by Falk David
parent 0f42f277b7
commit cd577f02b9
2 changed files with 15 additions and 0 deletions

View File

@@ -5742,6 +5742,9 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
return nullptr;
}
if (set) {
RNA_property_update(BPY_context_get(), &self->ptr, self->prop);
}
Py_RETURN_NONE;
}