Depsgraph: support flushing parameters without a full COW update

Avoid computationally expensive copying operations
when only some settings have been modified.

This is done by adding support for updating parameters
without tagging for copy-on-write.

Currently only mesh data blocks are supported,
other data-blocks can be added individually.

This prepares for changing values such as edit-mesh auto-smooth angle
in edit-mode without duplicating all mesh-data.
The benefit will only be seen when the user interface no longer tags
all ID's for copy on write updates.

ID_RECALC_GEOMETRY_ALL_MODES has been added to support situations
where non edit-mode geometry is modified in edit-mode.
While this isn't something user are likely to do,
Python scripts may change the underlying mesh.

Reviewed By: sergey

Ref D11377
This commit is contained in:
2021-06-24 19:13:52 +10:00
parent 67b352f9c5
commit 27da305a40
13 changed files with 128 additions and 11 deletions

View File

@@ -1060,7 +1060,7 @@ static PyObject *bpy_bmesh_to_mesh(BPy_BMesh *self, PyObject *args)
/* we could have the user do this but if they forget blender can easy crash
* since the references arrays for the objects derived meshes are now invalid */
DEG_id_tag_update(&me->id, ID_RECALC_GEOMETRY);
DEG_id_tag_update(&me->id, ID_RECALC_GEOMETRY_ALL_MODES);
Py_RETURN_NONE;
}