Page MenuHome

Transform Snap: Remove depsgraph when creating context
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on Mar 3 2020, 10:42 PM.

Details

Summary

In theory this change should not bring functional changes.
But when I test a branch with a snap gizmo, I realize that after a Undo, the depsgraph pointed by the snap_context has its memory invalidated.
I don't know why that happens, but it tells me that the depsgraph shouldn't be part of creating the context, and should be called at runtime.
This patch is essential for D7000.

Diff Detail

Repository
rB Blender
Branch
arcpatch-D7013 (branched from master)
Build Status
Buildable 6955
Build 6955: arc lint + arc unit

Event Timeline

Campbell Barton (campbellbarton) requested changes to this revision.Mar 4 2020, 11:49 PM

Note that the snapping context wasn't intended to be kept between undo-steps, however if this all thats needed to support it. It seems fine.

Minor request relating to ruler inline.


Note that the number of arguments to ED_transform_snap_object_* functions is getting a bit out of hand, we could could make input parameters & output parameters two separate arguments. Although thats for a separate patch.

source/blender/editors/space_view3d/view3d_gizmo_ruler.c
306–307

Prefer to pass depsgraph instead of context.

BKE_scene_graph_evaluated_ensure can then be used before passing the depsgraph to the snap context.

RulerItem will need to have a reference to Main.

This revision now requires changes to proceed.Mar 4 2020, 11:49 PM
  • Remove peelObjectsSnapContext (it is not really used)
  • Pass depsgraph in view3d_ruler_item_mousemove instead of context
This revision is now accepted and ready to land.Mar 5 2020, 11:15 AM