Blender Git Commit Log

Git Commits -> Revision 3566b81

Revision 3566b81 by Sergey Sharybin (master)
July 31, 2019, 14:55 (GMT)
Refactor access to dependency graph

This change ensures that operators which needs access to evaluated data
first makes sure there is a dependency graph.

Other accesses to the dependency graph made it more explicit about
whether they just need a valid dependency graph pointer or whether they
expect the graph to be already evaluated.

This replaces OPTYPE_USE_EVAL_DATA which is now removed.

Some general rules about usage of accessors:

- Drawing is expected to happen from a fully evaluated dependency graph.
There is now a function to access it, which will in the future control
that dependency graph is actually evaluated.

This check is not yet done because there are some things to be taken
care about first: for example, post-update hooks might leave scene in
a state where something is still tagged for update.

- All operators which needs to access evaluated state must use
CTX_data_ensure_evaluated_depsgraph().

This function replaces OPTYPE_USE_EVAL_DATA.

The call is generally to be done in the very beginning of the
operator, prior other logic (unless this is some comprehensive
operator which might or might not need access to an evaluated state).

This call is never to be used from a loop.

If some utility function requires evaluated state of dependency graph
the graph is to be passed as an explicit argument. This way it is
clear that no evaluation happens in a loop or something like this.

- All cases which needs to know dependency graph pointer, but which
doesn't want to actually evaluate it can use old-style function
CTX_data_depsgraph_pointer(), assuming that underlying code will
ensure dependency graph is evaluated prior to accessing it.

- The new functions are replacing OPTYPE_USE_EVAL_DATA, so now it is
explicit and local about where dependency graph is being ensured.

This commit also contains some fixes of wrong usage of evaluation
functions on original objects. Ideally should be split out, but in
reality with all the APIs being renamed is quite tricky.

Fixes T67454: Blender crash on rapid undo and select

Speculation here is that sometimes undo and selection operators are
sometimes handled in the same event loop iteration, which leaves
non-evaluated dependency graph.

Fixes T67973: Crash on Fix Deforms operator
Fixes T67902: Crash when undo a loop cut

Reviewers: brecht

Reviewed By: brecht

Subscribers: lichtwerk

Maniphest Tasks: T67454

Differential Revision: https://developer.blender.org/D5343

Commit Details:

Full Hash: 3566b81c8bfa8c69d542a5de29ecb8d5af3ccb3d
Parent Commit: f5f3003
Lines Changed: +391, -321

102 Modified Paths:

/source/blender/blenkernel/BKE_context.h (+9, -2) (Diff)
/source/blender/blenkernel/intern/context.c (+12, -3) (Diff)
/source/blender/draw/intern/draw_manager.c (+1, -1) (Diff)
/source/blender/editors/armature/pose_edit.c (+3, -1) (Diff)
/source/blender/editors/armature/pose_lib.c (+0, -3) (Diff)
/source/blender/editors/armature/pose_slide.c (+6, -6) (Diff)
/source/blender/editors/armature/pose_transform.c (+15, -6) (Diff)
/source/blender/editors/curve/editcurve.c (+6, -5) (Diff)
/source/blender/editors/curve/editcurve_paint.c (+1, -1) (Diff)
/source/blender/editors/curve/editfont.c (+3, -3) (Diff)
/source/blender/editors/gizmo_library/gizmo_library_presets.c (+3, -1) (Diff)
/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c (+1, -1) (Diff)
/source/blender/editors/gpencil/annotate_paint.c (+10, -8) (Diff)
/source/blender/editors/gpencil/drawgpencil.c (+2, -1) (Diff)
/source/blender/editors/gpencil/gpencil_armature.c (+1, -1) (Diff)
/source/blender/editors/gpencil/gpencil_brush.c (+1, -1) (Diff)
/source/blender/editors/gpencil/gpencil_convert.c (+5, -2) (Diff)
/source/blender/editors/gpencil/gpencil_data.c (+1, -1) (Diff)
/source/blender/editors/gpencil/gpencil_edit.c (+8, -8) (Diff)
/source/blender/editors/gpencil/gpencil_fill.c (+1, -1) (Diff)
/source/blender/editors/gpencil/gpencil_intern.h (+1, -1) (Diff)
/source/blender/editors/gpencil/gpencil_paint.c (+11, -10) (Diff)
/source/blender/editors/gpencil/gpencil_primitive.c (+1, -1) (Diff)
/source/blender/editors/gpencil/gpencil_select.c (+4, -4) (Diff)
/source/blender/editors/gpencil/gpencil_utils.c (+4, -5) (Diff)
/source/blender/editors/include/ED_mesh.h (+4, -1) (Diff)
/source/blender/editors/include/ED_view3d.h (+4, -0) (Diff)
/source/blender/editors/interface/interface_eyedropper_depth.c (+1, -1) (Diff)
/source/blender/editors/io/io_cache.c (+1, -1) (Diff)
/source/blender/editors/mask/mask_add.c (+1, -1) (Diff)
/source/blender/editors/mask/mask_ops.c (+2, -2) (Diff)
/source/blender/editors/mesh/editface.c (+1, -1) (Diff)
/source/blender/editors/mesh/editmesh_extrude.c (+3, -2) (Diff)
/source/blender/editors/mesh/editmesh_knife_project.c (+2, -2) (Diff)
/source/blender/editors/mesh/editmesh_loopcut.c (+1, -1) (Diff)
/source/blender/editors/mesh/editmesh_tools.c (+2, -2) (Diff)
/source/blender/editors/mesh/meshtools.c (+3, -3) (Diff)
/source/blender/editors/object/object_add.c (+16, -8) (Diff)
/source/blender/editors/object/object_constraint.c (+8, -8) (Diff)
/source/blender/editors/object/object_data_transfer.c (+6, -6) (Diff)
/source/blender/editors/object/object_edit.c (+3, -1) (Diff)
/source/blender/editors/object/object_gpencil_modifier.c (+1, -1) (Diff)
/source/blender/editors/object/object_hook.c (+7, -6) (Diff)
/source/blender/editors/object/object_modes.c (+0, -8) (Diff)
/source/blender/editors/object/object_modifier.c (+8, -8) (Diff)
/source/blender/editors/object/object_relations.c (+2, -2) (Diff)
/source/blender/editors/object/object_transform.c (+3, -3) (Diff)
/source/blender/editors/object/object_vgroup.c (+1, -1) (Diff)
/source/blender/editors/physics/dynamicpaint_ops.c (+2, -2) (Diff)
/source/blender/editors/physics/particle_edit.c (+9, -9) (Diff)
/source/blender/editors/physics/particle_object.c (+3, -3) (Diff)
/source/blender/editors/physics/physics_fluid.c (+9, -7) (Diff)
/source/blender/editors/physics/physics_pointcache.c (+2, -1) (Diff)
/source/blender/editors/physics/rigidbody_object.c (+2, -2) (Diff)
/source/blender/editors/render/render_internal.c (+6, -3) (Diff)
/source/blender/editors/render/render_opengl.c (+4, -2) (Diff)
/source/blender/editors/render/render_shading.c (+1, -1) (Diff)
/source/blender/editors/render/render_update.c (+1, -1) (Diff)
/source/blender/editors/screen/screen_ops.c (+1, -1) (Diff)
/source/blender/editors/sculpt_paint/paint_hide.c (+1, -1) (Diff)
/source/blender/editors/sculpt_paint/paint_image.c (+1, -1) (Diff)
/source/blender/editors/sculpt_paint/paint_image_proj.c (+5, -6) (Diff)
/source/blender/editors/sculpt_paint/paint_mask.c (+3, -3) (Diff)
/source/blender/editors/sculpt_paint/paint_utils.c (+1, -1) (Diff)
/source/blender/editors/sculpt_paint/paint_vertex.c (+4, -4) (Diff)
/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c (+4, -4) (Diff)
/source/blender/editors/sculpt_paint/sculpt.c (+6, -6) (Diff)
/source/blender/editors/sculpt_paint/sculpt_undo.c (+23, -16) (Diff)
/source/blender/editors/sound/sound_ops.c (+4, -2) (Diff)
/source/blender/editors/space_clip/space_clip.c (+1, -1) (Diff)
/source/blender/editors/space_clip/tracking_ops_orient.c (+8, -2) (Diff)
/source/blender/editors/space_image/space_image.c (+1, -1) (Diff)
/source/blender/editors/space_outliner/outliner_select.c (+3, -3) (Diff)
/source/blender/editors/space_sequencer/sequencer_buttons.c (+1, -1) (Diff)
/source/blender/editors/space_sequencer/sequencer_draw.c (+1, -1) (Diff)
/source/blender/editors/space_sequencer/sequencer_edit.c (+2, -2) (Diff)
/source/blender/editors/space_sequencer/sequencer_view.c (+1, -1) (Diff)
/source/blender/editors/space_view3d/view3d_draw.c (+2, -2) (Diff)
/source/blender/editors/space_view3d/view3d_edit.c (+26, -23) (Diff)
/source/blender/editors/space_view3d/view3d_fly.c (+3, -7) (Diff)
/source/blender/editors/space_view3d/view3d_gizmo_camera.c (+2, -1) (Diff)
/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.c (+2, -2) (Diff)
/source/blender/editors/space_view3d/view3d_gizmo_ruler.c (+6, -1) (Diff)
/source/blender/editors/space_view3d/view3d_select.c (+1, -1) (Diff)
/source/blender/editors/space_view3d/view3d_snap.c (+8, -8) (Diff)
/source/blender/editors/space_view3d/view3d_view.c (+8, -6) (Diff)
/source/blender/editors/space_view3d/view3d_walk.c (+2, -2) (Diff)
/source/blender/editors/transform/transform_conversions.c (+1, -2) (Diff)
/source/blender/editors/transform/transform_generics.c (+1, -2) (Diff)
/source/blender/editors/transform/transform_gizmo_3d.c (+3, -1) (Diff)
/source/blender/editors/undo/ed_undo.c (+0, -9) (Diff)
/source/blender/editors/util/ed_util.c (+1, -1) (Diff)
/source/blender/editors/uvedit/uvedit_ops.c (+6, -6) (Diff)
/source/blender/makesrna/intern/rna_context.c (+1, -1) (Diff)
/source/blender/makesrna/intern/rna_layer.c (+2, -2) (Diff)
/source/blender/makesrna/intern/rna_modifier.c (+2, -2) (Diff)
/source/blender/makesrna/intern/rna_object_api.c (+5, -1) (Diff)
/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c (+3, -2) (Diff)
/source/blender/windowmanager/intern/wm_event_system.c (+1, -1) (Diff)
/source/blender/windowmanager/intern/wm_files.c (+1, -1) (Diff)
/source/blender/windowmanager/intern/wm_operators.c (+4, -1) (Diff)
/source/blender/windowmanager/WM_types.h (+0, -2) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021