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
This commit is contained in:
Sergey Sharybin 2019-07-25 16:36:22 +02:00
parent f5f3003874
commit 3566b81c8b
Notes: blender-bot 2023-02-14 09:43:37 +01:00
Referenced by issue #68779, "Match Texture Space" Causes blender to crash (also doesnt evaluate right when curve geo changes)
Referenced by issue #68728, Blender crashes while undoing a loop cut (mirror modifier involved)
Referenced by issue #68004, Bones don't immediately update with active motion path
Referenced by issue #67973, Crash on Fix Deforms operator
Referenced by issue #67902, Crash when undo a loop cut
Referenced by issue #67454, Blender crash
Referenced by issue #67207, Blender Release Candidate Version 2.80 (2.90 2019-07-11) Crashes often.
102 changed files with 391 additions and 321 deletions

View File

@ -318,7 +318,14 @@ int CTX_data_editable_gpencil_strokes(const bContext *C, ListBase *list);
* evaluated data points of view.
*
* NOTE: Can not be used if access to a fully evaluated datablock is needed. */
struct Depsgraph *CTX_data_depsgraph(const bContext *C);
struct Depsgraph *CTX_data_depsgraph_pointer(const bContext *C);
/* Get dependency graph which is expected to be fully evaluated.
*
* In the release builds it is the same as CTX_data_depsgraph_pointer(). In the debug builds extra
* sanity checks are done. Additionally, this provides more semantic meaning to what is exactly
* expected to happen. */
struct Depsgraph *CTX_data_expect_evaluated_depsgraph(const bContext *C);
/* Gets fully updated and evaluated dependency graph.
*
@ -326,7 +333,7 @@ struct Depsgraph *CTX_data_depsgraph(const bContext *C);
*
* NOTE: Will be expensive if there are relations or objects tagged for update.
* NOTE: If there are pending updates depsgraph hooks will be invoked. */
struct Depsgraph *CTX_data_evaluated_depsgraph(const bContext *C);
struct Depsgraph *CTX_data_ensure_evaluated_depsgraph(const bContext *C);
/* Will Return NULL if depsgraph is not allocated yet.
* Only used by handful of operators which are run on file load.

View File

@ -1348,7 +1348,7 @@ int CTX_data_editable_gpencil_strokes(const bContext *C, ListBase *list)
return ctx_data_collection_get(C, "editable_gpencil_strokes", list);
}
Depsgraph *CTX_data_depsgraph(const bContext *C)
Depsgraph *CTX_data_depsgraph_pointer(const bContext *C)
{
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
@ -1361,9 +1361,18 @@ Depsgraph *CTX_data_depsgraph(const bContext *C)
return depsgraph;
}
Depsgraph *CTX_data_evaluated_depsgraph(const bContext *C)
Depsgraph *CTX_data_expect_evaluated_depsgraph(const bContext *C)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
/* TODO(sergey): Assert that the dependency graph is fully evaluated.
* Note that first the depsgraph and scene post-eval hooks needs to run extra round of updates
* first to make check here really reliable. */
return depsgraph;
}
Depsgraph *CTX_data_ensure_evaluated_depsgraph(const bContext *C)
{
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
Main *bmain = CTX_data_main(C);
BKE_scene_graph_evaluated_ensure(depsgraph, bmain);
return depsgraph;

View File

@ -1528,7 +1528,7 @@ void DRW_notify_view_update(const DRWUpdateContext *update_ctx)
* for each relevant engine / mode engine. */
void DRW_draw_view(const bContext *C)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C);
ARegion *ar = CTX_wm_region(C);
View3D *v3d = CTX_wm_view3d(C);
Scene *scene = DEG_get_evaluated_scene(depsgraph);

View File

@ -195,7 +195,9 @@ void ED_pose_recalculate_paths(bContext *C, Scene *scene, Object *ob, bool curre
}
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
/* NOTE: Dependency graph will be evaluated at all the frames, but we first need to access some
* nested pointers, like animation data. */
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ListBase targets = {NULL, NULL};
bool free_depsgraph = false;

View File

@ -1731,9 +1731,6 @@ static void poselib_preview_cleanup(bContext *C, wmOperator *op)
if (IS_AUTOKEY_MODE(scene, NORMAL)) {
// remake_action_ipos(ob->action);
}
else {
BKE_pose_where_is(CTX_data_depsgraph(C), scene, ob);
}
}
/* Request final redraw of the view. */

View File

@ -1373,7 +1373,7 @@ void POSE_OT_push(wmOperatorType *ot)
ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
/* Properties */
pose_slide_opdef_properties(ot);
@ -1435,7 +1435,7 @@ void POSE_OT_relax(wmOperatorType *ot)
ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
/* Properties */
pose_slide_opdef_properties(ot);
@ -1496,7 +1496,7 @@ void POSE_OT_push_rest(wmOperatorType *ot)
ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
/* Properties */
pose_slide_opdef_properties(ot);
@ -1558,7 +1558,7 @@ void POSE_OT_relax_rest(wmOperatorType *ot)
ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
/* Properties */
pose_slide_opdef_properties(ot);
@ -1620,7 +1620,7 @@ void POSE_OT_breakdown(wmOperatorType *ot)
ot->poll = ED_operator_posemode;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
/* Properties */
pose_slide_opdef_properties(ot);
@ -2025,7 +2025,7 @@ void POSE_OT_propagate(wmOperatorType *ot)
ot->poll = ED_operator_posemode; /* XXX: needs selected bones! */
/* flag */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
/* TODO: add "fade out" control for tapering off amount of propagation as time goes by? */

View File

@ -71,7 +71,15 @@
* that are bone-parented to armature */
static void applyarmature_fix_boneparents(const bContext *C, Scene *scene, Object *armob)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
/* Depsgraph has been ensured to be evaluated at the beginning of the operator.
*
* Must not evaluate depsgraph here yet, since this will ruin object matrix which we want to
* preserve after other changes has been done in the operator.
*
* TODO(sergey): This seems very similar to `ignore_parent_tx()`, which was now ensured to work
* quite reliably. Can we de-duplicate the code? Or at least verify we don't need an extra logic
* in this function. */
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
Main *bmain = CTX_data_main(C);
Object workob, *ob;
@ -318,7 +326,7 @@ static void applyarmature_process_selected_rec(bArmature *arm,
static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
// must be active object, not edit-object
Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
@ -422,7 +430,7 @@ void POSE_OT_armature_apply(wmOperatorType *ot)
ot->ui = apply_armature_pose2bones_ui;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna,
"selected",
@ -436,7 +444,7 @@ static int pose_visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op))
{
ViewLayer *view_layer = CTX_data_view_layer(C);
View3D *v3d = CTX_wm_view3d(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob) {
/* loop over all selected pchans
@ -1026,6 +1034,7 @@ static int pose_clear_transform_generic_exec(bContext *C,
void (*clear_func)(bPoseChannel *),
const char default_ksName[])
{
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
bool changed_multi = false;
@ -1041,8 +1050,8 @@ static int pose_clear_transform_generic_exec(bContext *C,
ViewLayer *view_layer = CTX_data_view_layer(C);
View3D *v3d = CTX_wm_view3d(C);
FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob_iter) {
Object *ob_eval = DEG_get_evaluated_object(
CTX_data_depsgraph(C), ob_iter); // XXX: UGLY HACK (for autokey + clear transforms)
// XXX: UGLY HACK (for autokey + clear transforms)
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob_iter);
ListBase dsources = {NULL, NULL};
bool changed = false;

View File

@ -7094,16 +7094,17 @@ static bool match_texture_space_poll(bContext *C)
static int match_texture_space_exec(bContext *C, wmOperator *UNUSED(op))
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Scene *scene = CTX_data_scene(C);
/* Need to ensure the dependency graph is fully evaluated, so the display list is at a correct
* state. */
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
(void)depsgraph;
Object *object = CTX_data_active_object(C);
Curve *curve = (Curve *)object->data;
float min[3], max[3], size[3], loc[3];
int a;
if (object->runtime.curve_cache == NULL) {
BKE_displist_make_curveTypes(depsgraph, scene, object, false, false);
}
BLI_assert(object->runtime.curve_cache != NULL);
INIT_MINMAX(min, max);
BKE_displist_minmax(&object->runtime.curve_cache->disp, min, max);

View File

@ -586,7 +586,7 @@ static bool curve_draw_init(bContext *C, wmOperator *op, bool is_invoke)
}
else {
cdd->vc.bmain = CTX_data_main(C);
cdd->vc.depsgraph = CTX_data_depsgraph(C);
cdd->vc.depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
cdd->vc.scene = CTX_data_scene(C);
cdd->vc.view_layer = CTX_data_view_layer(C);
cdd->vc.obedit = CTX_data_edit_object(C);

View File

@ -407,7 +407,6 @@ static int insert_into_textbuf(Object *obedit, uintptr_t c)
static void text_update_edited(bContext *C, Object *obedit, int mode)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Curve *cu = obedit->data;
EditFont *ef = cu->editfont;
@ -421,6 +420,7 @@ static void text_update_edited(bContext *C, Object *obedit, int mode)
else {
/* depsgraph runs above, but since we're not tagging for update, call direct */
/* We need evaluated data here. */
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
BKE_vfont_to_curve(DEG_get_evaluated_object(depsgraph, obedit), mode);
}
@ -590,7 +590,7 @@ void FONT_OT_text_paste_from_file(wmOperatorType *ot)
static void txt_add_object(bContext *C, TextLine *firstline, int totline, const float offset[3])
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
Curve *cu;
@ -1084,7 +1084,7 @@ static const EnumPropertyItem move_type_items[] = {
static int move_cursor(bContext *C, int type, const bool select)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *obedit = CTX_data_edit_object(C);
Curve *cu = obedit->data;
EditFont *ef = cu->editfont;

View File

@ -125,6 +125,8 @@ void ED_gizmo_draw_preset_circle(const struct wmGizmo *gz,
void ED_gizmo_draw_preset_facemap(
const bContext *C, const struct wmGizmo *gz, Object *ob, const int facemap, int select_id)
{
/* Dependency graph is supposed to be evaluated prior to draw. */
Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C);
const bool is_select = (select_id != -1);
const bool is_highlight = is_select && (gz->state & WM_GIZMO_STATE_HIGHLIGHT) != 0;
@ -137,7 +139,7 @@ void ED_gizmo_draw_preset_facemap(
GPU_matrix_push();
GPU_matrix_mul(ob->obmat);
ED_draw_object_facemap(CTX_data_depsgraph(C), ob, color, facemap);
ED_draw_object_facemap(depsgraph, ob, color, facemap);
GPU_matrix_pop();
if (is_select) {

View File

@ -363,7 +363,7 @@ static int gizmo_move_invoke(bContext *C, wmGizmo *gz, const wmEvent *event)
inter->snap_context_v3d = ED_transform_snap_object_context_create_view3d(
CTX_data_main(C),
CTX_data_scene(C),
CTX_data_depsgraph(C),
CTX_data_ensure_evaluated_depsgraph(C),
0,
CTX_wm_region(C),
CTX_wm_view3d(C));

View File

@ -1073,7 +1073,7 @@ static bool gp_session_initdata(bContext *C, tGPsdata *p)
/* pass on current scene and window */
p->bmain = CTX_data_main(C);
p->scene = CTX_data_scene(C);
p->depsgraph = CTX_data_depsgraph(C);
p->depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
p->win = CTX_wm_window(C);
unit_m4(p->imat);
@ -1630,7 +1630,7 @@ static int gpencil_draw_init(bContext *C, wmOperator *op, const wmEvent *event)
}
/* init painting data */
gp_paint_initstroke(p, paintmode, CTX_data_depsgraph(C));
gp_paint_initstroke(p, paintmode, CTX_data_ensure_evaluated_depsgraph(C));
if (p->status == GP_STATUS_ERROR) {
gpencil_draw_exit(C, op);
return 0;
@ -1903,7 +1903,7 @@ static void annotation_draw_apply_event(
static int gpencil_draw_exec(bContext *C, wmOperator *op)
{
tGPsdata *p = NULL;
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
/* printf("GPencil - Starting Re-Drawing\n"); */
@ -2057,7 +2057,7 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event
p->status = GP_STATUS_PAINTING;
/* handle the initial drawing - i.e. for just doing a simple dot */
annotation_draw_apply_event(op, event, CTX_data_depsgraph(C), 0.0f, 0.0f);
annotation_draw_apply_event(op, event, CTX_data_ensure_evaluated_depsgraph(C), 0.0f, 0.0f);
op->flag |= OP_IS_MODAL_CURSOR_REGION;
}
else {
@ -2098,7 +2098,7 @@ static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op)
* it'd be nice to allow changing paint-mode when in sketching-sessions */
if (gp_session_initdata(C, p)) {
gp_paint_initstroke(p, p->paintmode, CTX_data_depsgraph(C));
gp_paint_initstroke(p, p->paintmode, CTX_data_ensure_evaluated_depsgraph(C));
}
if (p->status != GP_STATUS_ERROR) {
@ -2133,6 +2133,7 @@ static void annotation_add_missing_events(bContext *C,
const wmEvent *event,
tGPsdata *p)
{
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
float pt[2], a[2], b[2];
float factor = 10.0f;
@ -2148,7 +2149,7 @@ static void annotation_add_missing_events(bContext *C,
interp_v2_v2v2(pt, a, b, 0.5f);
sub_v2_v2v2(pt, b, pt);
/* create fake event */
annotation_draw_apply_event(op, event, CTX_data_depsgraph(C), pt[0], pt[1]);
annotation_draw_apply_event(op, event, depsgraph, pt[0], pt[1]);
}
else if (dist >= factor) {
int slices = 2 + (int)((dist - 1.0) / factor);
@ -2157,7 +2158,7 @@ static void annotation_add_missing_events(bContext *C,
interp_v2_v2v2(pt, a, b, n * i);
sub_v2_v2v2(pt, b, pt);
/* create fake event */
annotation_draw_apply_event(op, event, CTX_data_depsgraph(C), pt[0], pt[1]);
annotation_draw_apply_event(op, event, depsgraph, pt[0], pt[1]);
}
}
}
@ -2387,7 +2388,8 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
annotation_add_missing_events(C, op, event, p);
}
annotation_draw_apply_event(op, event, CTX_data_depsgraph(C), 0.0f, 0.0f);
/* TODO(sergey): Possibly evaluating dependency graph from modal operator? */
annotation_draw_apply_event(op, event, CTX_data_ensure_evaluated_depsgraph(C), 0.0f, 0.0f);
/* finish painting operation if anything went wrong just now */
if (p->status == GP_STATUS_ERROR) {

View File

@ -1117,7 +1117,8 @@ void ED_gp_draw_interpolation(const bContext *C, tGPDinterpolate *tgpi, const in
RegionView3D *rv3d = ar->regiondata;
tGPDinterpolate_layer *tgpil;
Object *obact = CTX_data_active_object(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
/* Drawing code is expected to run with fully evaluated depsgraph. */
Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C);
float color[4];

View File

@ -554,7 +554,7 @@ static bool gpencil_generate_weights_poll(bContext *C)
static int gpencil_generate_weights_exec(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob = CTX_data_active_object(C);
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);

View File

@ -1650,7 +1650,7 @@ static bool gpsculpt_brush_do_frame(
static bool gpsculpt_brush_apply_standard(bContext *C, tGP_BrushEditData *gso)
{
ToolSettings *ts = CTX_data_tool_settings(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *obact = gso->object;
bGPdata *gpd = gso->gpd;
bool changed = false;

View File

@ -162,7 +162,10 @@ static void gp_strokepoint_convertcoords(bContext *C,
Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C);
ARegion *ar = CTX_wm_region(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
/* TODO(sergey): This function might be called from a loop, but no tagging is happening in it,
* so it's not that expensive to ensure evaluated depsgraph here. However, ideally all the
* parameters are to wrapped into a context style struct and queried from Context once.*/
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *obact = CTX_data_active_object(C);
bGPDspoint mypt, *pt;
@ -1241,7 +1244,7 @@ static int gp_camera_view_subrect(bContext *C, rctf *subrect)
/* for camera view set the subrect */
if (rv3d->persp == RV3D_CAMOB) {
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ED_view3d_calc_camera_border(scene, depsgraph, ar, v3d, rv3d, subrect, true);
return 1;
}

View File

@ -2200,7 +2200,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *ob_active = CTX_data_active_object(C);
bGPdata *gpd_dst = NULL;
bool ok = false;

View File

@ -139,7 +139,6 @@ static int gpencil_editmode_toggle_exec(bContext *C, wmOperator *op)
const int back = RNA_boolean_get(op->ptr, "back");
struct wmMsgBus *mbus = CTX_wm_message_bus(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
bGPdata *gpd = ED_gpencil_data_get_active(C);
bool is_object = false;
short mode;
@ -159,6 +158,7 @@ static int gpencil_editmode_toggle_exec(bContext *C, wmOperator *op)
gpd->flag ^= GP_DATA_STROKE_EDITMODE;
/* recalculate parent matrix */
if (gpd->flag & GP_DATA_STROKE_EDITMODE) {
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ED_gpencil_reset_layers_parent(depsgraph, ob, gpd);
}
/* set mode */
@ -1381,7 +1381,7 @@ void GPENCIL_OT_paste(wmOperatorType *ot)
ot->poll = gp_strokes_paste_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
ot->prop = RNA_def_enum(ot->srna, "type", copy_type, 0, "Type", "");
@ -2495,7 +2495,7 @@ static int gp_snap_to_grid(bContext *C, wmOperator *UNUSED(op))
RegionView3D *rv3d = CTX_wm_region_data(C);
View3D *v3d = CTX_wm_view3d(C);
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *obact = CTX_data_active_object(C);
const float gridf = ED_view3d_grid_view_scale(scene, v3d, rv3d, NULL);
@ -2570,7 +2570,7 @@ static int gp_snap_to_cursor(bContext *C, wmOperator *op)
bGPdata *gpd = ED_gpencil_data_get_active(C);
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *obact = CTX_data_active_object(C);
const bool use_offset = RNA_boolean_get(op->ptr, "use_offset");
@ -2663,7 +2663,7 @@ static int gp_snap_cursor_to_sel(bContext *C, wmOperator *UNUSED(op))
Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *obact = CTX_data_active_object(C);
float *cursor = scene->cursor.location;
@ -3374,7 +3374,7 @@ static int gp_strokes_reproject_exec(bContext *C, wmOperator *op)
bGPdata *gpd = ED_gpencil_data_get_active(C);
Scene *scene = CTX_data_scene(C);
ToolSettings *ts = CTX_data_tool_settings(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *ob = CTX_data_active_object(C);
ARegion *ar = CTX_wm_region(C);
RegionView3D *rv3d = ar->regiondata;
@ -3537,7 +3537,7 @@ void GPENCIL_OT_reproject(wmOperatorType *ot)
ot->poll = gp_strokes_edit3d_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
ot->prop = RNA_def_enum(
@ -4527,7 +4527,7 @@ void GPENCIL_OT_stroke_cutter(wmOperatorType *ot)
ot->cancel = WM_gesture_lasso_cancel;
/* flag */
ot->flag = OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_UNDO;
/* properties */
WM_operator_properties_gesture_lasso(ot);

View File

@ -1213,7 +1213,7 @@ static tGPDfill *gp_session_init_fill(bContext *C, wmOperator *UNUSED(op))
tgpf->ar = CTX_wm_region(C);
tgpf->rv3d = tgpf->ar->regiondata;
tgpf->v3d = tgpf->sa->spacedata.first;
tgpf->depsgraph = CTX_data_depsgraph(C);
tgpf->depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
tgpf->win = CTX_wm_window(C);
/* set GP datablock */

View File

@ -599,7 +599,7 @@ struct GP_EditableStrokes_Iter {
#define GP_EDITABLE_STROKES_BEGIN(gpstroke_iter, C, gpl, gps) \
{ \
struct GP_EditableStrokes_Iter gpstroke_iter = {{{0}}}; \
Depsgraph *depsgraph_ = CTX_data_depsgraph(C); \
Depsgraph *depsgraph_ = CTX_data_ensure_evaluated_depsgraph(C); \
Object *obact_ = CTX_data_active_object(C); \
bGPdata *gpd_ = CTX_data_gpencil_data(C); \
const bool is_multiedit_ = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_); \

View File

@ -1894,7 +1894,7 @@ static bool gp_session_initdata(bContext *C, wmOperator *op, tGPsdata *p)
p->C = C;
p->bmain = CTX_data_main(C);
p->scene = CTX_data_scene(C);
p->depsgraph = CTX_data_depsgraph(C);
p->depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
p->win = CTX_wm_window(C);
p->disable_fill = RNA_boolean_get(op->ptr, "disable_fill");
@ -2431,7 +2431,7 @@ static int gpencil_draw_init(bContext *C, wmOperator *op, const wmEvent *event)
}
/* init painting data */
gp_paint_initstroke(p, paintmode, CTX_data_depsgraph(C));
gp_paint_initstroke(p, paintmode, CTX_data_ensure_evaluated_depsgraph(C));
if (p->status == GP_STATUS_ERROR) {
gpencil_draw_exit(C, op);
return 0;
@ -2825,10 +2825,10 @@ static void gpencil_draw_apply_event(
float pt[2];
copy_v2_v2(tmp, p->mval);
sub_v2_v2v2(pt, p->mval, p->mvali);
gpencil_draw_apply_event(C, op, event, CTX_data_depsgraph(C), pt[0], pt[1]);
gpencil_draw_apply_event(C, op, event, depsgraph, pt[0], pt[1]);
if (len_v2v2(p->mval, p->mvalo)) {
sub_v2_v2v2(pt, p->mval, p->mvalo);
gpencil_draw_apply_event(C, op, event, CTX_data_depsgraph(C), pt[0], pt[1]);
gpencil_draw_apply_event(C, op, event, depsgraph, pt[0], pt[1]);
}
copy_v2_v2(p->mval, tmp);
}
@ -2948,7 +2948,7 @@ static void gpencil_draw_apply_event(
static int gpencil_draw_exec(bContext *C, wmOperator *op)
{
tGPsdata *p = NULL;
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
/* printf("GPencil - Starting Re-Drawing\n"); */
@ -3196,7 +3196,7 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event
p->status = GP_STATUS_PAINTING;
/* handle the initial drawing - i.e. for just doing a simple dot */
gpencil_draw_apply_event(C, op, event, CTX_data_depsgraph(C), 0.0f, 0.0f);
gpencil_draw_apply_event(C, op, event, CTX_data_ensure_evaluated_depsgraph(C), 0.0f, 0.0f);
op->flag |= OP_IS_MODAL_CURSOR_REGION;
}
else {
@ -3260,7 +3260,7 @@ static tGPsdata *gpencil_stroke_begin(bContext *C, wmOperator *op)
* it'd be nice to allow changing paint-mode when in sketching-sessions */
if (gp_session_initdata(C, op, p)) {
gp_paint_initstroke(p, p->paintmode, CTX_data_depsgraph(C));
gp_paint_initstroke(p, p->paintmode, CTX_data_depsgraph_pointer(C));
}
if (p->status != GP_STATUS_ERROR) {
@ -3321,6 +3321,7 @@ static void gpencil_add_missing_events(bContext *C,
{
Brush *brush = p->brush;
GP_Sculpt_Guide *guide = &p->scene->toolsettings->gp_sculpt.guide;
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
int input_samples = brush->gpencil_settings->input_samples;
/* ensure sampling when using circular guide */
@ -3379,7 +3380,7 @@ static void gpencil_add_missing_events(bContext *C,
interp_v2_v2v2(pt, a, b, 0.5f);
sub_v2_v2v2(pt, b, pt);
/* create fake event */
gpencil_draw_apply_event(C, op, event, CTX_data_depsgraph(C), pt[0], pt[1]);
gpencil_draw_apply_event(C, op, event, depsgraph, pt[0], pt[1]);
}
else if (dist >= factor) {
int slices = 2 + (int)((dist - 1.0) / factor);
@ -3388,7 +3389,7 @@ static void gpencil_add_missing_events(bContext *C,
interp_v2_v2v2(pt, a, b, n * i);
sub_v2_v2v2(pt, b, pt);
/* create fake event */
gpencil_draw_apply_event(C, op, event, CTX_data_depsgraph(C), pt[0], pt[1]);
gpencil_draw_apply_event(C, op, event, depsgraph, pt[0], pt[1]);
}
}
}
@ -3695,7 +3696,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
gpencil_add_missing_events(C, op, event, p);
}
gpencil_draw_apply_event(C, op, event, CTX_data_depsgraph(C), 0.0f, 0.0f);
gpencil_draw_apply_event(C, op, event, CTX_data_depsgraph_pointer(C), 0.0f, 0.0f);
/* finish painting operation if anything went wrong just now */
if (p->status == GP_STATUS_ERROR) {

View File

@ -1109,7 +1109,7 @@ static void gpencil_primitive_init(bContext *C, wmOperator *op)
tgpi->ar = CTX_wm_region(C);
tgpi->rv3d = tgpi->ar->regiondata;
tgpi->v3d = tgpi->sa->spacedata.first;
tgpi->depsgraph = CTX_data_depsgraph(C);
tgpi->depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
tgpi->win = CTX_wm_window(C);
/* save original type */

View File

@ -989,7 +989,7 @@ void GPENCIL_OT_select_circle(wmOperatorType *ot)
ot->cancel = WM_gesture_circle_cancel;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
WM_operator_properties_gesture_circle(ot);
@ -1180,7 +1180,7 @@ void GPENCIL_OT_select_box(wmOperatorType *ot)
ot->poll = gpencil_select_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
WM_operator_properties_gesture_box(ot);
@ -1248,7 +1248,7 @@ void GPENCIL_OT_select_lasso(wmOperatorType *ot)
ot->cancel = WM_gesture_lasso_cancel;
/* flags */
ot->flag = OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_UNDO;
/* properties */
WM_operator_properties_select_operation(ot);
@ -1468,7 +1468,7 @@ void GPENCIL_OT_select(wmOperatorType *ot)
ot->poll = gpencil_select_poll;
/* flag */
ot->flag = OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_UNDO;
/* properties */
WM_operator_properties_mouse_select(ot);

View File

@ -259,7 +259,7 @@ bGPdata *ED_gpencil_data_get_active_evaluated(const bContext *C)
ID *screen_id = (ID *)CTX_wm_screen(C);
ScrArea *sa = CTX_wm_area(C);
const Depsgraph *depsgraph = CTX_data_depsgraph(C);
const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Object *ob = CTX_data_active_object(C);
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
@ -548,7 +548,7 @@ void gp_point_conversion_init(bContext *C, GP_SpaceConversion *r_gsc)
if (sa->spacetype == SPACE_VIEW3D) {
wmWindow *win = CTX_wm_window(C);
Scene *scene = CTX_data_scene(C);
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
View3D *v3d = (View3D *)CTX_wm_space_data(C);
RegionView3D *rv3d = ar->regiondata;
@ -560,8 +560,7 @@ void gp_point_conversion_init(bContext *C, GP_SpaceConversion *r_gsc)
/* for camera view set the subrect */
if (rv3d->persp == RV3D_CAMOB) {
ED_view3d_calc_camera_border(
scene, CTX_data_depsgraph(C), ar, v3d, rv3d, &r_gsc->subrect_data, true);
ED_view3d_calc_camera_border(scene, depsgraph, ar, v3d, rv3d, &r_gsc->subrect_data, true);
r_gsc->subrect = &r_gsc->subrect_data;
}
}
@ -929,7 +928,7 @@ void ED_gp_get_drawing_reference(
void ED_gpencil_project_stroke_to_view(bContext *C, bGPDlayer *gpl, bGPDstroke *gps)
{
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *ob = CTX_data_active_object(C);
bGPdata *gpd = (bGPdata *)ob->data;
GP_SpaceConversion gsc = {NULL};

View File

@ -254,7 +254,10 @@ void ED_operatormacros_mesh(void);
void ED_keymap_mesh(struct wmKeyConfig *keyconf);
/* editmesh_tools.c (could be moved) */
void EDBM_project_snap_verts(struct bContext *C, struct ARegion *ar, struct BMEditMesh *em);
void EDBM_project_snap_verts(struct bContext *C,
struct Depsgraph *depsgraph,
struct ARegion *ar,
struct BMEditMesh *em);
/* editface.c */
void paintface_flush_flags(struct bContext *C, struct Object *ob, short flag);

View File

@ -76,6 +76,10 @@ enum eGPUFXFlags;
typedef struct ViewContext {
struct bContext *C;
struct Main *bmain;
/* Dependency graph is uses for depth drawing, viewport camera matrix access, and also some areas
* are re-using this to access evaluated entities.
*
* Moral of the story: assign to a fully evaluated state. */
struct Depsgraph *depsgraph;
struct Scene *scene;
struct ViewLayer *view_layer;

View File

@ -168,7 +168,7 @@ static void depthdropper_depth_sample_pt(
if (sa->spacetype == SPACE_VIEW3D) {
ARegion *ar = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my);
if (ar) {
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
struct Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
View3D *v3d = sa->spacedata.first;
RegionView3D *rv3d = ar->regiondata;
/* weak, we could pass in some reference point */

View File

@ -147,7 +147,7 @@ static int cachefile_reload_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_CANCELLED;
}
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
BKE_cachefile_reload(depsgraph, cache_file);
return OPERATOR_FINISHED;

View File

@ -72,7 +72,7 @@ bool ED_mask_find_nearest_diff_point(const bContext *C,
float u = 0.0f;
float scalex, scaley;
Depsgraph *depsgraph = CTX_data_evaluated_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Mask *mask_eval = (Mask *)DEG_get_evaluated_id(depsgraph, &mask_orig->id);
ED_mask_get_size(sa, &width, &height);

View File

@ -86,7 +86,7 @@ MaskSplinePoint *ED_mask_point_find_nearest(const bContext *C,
eMaskWhichHandle which_handle = MASK_WHICH_HANDLE_NONE;
int width, height;
Depsgraph *depsgraph = CTX_data_evaluated_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Mask *mask_eval = (Mask *)DEG_get_evaluated_id(depsgraph, &mask_orig->id);
ED_mask_get_size(sa, &width, &height);
@ -241,7 +241,7 @@ bool ED_mask_feather_find_nearest(const bContext *C,
float scalex, scaley;
int width, height;
Depsgraph *depsgraph = CTX_data_evaluated_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Mask *mask_eval = (Mask *)DEG_get_evaluated_id(depsgraph, &mask_orig->id);
ED_mask_get_size(sa, &width, &height);

View File

@ -77,7 +77,7 @@ void paintface_flush_flags(struct bContext *C, Object *ob, short flag)
BKE_mesh_flush_select_from_polys(me);
}
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
if (ob_eval == NULL) {

View File

@ -658,6 +658,7 @@ void MESH_OT_extrude_faces_indiv(wmOperatorType *ot)
static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ViewContext vc;
BMVert *v1;
BMIter iter;
@ -819,7 +820,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
/* also project the source, for retopo workflow */
if (use_proj) {
EDBM_project_snap_verts(C, vc.ar, vc.em);
EDBM_project_snap_verts(C, depsgraph, vc.ar, vc.em);
}
}
@ -852,7 +853,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
}
if (use_proj) {
EDBM_project_snap_verts(C, vc.ar, vc.em);
EDBM_project_snap_verts(C, depsgraph, vc.ar, vc.em);
}
/* This normally happens when pushing undo but modal operators

View File

@ -57,7 +57,7 @@ static LinkNode *knifeproject_poly_from_object(const bContext *C,
Object *ob,
LinkNode *polys)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ARegion *ar = CTX_wm_region(C);
struct Mesh *me_eval;
bool me_eval_needs_free;
@ -173,7 +173,7 @@ void MESH_OT_knife_project(wmOperatorType *ot)
ot->poll = ED_operator_editmesh_region_view3d;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING;
/* parameters */
RNA_def_boolean(ot->srna,

View File

@ -272,7 +272,7 @@ static int ringsel_init(bContext *C, wmOperator *op, bool do_cut)
em_setup_viewcontext(C, &lcd->vc);
lcd->depsgraph = CTX_data_depsgraph(C);
lcd->depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
/* assign the drawing handle for drawing preview line... */
lcd->ar = CTX_wm_region(C);

View File

@ -411,7 +411,7 @@ void MESH_OT_unsubdivide(wmOperatorType *ot)
ot->srna, "iterations", 2, 1, 1000, "Iterations", "Number of times to unsubdivide", 1, 100);
}
void EDBM_project_snap_verts(bContext *C, ARegion *ar, BMEditMesh *em)
void EDBM_project_snap_verts(bContext *C, Depsgraph *depsgraph, ARegion *ar, BMEditMesh *em)
{
Main *bmain = CTX_data_main(C);
Object *obedit = em->ob;
@ -421,7 +421,7 @@ void EDBM_project_snap_verts(bContext *C, ARegion *ar, BMEditMesh *em)
ED_view3d_init_mats_rv3d(obedit, ar->regiondata);
struct SnapObjectContext *snap_context = ED_transform_snap_object_context_create_view3d(
bmain, CTX_data_scene(C), CTX_data_depsgraph(C), 0, ar, CTX_wm_view3d(C));
bmain, CTX_data_scene(C), depsgraph, 0, ar, CTX_wm_view3d(C));
BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {

View File

@ -311,7 +311,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
/* count & check */
CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) {
@ -674,7 +674,7 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
Object *ob_active = CTX_data_active_object(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Mesh *me = (Mesh *)ob_active->data;
Mesh *selme = NULL;
Mesh *me_deformed = NULL;
@ -1165,7 +1165,7 @@ static void ed_mesh_pick_face_vert__mpoly_find(
bool ED_mesh_pick_face_vert(
bContext *C, Object *ob, const int mval[2], uint dist_px, uint *r_index)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
unsigned int poly_index;
Mesh *me = ob->data;

View File

@ -236,7 +236,7 @@ void ED_object_base_init_transform(bContext *C, Base *base, const float loc[3],
{
Object *ob = base->object;
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
if (!scene) {
return;
@ -250,7 +250,11 @@ void ED_object_base_init_transform(bContext *C, Base *base, const float loc[3],
copy_v3_v3(ob->rot, rot);
}
BKE_object_where_is_calc(depsgraph, scene, ob);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Object *object_eval = DEG_get_evaluated_object(depsgraph, ob);
BKE_object_transform_copy(object_eval, ob);
BKE_object_where_is_calc(depsgraph, scene_eval, object_eval);
BKE_object_transform_copy(ob, object_eval);
}
/* Uses context to figure out transform for primitive.
@ -1758,12 +1762,15 @@ static bool dupliobject_instancer_cmp(const void *a_, const void *b_)
return false;
}
static void make_object_duplilist_real(
bContext *C, Scene *scene, Base *base, const bool use_base_parent, const bool use_hierarchy)
static void make_object_duplilist_real(bContext *C,
Depsgraph *depsgraph,
Scene *scene,
Base *base,
const bool use_base_parent,
const bool use_hierarchy)
{
Main *bmain = CTX_data_main(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
ListBase *lb_duplis;
DupliObject *dob;
GHash *dupli_gh, *parent_gh = NULL, *instancer_gh = NULL;
@ -1955,6 +1962,7 @@ static void make_object_duplilist_real(
static int object_duplicates_make_real_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
const bool use_base_parent = RNA_boolean_get(op->ptr, "use_base_parent");
@ -1963,7 +1971,7 @@ static int object_duplicates_make_real_exec(bContext *C, wmOperator *op)
BKE_main_id_clear_newpoins(bmain);
CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) {
make_object_duplilist_real(C, scene, base, use_base_parent, use_hierarchy);
make_object_duplilist_real(C, depsgraph, scene, base, use_base_parent, use_hierarchy);
/* dependencies were changed */
WM_event_add_notifier(C, NC_OBJECT | ND_PARENT, base->object);
@ -1990,7 +1998,7 @@ void OBJECT_OT_duplicates_make_real(wmOperatorType *ot)
ot->poll = ED_operator_objectmode;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna,
"use_base_parent",
@ -2131,7 +2139,7 @@ static Base *duplibase_for_convert(
static int convert_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_evaluated_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
Base *basen = NULL, *basact = NULL;

View File

@ -864,13 +864,12 @@ void CONSTRAINT_OT_limitdistance_reset(wmOperatorType *ot)
/* ------------- Child-Of Constraint ------------------ */
static void child_get_inverse_matrix_owner_bone(
const bContext *C, wmOperator *op, Scene *scene, Object *ob, float invmat[4][4])
Depsgraph *depsgraph, wmOperator *op, Scene *scene, Object *ob, float invmat[4][4])
{
/* For bone owner we want to do this in evaluated domain.
* BKE_pose_where_is / BKE_pose_where_is_bone relies on (re)evaluating parts of the scene
* and copying new evaluated stuff back to original.
*/
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
bConstraint *con_eval = edit_constraint_property_get(op, ob_eval, CONSTRAINT_TYPE_CHILDOF);
@ -947,9 +946,8 @@ static void child_get_inverse_matrix_owner_bone(
}
static void child_get_inverse_matrix_owner_object(
const bContext *C, Scene *scene, Object *ob, bConstraint *con, float invmat[4][4])
Depsgraph *depsgraph, Scene *scene, Object *ob, bConstraint *con, float invmat[4][4])
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
/* nullify inverse matrix first */
unit_m4(invmat);
@ -971,6 +969,7 @@ static void child_get_inverse_matrix_owner_object(
static int childof_set_inverse_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Object *ob = ED_object_active_context(C);
bConstraint *con = edit_constraint_property_get(op, ob, CONSTRAINT_TYPE_CHILDOF);
@ -985,10 +984,10 @@ static int childof_set_inverse_exec(bContext *C, wmOperator *op)
}
if (owner == EDIT_CONSTRAINT_OWNER_OBJECT) {
child_get_inverse_matrix_owner_object(C, scene, ob, con, data->invmat);
child_get_inverse_matrix_owner_object(depsgraph, scene, ob, con, data->invmat);
}
else if (owner == EDIT_CONSTRAINT_OWNER_BONE) {
child_get_inverse_matrix_owner_bone(C, op, scene, ob, data->invmat);
child_get_inverse_matrix_owner_bone(depsgraph, op, scene, ob, data->invmat);
}
ED_object_constraint_update(bmain, ob);
@ -1224,6 +1223,7 @@ void CONSTRAINT_OT_followpath_path_animate(wmOperatorType *ot)
static int objectsolver_set_inverse_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Object *ob = ED_object_active_context(C);
bConstraint *con = edit_constraint_property_get(op, ob, CONSTRAINT_TYPE_OBJECTSOLVER);
@ -1238,10 +1238,10 @@ static int objectsolver_set_inverse_exec(bContext *C, wmOperator *op)
}
if (owner == EDIT_CONSTRAINT_OWNER_OBJECT) {
child_get_inverse_matrix_owner_object(C, scene, ob, con, data->invmat);
child_get_inverse_matrix_owner_object(depsgraph, scene, ob, con, data->invmat);
}
else if (owner == EDIT_CONSTRAINT_OWNER_BONE) {
child_get_inverse_matrix_owner_bone(C, op, scene, ob, data->invmat);
child_get_inverse_matrix_owner_bone(depsgraph, op, scene, ob, data->invmat);
}
ED_object_constraint_update(bmain, ob);

View File

@ -111,8 +111,6 @@ static const EnumPropertyItem *dt_layers_select_src_itemf(bContext *C,
int totitem = 0;
const int data_type = RNA_enum_get(ptr, "data_type");
Depsgraph *depsgraph = CTX_data_depsgraph(C);
PropertyRNA *prop = RNA_struct_find_property(ptr, "use_reverse_transfer");
const bool reverse_transfer = prop != NULL && RNA_property_boolean_get(ptr, prop);
const int layers_select_dst = reverse_transfer ? RNA_enum_get(ptr, "layers_select_src") :
@ -158,6 +156,7 @@ static const EnumPropertyItem *dt_layers_select_src_itemf(bContext *C,
Mesh *me_eval;
int num_data, i;
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Object *ob_src_eval = DEG_get_evaluated_object(depsgraph, ob_src);
@ -183,6 +182,7 @@ static const EnumPropertyItem *dt_layers_select_src_itemf(bContext *C,
Mesh *me_eval;
int num_data, i;
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Object *ob_src_eval = DEG_get_evaluated_object(depsgraph, ob_src);
@ -397,7 +397,7 @@ static bool data_transfer_exec_is_object_valid(wmOperator *op,
static int data_transfer_exec(bContext *C, wmOperator *op)
{
Object *ob_src = ED_object_active_context(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
ListBase ctx_objects;
@ -613,7 +613,7 @@ void OBJECT_OT_data_transfer(wmOperatorType *ot)
ot->check = data_transfer_check;
/* Flags.*/
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* Properties.*/
prop = RNA_def_boolean(ot->srna,
@ -767,7 +767,7 @@ static bool datalayout_transfer_poll(bContext *C)
static int datalayout_transfer_exec(bContext *C, wmOperator *op)
{
Object *ob_act = ED_object_active_context(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
DataTransferModifierData *dtmd;
@ -873,7 +873,7 @@ void OBJECT_OT_datalayout_transfer(wmOperatorType *ot)
ot->check = data_transfer_check;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* Properties.*/
edit_modifier_properties(ot);

View File

@ -906,7 +906,9 @@ void ED_objects_recalculate_paths(bContext *C, Scene *scene, bool current_frame_
}
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
/* NOTE: Dependency graph will be evaluated at all the frames, but we first need to access some
* nested pointers, like animation data. */
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ListBase targets = {NULL, NULL};
/* loop over objects in scene */

View File

@ -596,7 +596,7 @@ void OBJECT_OT_gpencil_modifier_move_down(wmOperatorType *ot)
static int gpencil_modifier_apply_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *ob = ED_object_active_context(C);
GpencilModifierData *md = gpencil_edit_modifier_property_get(op, ob, 0);
int apply_as = RNA_enum_get(op->ptr, "apply_as");

View File

@ -528,7 +528,7 @@ static int add_hook_object(const bContext *C,
int mode,
ReportList *reports)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ModifierData *md = NULL;
HookModifierData *hmd = NULL;
float cent[3];
@ -603,13 +603,14 @@ static int add_hook_object(const bContext *C,
/* matrix calculus */
/* vert x (obmat x hook->imat) x hook->obmat x ob->imat */
/* (parentinv ) */
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
BKE_object_transform_copy(ob_eval, ob);
BKE_object_where_is_calc(depsgraph, scene, ob_eval);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Object *object_eval = DEG_get_evaluated_object(depsgraph, ob);
BKE_object_transform_copy(object_eval, ob);
BKE_object_where_is_calc(depsgraph, scene_eval, object_eval);
invert_m4_m4(ob_eval->imat, ob_eval->obmat);
invert_m4_m4(object_eval->imat, object_eval->obmat);
/* apparently this call goes from right to left... */
mul_m4_series(hmd->parentinv, pose_mat, ob_eval->imat, obedit->obmat);
mul_m4_series(hmd->parentinv, pose_mat, object_eval->imat, obedit->obmat);
DEG_relations_tag_update(bmain);

View File

@ -171,14 +171,6 @@ void ED_object_mode_toggle(bContext *C, eObjectMode mode)
if (opstring) {
wmOperatorType *ot = WM_operatortype_find(opstring, false);
if (ot->flag & OPTYPE_USE_EVAL_DATA) {
/* We need to force refresh of depsgraph after undo step,
* redoing the operator *may* rely on some valid evaluated data. */
struct Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
BKE_scene_view_layer_graph_evaluated_ensure(bmain, scene, view_layer);
}
WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_REGION_WIN, NULL);
}
}

View File

@ -1130,7 +1130,7 @@ void OBJECT_OT_modifier_move_down(wmOperatorType *ot)
static int modifier_apply_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Object *ob = ED_object_active_context(C);
ModifierData *md = edit_modifier_property_get(op, ob, 0);
@ -1194,7 +1194,7 @@ void OBJECT_OT_modifier_apply(wmOperatorType *ot)
static int modifier_convert_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob = ED_object_active_context(C);
@ -1391,7 +1391,7 @@ void OBJECT_OT_multires_subdivide(wmOperatorType *ot)
static int multires_reshape_exec(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *ob = ED_object_active_context(C), *secondob = NULL;
MultiresModifierData *mmd = (MultiresModifierData *)edit_modifier_property_get(
op, ob, eModifierType_Multires);
@ -1934,7 +1934,7 @@ static Object *modifier_skin_armature_create(Depsgraph *depsgraph,
static int skin_armature_create_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C), *arm_ob;
Mesh *me = ob->data;
@ -1999,7 +1999,7 @@ static bool correctivesmooth_poll(bContext *C)
static int correctivesmooth_bind_exec(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Object *ob = ED_object_active_context(C);
CorrectiveSmoothModifierData *csmd = (CorrectiveSmoothModifierData *)edit_modifier_property_get(
@ -2077,7 +2077,7 @@ static bool meshdeform_poll(bContext *C)
static int meshdeform_bind_exec(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *ob = ED_object_active_context(C);
MeshDeformModifierData *mmd = (MeshDeformModifierData *)edit_modifier_property_get(
op, ob, eModifierType_MeshDeform);
@ -2403,7 +2403,7 @@ static bool laplaciandeform_poll(bContext *C)
static int laplaciandeform_bind_exec(bContext *C, wmOperator *op)
{
Object *ob = ED_object_active_context(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
LaplacianDeformModifierData *lmd = (LaplacianDeformModifierData *)edit_modifier_property_get(
op, ob, eModifierType_LaplacianDeform);
@ -2478,7 +2478,7 @@ static bool surfacedeform_bind_poll(bContext *C)
static int surfacedeform_bind_exec(bContext *C, wmOperator *op)
{
Object *ob = ED_object_active_context(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)edit_modifier_property_get(
op, ob, eModifierType_SurfaceDeform);

View File

@ -124,7 +124,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *obedit = CTX_data_edit_object(C);
BMVert *eve;
@ -677,7 +677,7 @@ bool ED_object_parent_set(ReportList *reports,
const int vert_par[3])
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
bPoseChannel *pchan = NULL;
bPoseChannel *pchan_eval = NULL;
const bool pararm = ELEM(

View File

@ -547,7 +547,7 @@ static int apply_objects_internal(bContext *C,
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_evaluated_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
float rsmat[3][3], obmat[3][3], iobmat[3][3], mat[4][4], scale;
bool changed = true;
@ -881,7 +881,7 @@ static int apply_objects_internal(bContext *C,
static int visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_evaluated_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
bool changed = false;
CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) {
@ -976,7 +976,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
Object *obact = CTX_data_active_object(C);
Object *obedit = CTX_data_edit_object(C);
Depsgraph *depsgraph = CTX_data_evaluated_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *tob;
float cent[3], cent_neg[3], centn[3];
const float *cursor = scene->cursor.location;

View File

@ -1514,7 +1514,7 @@ static void moveCloserToDistanceFromPlane(Depsgraph *depsgraph,
static void vgroup_fix(
const bContext *C, Scene *UNUSED(scene), Object *ob, float distToBe, float strength, float cp)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Object *object_eval = DEG_get_evaluated_object(depsgraph, ob);
int i;

View File

@ -473,7 +473,7 @@ static void dpaint_bake_startjob(void *customdata, short *stop, short *do_update
*/
static int dynamicpaint_bake_exec(struct bContext *C, struct wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *ob_ = ED_object_context(C);
Object *object_eval = DEG_get_evaluated_object(depsgraph, ob_);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
@ -505,7 +505,7 @@ static int dynamicpaint_bake_exec(struct bContext *C, struct wmOperator *op)
DynamicPaintBakeJob *job = MEM_mallocN(sizeof(DynamicPaintBakeJob), "DynamicPaintBakeJob");
job->bmain = CTX_data_main(C);
job->scene = scene_eval;
job->depsgraph = CTX_data_depsgraph(C);
job->depsgraph = depsgraph;
job->ob = object_eval;
job->canvas = canvas;
job->surface = surface;

View File

@ -465,7 +465,7 @@ static void PE_set_data(bContext *C, PEData *data)
data->scene = CTX_data_scene(C);
data->view_layer = CTX_data_view_layer(C);
data->ob = CTX_data_active_object(C);
data->depsgraph = CTX_data_depsgraph(C);
data->depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
data->edit = PE_get_current(data->scene, data->ob);
}
@ -1778,7 +1778,7 @@ static bool select_action_apply(PTCacheEditPoint *point, PTCacheEditKey *key, in
static int pe_select_all_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *ob = CTX_data_active_object(C);
PTCacheEdit *edit = PE_get_current(scene, ob);
POINT_P;
@ -2348,7 +2348,7 @@ static int hide_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
PTCacheEdit *edit = PE_get_current(scene, ob);
POINT_P;
@ -2409,7 +2409,7 @@ static int reveal_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
PTCacheEdit *edit = PE_get_current(scene, ob);
const bool select = RNA_boolean_get(op->ptr, "select");
POINT_P;
@ -2709,7 +2709,7 @@ static void rekey_particle_to_time(
psys = edit->psys;
sim.depsgraph = CTX_data_depsgraph(C);
sim.depsgraph = CTX_data_depsgraph_pointer(C);
sim.scene = scene;
sim.ob = ob;
sim.psys = psys;
@ -4211,7 +4211,7 @@ static void brush_add_count_iter_finalize(void *__restrict userdata_v,
static int brush_add(const bContext *C, PEData *data, short number)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
Scene *scene = data->scene;
Object *ob = data->ob;
Mesh *mesh;
@ -4542,7 +4542,7 @@ static int brush_edit_init(bContext *C, wmOperator *op)
static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
{
BrushEdit *bedit = op->customdata;
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
Scene *scene = bedit->scene;
Object *ob = bedit->ob;
PTCacheEdit *edit = bedit->edit;
@ -5294,7 +5294,7 @@ static void free_all_psys_edit(Object *object)
static int particle_edit_toggle_exec(bContext *C, wmOperator *op)
{
struct wmMsgBus *mbus = CTX_wm_message_bus(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
const int mode_flag = OB_MODE_PARTICLE_EDIT;
@ -5495,7 +5495,7 @@ static int unify_length_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob = CTX_data_active_object(C);
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
PTCacheEdit *edit = PE_get_current(scene, ob);
float average_length = calculate_average_length(edit);

View File

@ -652,7 +652,7 @@ static void disconnect_hair(Depsgraph *depsgraph, Scene *scene, Object *ob, Part
static int disconnect_hair_exec(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Object *ob = ED_object_context(C);
ParticleSystem *psys = NULL;
@ -934,7 +934,7 @@ static bool connect_hair(Depsgraph *depsgraph, Scene *scene, Object *ob, Particl
static int connect_hair_exec(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Object *ob = ED_object_context(C);
ParticleSystem *psys = NULL;
@ -1086,7 +1086,7 @@ static bool copy_particle_systems_to_object(const bContext *C,
bool duplicate_settings)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ModifierData *md;
ParticleSystem *psys_start = NULL, *psys, *psys_from;
ParticleSystem **tmp_psys;

View File

@ -334,6 +334,7 @@ static void free_all_fluidobject_channels(ListBase *fobjects)
}
static void fluid_init_all_channels(bContext *C,
Depsgraph *depsgraph,
Object *UNUSED(fsDomain),
FluidsimSettings *domainSettings,
FluidAnimChannels *channels,
@ -341,7 +342,6 @@ static void fluid_init_all_channels(bContext *C,
{
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Base *base;
int i;
int length = channels->length;
@ -514,9 +514,11 @@ static void fluid_init_all_channels(bContext *C,
}
}
static void export_fluid_objects(const bContext *C, ListBase *fobjects, Scene *scene, int length)
static void export_fluid_objects(Depsgraph *depsgraph,
ListBase *fobjects,
Scene *scene,
int length)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
FluidObject *fobj;
for (fobj = fobjects->first; fobj; fobj = fobj->next) {
@ -922,7 +924,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
int i;
FluidsimSettings *domainSettings;
@ -1051,11 +1053,11 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
(double)noFrames;
/* ******** initialize and allocate animation channels ******** */
fluid_init_all_channels(C, fsDomain, domainSettings, channels, fobjects);
fluid_init_all_channels(C, depsgraph, fsDomain, domainSettings, channels, fobjects);
/* reset to original current frame */
scene->r.cfra = origFrame;
ED_update_for_newframe(CTX_data_main(C), depsgraph);
ED_update_for_newframe(CTX_data_main(C), CTX_data_depsgraph_pointer(C));
/* ******** init domain object's matrix ******** */
copy_m4_m4(domainMat, fsDomain->obmat);
@ -1153,7 +1155,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
elbeemAddDomain(fsset);
/* ******** export all fluid objects to elbeem ******** */
export_fluid_objects(C, fobjects, scene, channels->length);
export_fluid_objects(depsgraph, fobjects, scene, channels->length);
/* custom data for fluid bake job */
fb->settings = fsset;

View File

@ -156,7 +156,8 @@ static PTCacheBaker *ptcache_baker_create(bContext *C, wmOperator *op, bool all)
baker->bmain = CTX_data_main(C);
baker->scene = CTX_data_scene(C);
baker->view_layer = CTX_data_view_layer(C);
baker->depsgraph = CTX_data_depsgraph(C);
/* Depsgraph is used to sweep the frame range and evaluate scene at different times. */
baker->depsgraph = CTX_data_depsgraph_pointer(C);
baker->bake = RNA_boolean_get(op->ptr, "bake");
baker->render = 0;
baker->anim_init = 0;

View File

@ -464,7 +464,7 @@ static const EnumPropertyItem *rigidbody_materials_itemf(bContext *UNUSED(C),
static int rigidbody_objects_calc_mass_exec(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
int material = RNA_enum_get(op->ptr, "material");
float density;
bool changed = false;
@ -537,7 +537,7 @@ void RIGIDBODY_OT_mass_calculate(wmOperatorType *ot)
ot->poll = ED_operator_scene_editable;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
ot->prop = prop = RNA_def_enum(

View File

@ -368,7 +368,7 @@ static int screen_render_exec(bContext *C, wmOperator *op)
RE_SetReports(re, NULL);
// no redraw needed, we leave state as we entered it
ED_update_for_newframe(mainp, CTX_data_depsgraph(C));
ED_update_for_newframe(mainp, CTX_data_depsgraph_pointer(C));
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_RESULT, scene);
@ -978,8 +978,11 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even
rj->scene = scene;
rj->current_scene = rj->scene;
rj->single_layer = single_layer;
/* TODO(sergey): Render engine should be using own depsgraph. */
rj->depsgraph = CTX_data_depsgraph(C);
/* TODO(sergey): Render engine should be using own depsgraph.
*
* NOTE: Currently is only used by ED_update_for_newframe() at the end of the render, so no
* need to ensure evaluation here. */
rj->depsgraph = CTX_data_depsgraph_pointer(C);
rj->camera_override = camera_override;
rj->anim = is_animation;
rj->write_still = is_write_still && !is_animation;

View File

@ -273,7 +273,7 @@ static void screen_opengl_views_setup(OGLRender *oglrender)
static void screen_opengl_render_doit(const bContext *C, OGLRender *oglrender, RenderResult *rr)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = oglrender->scene;
ARegion *ar = oglrender->ar;
View3D *v3d = oglrender->v3d;
@ -592,7 +592,9 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op)
oglrender->scene = scene;
oglrender->workspace = workspace;
oglrender->view_layer = CTX_data_view_layer(C);
oglrender->depsgraph = CTX_data_depsgraph(C);
/* NOTE: The depsgraph is not only used to update scene for a new frames, but also to initialize
* output video handles, which does need evaluated scene. */
oglrender->depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
oglrender->cfrao = scene->r.cfra;
oglrender->ofs_samples = samples;

View File

@ -859,7 +859,7 @@ static int light_cache_bake_exec(bContext *C, wmOperator *op)
EEVEE_lightbake_job_data_free(rj);
// no redraw needed, we leave state as we entered it
ED_update_for_newframe(bmain, CTX_data_depsgraph(C));
ED_update_for_newframe(bmain, CTX_data_depsgraph_pointer(C));
WM_event_add_notifier(C, NC_SCENE | NA_EDITED, scene);

View File

@ -135,7 +135,7 @@ void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int update
/* NOTE: Important to pass non-updated depsgraph, This is because this function is called
* from inside dependency graph evaluation. Additionally, if we pass fully evaluated one
* we will loose updates stored in the graph. */
engine->type->view_update(engine, C, CTX_data_depsgraph(C));
engine->type->view_update(engine, C, CTX_data_depsgraph_pointer(C));
}
else {
RenderEngineType *engine_type = ED_view3d_engine_type(scene, v3d->shading.type);

View File

@ -4465,7 +4465,7 @@ int ED_screen_animation_play(bContext *C, int sync, int mode)
{
bScreen *screen = CTX_wm_screen(C);
Scene *scene = CTX_data_scene(C);
Scene *scene_eval = DEG_get_evaluated_scene(CTX_data_depsgraph(C));
Scene *scene_eval = DEG_get_evaluated_scene(CTX_data_ensure_evaluated_depsgraph(C));
if (ED_screen_animation_playing(CTX_wm_manager(C))) {
/* stop playback now */

View File

@ -339,7 +339,7 @@ static int hide_show_exec(bContext *C, wmOperator *op)
{
ARegion *ar = CTX_wm_region(C);
Object *ob = CTX_data_active_object(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Mesh *me = ob->data;
PartialVisAction action;
PartialVisArea area;

View File

@ -1238,7 +1238,7 @@ void PAINT_OT_texture_paint_toggle(wmOperatorType *ot)
ot->poll = texture_paint_toggle_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int brush_colors_flip_exec(bContext *C, wmOperator *UNUSED(op))

View File

@ -4012,7 +4012,7 @@ static void project_paint_bleed_add_face_user(const ProjPaintState *ps,
/* Return true if evaluated mesh can be painted on, false otherwise */
static bool proj_paint_state_mesh_eval_init(const bContext *C, ProjPaintState *ps)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *ob = ps->ob;
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
@ -5710,7 +5710,7 @@ void paint_proj_stroke(const bContext *C,
/* clone gets special treatment here to avoid going through image initialization */
if (ps_handle->is_clone_cursor_pick) {
Scene *scene = ps_handle->scene;
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
View3D *v3d = CTX_wm_view3d(C);
ARegion *ar = CTX_wm_region(C);
float *cursor = scene->cursor.location;
@ -5779,7 +5779,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int
ps->rv3d = CTX_wm_region_view3d(C);
ps->ar = CTX_wm_region(C);
ps->depsgraph = CTX_data_depsgraph(C);
ps->depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ps->scene = scene;
/* allow override of active object */
ps->ob = ob;
@ -6143,7 +6143,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
char filename[FILE_MAX];
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
ToolSettings *settings = scene->toolsettings;
int w = settings->imapaint.screen_grab_size[0];
@ -6234,8 +6234,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
array += sizeof(rv3d->winmat) / sizeof(float);
memcpy(array, rv3d->viewmat, sizeof(rv3d->viewmat));
array += sizeof(rv3d->viewmat) / sizeof(float);
is_ortho = ED_view3d_clip_range_get(
CTX_data_depsgraph(C), v3d, rv3d, &array[0], &array[1], true);
is_ortho = ED_view3d_clip_range_get(depsgraph, v3d, rv3d, &array[0], &array[1], true);
/* using float for a bool is dodgy but since its an extra member in the array...
* easier then adding a single bool prop */
array[2] = is_ortho ? 1.0f : 0.0f;

View File

@ -130,7 +130,7 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op)
{
ARegion *ar = CTX_wm_region(C);
Object *ob = CTX_data_active_object(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
PaintMaskFloodMode mode;
float value;
PBVH *pbvh;
@ -277,7 +277,7 @@ static void mask_box_select_task_cb(void *__restrict userdata,
bool ED_sculpt_mask_box_select(struct bContext *C, ViewContext *vc, const rcti *rect, bool select)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Sculpt *sd = vc->scene->toolsettings->sculpt;
BoundBox bb;
float clip_planes[4][4];
@ -444,7 +444,7 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op)
const int(*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
if (mcords) {
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
float clip_planes[4][4], clip_planes_final[4][4];
BoundBox bb;
Object *ob;

View File

@ -463,7 +463,7 @@ void paint_sample_color(
bContext *C, ARegion *ar, int x, int y, bool texpaint_proj, bool use_palette)
{
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Paint *paint = BKE_paint_get_active_from_context(C);
Palette *palette = BKE_paint_palette(paint);
PaletteColor *color = NULL;

View File

@ -1377,7 +1377,7 @@ void PAINT_OT_weight_paint_toggle(wmOperatorType *ot)
ot->poll = paint_poll_test;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/** \} */
@ -1537,7 +1537,7 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float mo
bool *defbase_sel;
SculptSession *ss = ob->sculpt;
VPaint *vp = CTX_data_tool_settings(C)->wpaint;
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
if (ED_wpaint_ensure_data(C, op->reports, WPAINT_ENSURE_MIRROR, &vgroup_index) == false) {
return false;
@ -2550,7 +2550,7 @@ void PAINT_OT_vertex_paint_toggle(wmOperatorType *ot)
ot->poll = paint_poll_test;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/** \} */
@ -2619,7 +2619,7 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f
Object *ob = CTX_data_active_object(C);
Mesh *me;
SculptSession *ss = ob->sculpt;
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
/* context checks could be a poll() */
me = BKE_mesh_from_object(ob);

View File

@ -119,7 +119,7 @@ static bool weight_from_bones_poll(bContext *C)
static int weight_from_bones_exec(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
Object *armob = modifiers_isDeformedByArmature(ob);
@ -161,7 +161,7 @@ void PAINT_OT_weight_from_bones(wmOperatorType *ot)
ot->poll = weight_from_bones_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
ot->prop = RNA_def_enum(
@ -746,7 +746,7 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
float sco_end[2] = {x_end, y_end};
const bool is_interactive = (gesture != NULL);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
WPGradient_userData data = {NULL};
@ -880,7 +880,7 @@ void PAINT_OT_weight_gradient(wmOperatorType *ot)
ot->cancel = WM_gesture_straightline_cancel;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
prop = RNA_def_enum(ot->srna, "type", gradient_types, 0, "Type", "");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);

View File

@ -4922,7 +4922,7 @@ static void sculpt_stroke_modifiers_check(const bContext *C, Object *ob, const B
SculptSession *ss = ob->sculpt;
if (ss->kb || ss->modifiers_active) {
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
bool need_pmap = sculpt_any_smooth_mode(brush, ss->cache, 0);
BKE_sculpt_update_object_for_edit(depsgraph, ob, need_pmap, false);
}
@ -5135,7 +5135,7 @@ static void sculpt_brush_init_tex(const Scene *scene, Sculpt *sd, SculptSession
static void sculpt_brush_stroke_init(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
@ -5183,7 +5183,7 @@ void sculpt_update_object_bounding_box(Object *ob)
static void sculpt_flush_update_step(bContext *C)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
Object *ob = CTX_data_active_object(C);
SculptSession *ss = ob->sculpt;
ARegion *ar = CTX_wm_region(C);
@ -5752,7 +5752,7 @@ static void sculpt_dynamic_topology_disable_ex(
void sculpt_dynamic_topology_disable(bContext *C, SculptUndoNode *unode)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
sculpt_dynamic_topology_disable_ex(bmain, depsgraph, scene, ob, unode);
@ -5789,7 +5789,7 @@ static void sculpt_dynamic_topology_enable_with_undo(Main *bmain,
static int sculpt_dynamic_topology_toggle_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
SculptSession *ss = ob->sculpt;
@ -6244,7 +6244,7 @@ static void SCULPT_OT_sculptmode_toggle(wmOperatorType *ot)
ot->exec = sculpt_mode_toggle_exec;
ot->poll = ED_operator_object_active_editable_mesh;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static bool sculpt_and_constant_or_manual_detail_poll(bContext *C)

View File

@ -127,11 +127,10 @@ static bool sculpt_undo_restore_deformed(
}
}
static bool sculpt_undo_restore_coords(bContext *C, SculptUndoNode *unode)
static bool sculpt_undo_restore_coords(bContext *C, Depsgraph *depsgraph, SculptUndoNode *unode)
{
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob = OBACT(view_layer);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
SculptSession *ss = ob->sculpt;
SubdivCCG *subdiv_ccg = ss->subdiv_ccg;
MVert *mvert;
@ -455,13 +454,12 @@ static int sculpt_undo_bmesh_restore(bContext *C,
return false;
}
static void sculpt_undo_restore_list(bContext *C, ListBase *lb)
static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase *lb)
{
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
View3D *v3d = CTX_wm_view3d(C);
Object *ob = OBACT(view_layer);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
SculptSession *ss = ob->sculpt;
SubdivCCG *subdiv_ccg = ss->subdiv_ccg;
SculptUndoNode *unode;
@ -512,7 +510,7 @@ static void sculpt_undo_restore_list(bContext *C, ListBase *lb)
switch (unode->type) {
case SCULPT_UNDO_COORDS:
if (sculpt_undo_restore_coords(C, unode)) {
if (sculpt_undo_restore_coords(C, depsgraph, unode)) {
update = true;
}
break;
@ -1062,21 +1060,27 @@ static bool sculpt_undosys_step_encode(struct bContext *UNUSED(C),
return true;
}
static void sculpt_undosys_step_decode_undo_impl(struct bContext *C, SculptUndoStep *us)
static void sculpt_undosys_step_decode_undo_impl(struct bContext *C,
Depsgraph *depsgraph,
SculptUndoStep *us)
{
BLI_assert(us->step.is_applied == true);
sculpt_undo_restore_list(C, &us->data.nodes);
sculpt_undo_restore_list(C, depsgraph, &us->data.nodes);
us->step.is_applied = false;
}
static void sculpt_undosys_step_decode_redo_impl(struct bContext *C, SculptUndoStep *us)
static void sculpt_undosys_step_decode_redo_impl(struct bContext *C,
Depsgraph *depsgraph,
SculptUndoStep *us)
{
BLI_assert(us->step.is_applied == false);
sculpt_undo_restore_list(C, &us->data.nodes);
sculpt_undo_restore_list(C, depsgraph, &us->data.nodes);
us->step.is_applied = true;
}
static void sculpt_undosys_step_decode_undo(struct bContext *C, SculptUndoStep *us)
static void sculpt_undosys_step_decode_undo(struct bContext *C,
Depsgraph *depsgraph,
SculptUndoStep *us)
{
SculptUndoStep *us_iter = us;
while (us_iter->step.next && (us_iter->step.next->type == us_iter->step.type)) {
@ -1086,12 +1090,14 @@ static void sculpt_undosys_step_decode_undo(struct bContext *C, SculptUndoStep *
us_iter = (SculptUndoStep *)us_iter->step.next;
}
while (us_iter != us) {
sculpt_undosys_step_decode_undo_impl(C, us_iter);
sculpt_undosys_step_decode_undo_impl(C, depsgraph, us_iter);
us_iter = (SculptUndoStep *)us_iter->step.prev;
}
}
static void sculpt_undosys_step_decode_redo(struct bContext *C, SculptUndoStep *us)
static void sculpt_undosys_step_decode_redo(struct bContext *C,
Depsgraph *depsgraph,
SculptUndoStep *us)
{
SculptUndoStep *us_iter = us;
while (us_iter->step.prev && (us_iter->step.prev->type == us_iter->step.type)) {
@ -1101,7 +1107,7 @@ static void sculpt_undosys_step_decode_redo(struct bContext *C, SculptUndoStep *
us_iter = (SculptUndoStep *)us_iter->step.prev;
}
while (us_iter && (us_iter->step.is_applied == false)) {
sculpt_undosys_step_decode_redo_impl(C, us_iter);
sculpt_undosys_step_decode_redo_impl(C, depsgraph, us_iter);
if (us_iter == us) {
break;
}
@ -1112,6 +1118,8 @@ static void sculpt_undosys_step_decode_redo(struct bContext *C, SculptUndoStep *
static void sculpt_undosys_step_decode(
struct bContext *C, struct Main *bmain, UndoStep *us_p, int dir, bool UNUSED(is_final))
{
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
/* Ensure sculpt mode. */
{
Scene *scene = CTX_data_scene(C);
@ -1120,7 +1128,6 @@ static void sculpt_undosys_step_decode(
BKE_scene_view_layer_graph_evaluated_ensure(bmain, scene, view_layer);
Object *ob = OBACT(view_layer);
if (ob && (ob->type == OB_MESH)) {
Depsgraph *depsgraph = CTX_data_depsgraph(C);
if (ob->mode & OB_MODE_SCULPT) {
/* pass */
}
@ -1142,10 +1149,10 @@ static void sculpt_undosys_step_decode(
SculptUndoStep *us = (SculptUndoStep *)us_p;
if (dir < 0) {
sculpt_undosys_step_decode_undo(C, us);
sculpt_undosys_step_decode_undo(C, depsgraph, us);
}
else {
sculpt_undosys_step_decode_redo(C, us);
sculpt_undosys_step_decode_redo(C, depsgraph, us);
}
}

View File

@ -305,7 +305,9 @@ static int sound_bake_animation_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
/* NOTE: We will be forefully evaluating dependency graph at every frame, so no need to ensure
* current scene state is evaluated as it will be lost anyway. */
struct Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
int oldfra = scene->r.cfra;
int cfra;
@ -343,7 +345,7 @@ static int sound_mixdown_exec(bContext *C, wmOperator *op)
#ifdef WITH_AUDASPACE
char path[FILE_MAX];
char filename[FILE_MAX];
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Main *bmain = CTX_data_main(C);
int split;

View File

@ -947,7 +947,7 @@ static void clip_main_region_draw(const bContext *C, ARegion *ar)
ScrArea *sa = CTX_wm_area(C);
int mask_width, mask_height;
ED_mask_get_size(sa, &mask_width, &mask_height);
ED_mask_draw_region(CTX_data_depsgraph(C),
ED_mask_draw_region(CTX_data_expect_evaluated_depsgraph(C),
mask,
ar,
sc->mask_info.draw_flag,

View File

@ -39,6 +39,7 @@
#include "BKE_report.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "WM_api.h"
#include "WM_types.h"
@ -395,7 +396,6 @@ static int set_plane_exec(bContext *C, wmOperator *op)
ListBase *tracksbase;
Object *object;
Object *camera = get_camera_with_movieclip(scene, clip);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
int tot = 0;
float vec[3][3], mat[4][4], obmat[4][4], newmat[4][4], orig[3] = {0.0f, 0.0f, 0.0f};
int plane = RNA_enum_get(op->ptr, "plane");
@ -484,7 +484,13 @@ static int set_plane_exec(bContext *C, wmOperator *op)
BKE_object_apply_mat4(object, mat, 0, 0);
}
BKE_object_where_is_calc(depsgraph, scene, object);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Object *object_eval = DEG_get_evaluated_object(depsgraph, object);
BKE_object_transform_copy(object_eval, object);
BKE_object_where_is_calc(depsgraph, scene_eval, object_eval);
BKE_object_transform_copy(object, object_eval);
set_axis(scene, object, clip, tracking_object, axis_track, 'X');
DEG_id_tag_update(&clip->id, 0);

View File

@ -576,7 +576,7 @@ static void image_main_region_draw(const bContext *C, ARegion *ar)
SpaceImage *sima = CTX_wm_space_image(C);
Object *obact = CTX_data_active_object(C);
Object *obedit = CTX_data_edit_object(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C);
Mask *mask = NULL;
bool show_uvedit = false;
bool show_curve = false;

View File

@ -113,7 +113,7 @@ static void do_outliner_activate_obdata(
bContext *C, Scene *scene, ViewLayer *view_layer, Base *base, const bool extend)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *obact = OBACT(view_layer);
Object *ob = base->object;
bool use_all = false;
@ -161,7 +161,7 @@ static void do_outliner_activate_pose(
bContext *C, Scene *scene, ViewLayer *view_layer, Base *base, const bool extend)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *obact = OBACT(view_layer);
Object *ob = base->object;
bool use_all = false;
@ -341,7 +341,7 @@ static eOLDrawState tree_element_set_active_object(bContext *C,
if (base && !BKE_object_is_mode_compat(base->object, object_mode)) {
if (object_mode == OB_MODE_OBJECT) {
struct Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ED_object_mode_generic_exit(bmain, depsgraph, scene, base->object);
}
if (!BKE_object_is_mode_compat(base->object, object_mode)) {

View File

@ -76,7 +76,7 @@ static void metadata_panel_context_draw(const bContext *C, Panel *panel)
return;
}
struct Main *bmain = CTX_data_main(C);
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
struct Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C);
struct Scene *scene = CTX_data_scene(C);
SpaceSeq *space_sequencer = CTX_wm_space_seq(C);
/* NOTE: We can only reliably show metadata for the original (current)

View File

@ -1546,7 +1546,7 @@ void sequencer_draw_preview(const bContext *C,
bool draw_backdrop)
{
struct Main *bmain = CTX_data_main(C);
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
struct Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C);
struct View2D *v2d = &ar->v2d;
struct ImBuf *ibuf = NULL;
struct ImBuf *scope = NULL;

View File

@ -181,7 +181,7 @@ static void seq_proxy_build_job(const bContext *C)
{
wmJob *wm_job;
ProxyJob *pj;
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
struct Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
Scene *scene = CTX_data_scene(C);
Editing *ed = BKE_sequencer_editing_get(scene, false);
ScrArea *sa = CTX_wm_area(C);
@ -3612,7 +3612,7 @@ static int sequencer_rebuild_proxy_invoke(bContext *C,
static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Editing *ed = BKE_sequencer_editing_get(scene, false);
Sequence *seq;

View File

@ -92,7 +92,7 @@ static void sample_draw(const bContext *C, ARegion *ar, void *arg_info)
static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
{
Main *bmain = CTX_data_main(C);
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
SpaceSeq *sseq = (SpaceSeq *)CTX_wm_space_data(C);
ARegion *ar = CTX_wm_region(C);

View File

@ -1082,7 +1082,7 @@ static void draw_rotation_guide(const RegionView3D *rv3d)
static void view3d_draw_border(const bContext *C, ARegion *ar)
{
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C);
RegionView3D *rv3d = ar->regiondata;
View3D *v3d = CTX_wm_view3d(C);
@ -1453,7 +1453,7 @@ void view3d_draw_region_info(const bContext *C, ARegion *ar)
static void view3d_draw_view(const bContext *C, ARegion *ar)
{
ED_view3d_draw_setup_view(CTX_wm_window(C),
CTX_data_depsgraph(C),
CTX_data_expect_evaluated_depsgraph(C),
CTX_data_scene(C),
ar,
CTX_wm_view3d(C),

View File

@ -219,7 +219,7 @@ static void viewops_data_alloc(bContext *C, wmOperator *op)
/* store data */
op->customdata = vod;
vod->bmain = CTX_data_main(C);
vod->depsgraph = CTX_data_depsgraph(C);
vod->depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
vod->scene = CTX_data_scene(C);
vod->sa = CTX_wm_area(C);
vod->ar = CTX_wm_region(C);
@ -249,7 +249,7 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3])
static float lastofs[3] = {0, 0, 0};
bool is_set = false;
const Depsgraph *depsgraph = CTX_data_depsgraph(C);
const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer_eval = DEG_get_evaluated_view_layer(depsgraph);
View3D *v3d = CTX_wm_view3d(C);
@ -373,7 +373,7 @@ static void viewops_data_create(bContext *C,
const wmEvent *event,
enum eViewOpsFlag viewops_flag)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ViewOpsData *vod = op->customdata;
RegionView3D *rv3d = vod->rv3d;
@ -1317,7 +1317,7 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_CANCELLED;
}
const Depsgraph *depsgraph = CTX_data_depsgraph(C);
const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ViewOpsData *vod;
View3D *v3d;
RegionView3D *rv3d;
@ -1397,7 +1397,7 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev
return OPERATOR_CANCELLED;
}
const Depsgraph *depsgraph = CTX_data_depsgraph(C);
const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ViewOpsData *vod;
View3D *v3d;
RegionView3D *rv3d;
@ -1511,7 +1511,7 @@ static int ndof_pan_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *e
return OPERATOR_CANCELLED;
}
const Depsgraph *depsgraph = CTX_data_depsgraph(C);
const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d = CTX_wm_region_view3d(C);
const wmNDOFMotionData *ndof = event->customdata;
@ -2188,7 +2188,7 @@ static int viewzoom_modal(bContext *C, wmOperator *op, const wmEvent *event)
static int viewzoom_exec(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
View3D *v3d;
RegionView3D *rv3d;
@ -2553,7 +2553,7 @@ static int viewdolly_exec(bContext *C, wmOperator *op)
ED_view3d_depth_tag_update(rv3d);
ED_view3d_camera_lock_sync(CTX_data_depsgraph(C), v3d, rv3d);
ED_view3d_camera_lock_sync(CTX_data_ensure_evaluated_depsgraph(C), v3d, rv3d);
ED_region_tag_redraw(ar);
@ -2588,7 +2588,7 @@ static int viewdolly_invoke(bContext *C, wmOperator *op, const wmEvent *event)
if (vod->rv3d->persp != RV3D_PERSP) {
if (vod->rv3d->persp == RV3D_CAMOB) {
/* ignore rv3d->lpersp because dolly only makes sense in perspective mode */
const Depsgraph *depsgraph = CTX_data_depsgraph(C);
const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ED_view3d_persp_switch_from_camera(depsgraph, vod->v3d, vod->rv3d, RV3D_PERSP);
}
else {
@ -2749,8 +2749,9 @@ static void view3d_from_minmax(bContext *C,
}
if (ok_dist) {
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
new_dist = ED_view3d_radius_to_dist(
v3d, ar, CTX_data_depsgraph(C), persp, true, (size / 2) * VIEW3D_MARGIN);
v3d, ar, depsgraph, persp, true, (size / 2) * VIEW3D_MARGIN);
if (rv3d->is_persp) {
/* don't zoom closer than the near clipping plane */
new_dist = max_ff(new_dist, v3d->clip_start * 1.5f);
@ -2817,7 +2818,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op)
View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d = CTX_wm_region_view3d(C);
Scene *scene = CTX_data_scene(C);
const Depsgraph *depsgraph = CTX_data_depsgraph(C);
const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ViewLayer *view_layer_eval = DEG_get_evaluated_view_layer(depsgraph);
Base *base_eval;
const bool use_all_regions = RNA_boolean_get(op->ptr, "use_all_regions");
@ -2922,7 +2923,7 @@ static int viewselected_exec(bContext *C, wmOperator *op)
View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d = CTX_wm_region_view3d(C);
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ViewLayer *view_layer_eval = DEG_get_evaluated_view_layer(depsgraph);
Object *ob_eval = OBACT(view_layer_eval);
Object *obedit = CTX_data_edit_object(C);
@ -3120,7 +3121,8 @@ static int view_lock_to_active_exec(bContext *C, wmOperator *UNUSED(op))
if (obact && obact->type == OB_ARMATURE) {
if (obact->mode & OB_MODE_POSE) {
Object *obact_eval = DEG_get_evaluated_object(CTX_data_depsgraph(C), obact);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *obact_eval = DEG_get_evaluated_object(depsgraph, obact);
bPoseChannel *pcham_act = BKE_pose_channel_active(obact_eval);
if (pcham_act) {
BLI_strncpy(v3d->ob_centre_bone, pcham_act->name, sizeof(v3d->ob_centre_bone));
@ -3216,7 +3218,7 @@ static int viewcenter_pick_invoke(bContext *C, wmOperator *op, const wmEvent *ev
ARegion *ar = CTX_wm_region(C);
if (rv3d) {
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
float new_ofs[3];
const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
@ -3262,7 +3264,7 @@ void VIEW3D_OT_view_center_pick(wmOperatorType *ot)
static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op))
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
float xfac, yfac;
float size[2];
@ -3361,7 +3363,7 @@ static int render_border_exec(bContext *C, wmOperator *op)
/* calculate range */
if (rv3d->persp == RV3D_CAMOB) {
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ED_view3d_calc_camera_border(scene, depsgraph, ar, v3d, rv3d, &vb, false);
}
else {
@ -3530,7 +3532,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
ED_view3d_dist_range_get(v3d, dist_range);
/* Get Z Depths, needed for perspective, nice for ortho */
ED_view3d_draw_depth(CTX_data_depsgraph(C), ar, v3d, true);
ED_view3d_draw_depth(CTX_data_ensure_evaluated_depsgraph(C), ar, v3d, true);
{
/* avoid allocating the whole depth buffer */
@ -3619,7 +3621,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
/* TODO(campbell): 'is_camera_lock' not currently working well. */
const bool is_camera_lock = ED_view3d_camera_lock_check(v3d, rv3d);
if ((rv3d->persp == RV3D_CAMOB) && (is_camera_lock == false)) {
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ED_view3d_persp_switch_from_camera(depsgraph, v3d, rv3d, RV3D_PERSP);
}
@ -3686,7 +3688,7 @@ static void view3d_set_1_to_1_viewborder(Scene *scene,
static int view3d_zoom_1_to_1_camera_exec(bContext *C, wmOperator *UNUSED(op))
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
View3D *v3d;
@ -3794,7 +3796,8 @@ static void axis_set_view(bContext *C,
dist = rv3d->dist;
/* so we animate _from_ the camera location */
Object *camera_eval = DEG_get_evaluated_object(CTX_data_depsgraph(C), v3d->camera);
Object *camera_eval = DEG_get_evaluated_object(CTX_data_ensure_evaluated_depsgraph(C),
v3d->camera);
ED_view3d_from_object(camera_eval, rv3d->ofs, NULL, &rv3d->dist, NULL);
ED_view3d_smooth_view(C,
@ -4124,7 +4127,7 @@ static int vieworbit_exec(bContext *C, wmOperator *op)
float quat_new[4];
if (view_opposite == RV3D_VIEW_USER) {
const Depsgraph *depsgraph = CTX_data_depsgraph(C);
const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ED_view3d_persp_ensure(depsgraph, v3d, ar);
}
@ -4874,7 +4877,7 @@ void ED_view3d_cursor3d_position(bContext *C,
}
if (use_depth) { /* maybe this should be accessed some other way */
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
view3d_operator_needs_opengl(C);
if (ED_view3d_autodist(depsgraph, ar, v3d, mval, cursor_co, true, NULL)) {
@ -4930,7 +4933,7 @@ void ED_view3d_cursor3d_position_rotation(bContext *C,
float ray_co[3];
struct SnapObjectContext *snap_context = ED_transform_snap_object_context_create_view3d(
bmain, scene, CTX_data_depsgraph(C), 0, ar, v3d);
bmain, scene, CTX_data_ensure_evaluated_depsgraph(C), 0, ar, v3d);
float obmat[4][4];
Object *ob_dummy = NULL;

View File

@ -270,7 +270,7 @@ static bool initFlyInfo(bContext *C, FlyInfo *fly, wmOperator *op, const wmEvent
fly->rv3d = CTX_wm_region_view3d(C);
fly->v3d = CTX_wm_view3d(C);
fly->ar = CTX_wm_region(C);
fly->depsgraph = CTX_data_depsgraph(C);
fly->depsgraph = CTX_data_expect_evaluated_depsgraph(C);
fly->scene = CTX_data_scene(C);
#ifdef NDOF_FLY_DEBUG
@ -337,12 +337,8 @@ static bool initFlyInfo(bContext *C, FlyInfo *fly, wmOperator *op, const wmEvent
fly->zlock = FLY_AXISLOCK_STATE_IDLE;
}
fly->v3d_camera_control = ED_view3d_cameracontrol_acquire(CTX_data_depsgraph(C),
fly->scene,
fly->v3d,
fly->rv3d,
(U.uiflag & USER_CAM_LOCK_NO_PARENT) ==
0);
fly->v3d_camera_control = ED_view3d_cameracontrol_acquire(
fly->depsgraph, fly->scene, fly->v3d, fly->rv3d, (U.uiflag & USER_CAM_LOCK_NO_PARENT) == 0);
/* calculate center */
if (ED_view3d_cameracontrol_object_get(fly->v3d_camera_control)) {

View File

@ -437,7 +437,8 @@ static void WIDGETGROUP_camera_view_draw_prepare(const bContext *C, wmGizmoGroup
struct CameraViewWidgetGroup *viewgroup = gzgroup->customdata;
ARegion *ar = CTX_wm_region(C);
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
/* Drawing code should happen with fully evaluated graph. */
struct Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C);
RegionView3D *rv3d = ar->regiondata;
if (rv3d->persp == RV3D_CAMOB) {
Scene *scene = CTX_data_scene(C);

View File

@ -176,7 +176,7 @@ static int gizmo_preselect_elem_test_select(bContext *C, wmGizmo *gz, const int
const float(*coords)[3] = NULL;
{
Object *ob = gz_ele->bases[gz_ele->base_index]->object;
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Mesh *me_eval = (Mesh *)DEG_get_evaluated_id(depsgraph, ob->data);
if (me_eval->runtime.edit_data) {
coords = me_eval->runtime.edit_data->vertexCos;
@ -334,7 +334,7 @@ static int gizmo_preselect_edgering_test_select(bContext *C, wmGizmo *gz, const
const float(*coords)[3] = NULL;
{
Object *ob = gz_ring->bases[gz_ring->base_index]->object;
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Mesh *me_eval = (Mesh *)DEG_get_evaluated_id(depsgraph, ob->data);
if (me_eval->runtime.edit_data) {
coords = me_eval->runtime.edit_data->vertexCos;

View File

@ -289,7 +289,12 @@ static void ruler_state_set(bContext *C, RulerInfo *ruler_info, int state)
else if (state == RULER_STATE_DRAG) {
memset(&ruler_info->drag_state_prev, 0x0, sizeof(ruler_info->drag_state_prev));
ruler_info->snap_context = ED_transform_snap_object_context_create_view3d(
bmain, CTX_data_scene(C), CTX_data_depsgraph(C), 0, ruler_info->ar, CTX_wm_view3d(C));
bmain,
CTX_data_scene(C),
CTX_data_ensure_evaluated_depsgraph(C),
0,
ruler_info->ar,
CTX_wm_view3d(C));
}
else {
BLI_assert(0);

View File

@ -126,7 +126,7 @@ void ED_view3d_viewcontext_init(bContext *C, ViewContext *vc)
vc->C = C;
vc->ar = CTX_wm_region(C);
vc->bmain = CTX_data_main(C);
vc->depsgraph = CTX_data_depsgraph(C);
vc->depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
vc->scene = CTX_data_scene(C);
vc->view_layer = CTX_data_view_layer(C);
vc->v3d = CTX_wm_view3d(C);

View File

@ -66,7 +66,7 @@ static bool snap_calc_active_center(bContext *C, const bool select_only, float r
/** Snaps every individual object center to its nearest point on the grid. */
static int snap_sel_to_grid_exec(bContext *C, wmOperator *UNUSED(op))
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ViewLayer *view_layer_eval = DEG_get_evaluated_view_layer(depsgraph);
Object *obedit = CTX_data_edit_object(C);
Scene *scene = CTX_data_scene(C);
@ -226,7 +226,7 @@ void VIEW3D_OT_snap_selected_to_grid(wmOperatorType *ot)
ot->poll = ED_operator_region_view3d_active;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* *************************************************** */
@ -243,7 +243,6 @@ static int snap_selected_to_location(bContext *C,
const float snap_target_global[3],
const bool use_offset)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Scene *scene = CTX_data_scene(C);
Object *obedit = CTX_data_edit_object(C);
Object *obact = CTX_data_active_object(C);
@ -431,6 +430,7 @@ static int snap_selected_to_location(bContext *C,
float originmat[3][3], parentmat[4][4];
/* Use the evaluated object here because sometimes
* `ob->parent->runtime.curve_cache` is required. */
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
BKE_object_get_parent_matrix(ob_eval, ob_eval->parent, parentmat);
@ -486,7 +486,7 @@ void VIEW3D_OT_snap_selected_to_cursor(wmOperatorType *ot)
ot->poll = ED_operator_view3d_active;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* rna */
RNA_def_boolean(ot->srna,
@ -523,7 +523,7 @@ void VIEW3D_OT_snap_selected_to_active(wmOperatorType *ot)
ot->poll = ED_operator_view3d_active;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* *************************************************** */
@ -626,7 +626,7 @@ static void bundle_midpoint(Scene *scene, Object *ob, float r_vec[3])
/** Snaps the 3D cursor location to the median point of the selection. */
static bool snap_curs_to_sel_ex(bContext *C, float cursor[3])
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ViewLayer *view_layer_eval = DEG_get_evaluated_view_layer(depsgraph);
Object *obedit = CTX_data_edit_object(C);
Scene *scene = CTX_data_scene(C);
@ -757,7 +757,7 @@ void VIEW3D_OT_snap_cursor_to_selected(wmOperatorType *ot)
ot->poll = ED_operator_view3d_active;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* ********************************************** */
@ -804,7 +804,7 @@ void VIEW3D_OT_snap_cursor_to_active(wmOperatorType *ot)
ot->poll = ED_operator_view3d_active;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_USE_EVAL_DATA;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/* **************************************************** */

View File

@ -304,7 +304,7 @@ void ED_view3d_smooth_view(bContext *C,
const int smooth_viewtx,
const struct V3D_SmoothParams *sview)
{
const Depsgraph *depsgraph = CTX_data_depsgraph(C);
const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
wmWindowManager *wm = CTX_wm_manager(C);
wmWindow *win = CTX_wm_window(C);
ScrArea *sa = CTX_wm_area(C);
@ -315,7 +315,6 @@ void ED_view3d_smooth_view(bContext *C,
/* only meant for timer usage */
static void view3d_smoothview_apply(bContext *C, View3D *v3d, ARegion *ar, bool sync_boxview)
{
const Depsgraph *depsgraph = CTX_data_depsgraph(C);
RegionView3D *rv3d = ar->regiondata;
struct SmoothView3DStore *sms = rv3d->sms;
float step, step_inv;
@ -336,6 +335,8 @@ static void view3d_smoothview_apply(bContext *C, View3D *v3d, ARegion *ar, bool
view3d_smooth_view_state_restore(&sms->org, v3d, rv3d);
}
else {
const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
view3d_smooth_view_state_restore(&sms->dst, v3d, rv3d);
ED_view3d_camera_lock_sync(depsgraph, v3d, rv3d);
@ -372,6 +373,7 @@ static void view3d_smoothview_apply(bContext *C, View3D *v3d, ARegion *ar, bool
rv3d->dist = sms->dst.dist * step + sms->src.dist * step_inv;
v3d->lens = sms->dst.lens * step + sms->src.lens * step_inv;
const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
ED_view3d_camera_lock_sync(depsgraph, v3d, rv3d);
if (ED_screen_animation_playing(CTX_wm_manager(C))) {
ED_view3d_camera_lock_autokey(v3d, rv3d, C, true, true);
@ -428,7 +430,7 @@ void ED_view3d_smooth_view_force_finish(bContext *C, View3D *v3d, ARegion *ar)
/* force update of view matrix so tools that run immediately after
* can use them without redrawing first */
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
ED_view3d_update_viewmat(depsgraph, scene, v3d, ar, NULL, NULL, NULL, false);
}
@ -457,7 +459,7 @@ void VIEW3D_OT_smoothview(wmOperatorType *ot)
static int view3d_camera_to_view_exec(bContext *C, wmOperator *UNUSED(op))
{
const Depsgraph *depsgraph = CTX_data_depsgraph(C);
const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
View3D *v3d;
ARegion *ar;
RegionView3D *rv3d;
@ -527,7 +529,7 @@ void VIEW3D_OT_camera_to_view(wmOperatorType *ot)
* meant to take into account vertex/bone selection for eg. */
static int view3d_camera_to_view_selected_exec(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
View3D *v3d = CTX_wm_view3d(C); /* can be NULL */
Object *camera_ob = v3d ? v3d->camera : scene->camera;
@ -1413,7 +1415,7 @@ static void view3d_localview_exit(const Depsgraph *depsgraph,
static int localview_exec(bContext *C, wmOperator *op)
{
const Depsgraph *depsgraph = CTX_data_depsgraph(C);
const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
wmWindowManager *wm = CTX_wm_manager(C);
wmWindow *win = CTX_wm_window(C);

View File

@ -426,7 +426,7 @@ static bool initWalkInfo(bContext *C, WalkInfo *walk, wmOperator *op)
walk->rv3d = CTX_wm_region_view3d(C);
walk->v3d = CTX_wm_view3d(C);
walk->ar = CTX_wm_region(C);
walk->depsgraph = CTX_data_depsgraph(C);
walk->depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
walk->scene = CTX_data_scene(C);
#ifdef NDOF_WALK_DEBUG
@ -520,7 +520,7 @@ static bool initWalkInfo(bContext *C, WalkInfo *walk, wmOperator *op)
walk->rv3d->rflag |= RV3D_NAVIGATING;
walk->snap_context = ED_transform_snap_object_context_create_view3d(
bmain, walk->scene, CTX_data_depsgraph(C), 0, walk->ar, walk->v3d);
bmain, walk->scene, CTX_data_ensure_evaluated_depsgraph(C), 0, walk->ar, walk->v3d);
walk->v3d_camera_control = ED_view3d_cameracontrol_acquire(
walk->depsgraph,

View File

@ -6657,7 +6657,6 @@ void autokeyframe_object(bContext *C, Scene *scene, ViewLayer *view_layer, Objec
/* only key on available channels */
if (adt && adt->action) {
ListBase nla_cache = {NULL, NULL};
for (fcu = adt->action->curves.first; fcu; fcu = fcu->next) {
fcu->flag &= ~FCURVE_SELECTED;
insert_keyframe(bmain,
@ -9016,7 +9015,7 @@ static void createTransGPencil_center_get(bGPDstroke *gps, float r_center[3])
static void createTransGPencil(bContext *C, TransInfo *t)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
bGPdata *gpd = ED_gpencil_data_get_active(C);
ToolSettings *ts = CTX_data_tool_settings(C);

View File

@ -1391,7 +1391,6 @@ void initTransDataContainers_FromObjectData(TransInfo *t,
*/
void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *event)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Scene *sce = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
const eObjectMode object_mode = OBACT(view_layer) ? OBACT(view_layer)->mode : OB_MODE_OBJECT;
@ -1403,7 +1402,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
bGPdata *gpd = CTX_data_gpencil_data(C);
PropertyRNA *prop;
t->depsgraph = depsgraph;
t->depsgraph = CTX_data_depsgraph_pointer(C);
t->scene = sce;
t->view_layer = view_layer;
t->sa = sa;

View File

@ -731,7 +731,9 @@ int ED_transform_calc_gizmo_stats(const bContext *C,
ScrArea *sa = CTX_wm_area(C);
ARegion *ar = CTX_wm_region(C);
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
/* TODO(sergey): This function is used from operator's modal() and from gizmo's refresh().
* Is it fine to possibly evaluate dependency graph here? */
Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
View3D *v3d = sa->spacedata.first;
Object *obedit = CTX_data_edit_object(C);

View File

@ -568,15 +568,6 @@ int ED_undo_operator_repeat(bContext *C, wmOperator *op)
}
}
if (op->type->flag & OPTYPE_USE_EVAL_DATA) {
/* We need to force refresh of depsgraph after undo step,
* redoing the operator *may* rely on some valid evaluated data. */
Main *bmain = CTX_data_main(C);
scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
BKE_scene_view_layer_graph_evaluated_ensure(bmain, scene, view_layer);
}
retval = WM_operator_repeat(C, op);
if ((retval & OPERATOR_FINISHED) == 0) {
if (G.debug & G_DEBUG) {

View File

@ -99,7 +99,7 @@ void ED_editors_init_for_undo(Main *bmain)
void ED_editors_init(bContext *C)
{
struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
struct Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C);
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
wmWindowManager *wm = CTX_wm_manager(C);

View File

@ -2376,7 +2376,7 @@ static void uv_select_all_perform_multi(
static int uv_select_all_exec(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
ToolSettings *ts = scene->toolsettings;
Image *ima = CTX_data_edit_image(C);
@ -2456,7 +2456,7 @@ static int uv_mouse_select_multi(bContext *C,
const bool deselect_all,
const bool loop)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
SpaceImage *sima = CTX_wm_space_image(C);
Scene *scene = CTX_data_scene(C);
ToolSettings *ts = scene->toolsettings;
@ -3429,7 +3429,7 @@ static void uv_select_flush_from_tag_loop(SpaceImage *sima,
static int uv_box_select_exec(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
SpaceImage *sima = CTX_wm_space_image(C);
Scene *scene = CTX_data_scene(C);
ToolSettings *ts = scene->toolsettings;
@ -3587,7 +3587,7 @@ static int uv_inside_circle(const float uv[2], const float offset[2], const floa
static int uv_circle_select_exec(bContext *C, wmOperator *op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
SpaceImage *sima = CTX_wm_space_image(C);
Image *ima = CTX_data_edit_image(C);
Scene *scene = CTX_data_scene(C);
@ -3727,7 +3727,7 @@ static bool do_lasso_select_mesh_uv(bContext *C,
short moves,
const eSelectOp sel_op)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
SpaceImage *sima = CTX_wm_space_image(C);
Image *ima = CTX_data_edit_image(C);
ARegion *ar = CTX_wm_region(C);
@ -4278,7 +4278,7 @@ static void UV_OT_pin(wmOperatorType *ot)
static int uv_select_pinned_exec(bContext *C, wmOperator *UNUSED(op))
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene = CTX_data_scene(C);
ToolSettings *ts = scene->toolsettings;
ViewLayer *view_layer = CTX_data_view_layer(C);

View File

@ -211,7 +211,7 @@ static struct Depsgraph *rna_Context_evaluated_depsgraph_get(bContext *C)
BPy_BEGIN_ALLOW_THREADS;
# endif
depsgraph = CTX_data_evaluated_depsgraph(C);
depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
# ifdef WITH_PYTHON
BPy_END_ALLOW_THREADS;

View File

@ -178,8 +178,8 @@ static void rna_ViewLayer_update_tagged(ID *id_ptr, ViewLayer *view_layer, Main
Scene *scene = (Scene *)id_ptr;
Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true);
/* NOTE: This is similar to CTX_data_depsgraph(). Ideally such access would be de-duplicated
* across all possible cases, but for now this is safest and easiest way to go.
/* NOTE: This is similar to CTX_data_depsgraph_pointer(). Ideally such access would be
* de-duplicated across all possible cases, but for now this is safest and easiest way to go.
*
* The reason for this is that it's possible to have Python operator which asks view layer to
* be updated. After re-do of such operator view layer's dependency graph will not be marked

View File

@ -1114,8 +1114,6 @@ static const EnumPropertyItem *rna_DataTransferModifier_layers_select_src_itemf(
return rna_enum_dt_layers_select_src_items;
}
Depsgraph *depsgraph = CTX_data_depsgraph(C);
/* No active here! */
RNA_enum_items_add_value(
&item, &totitem, rna_enum_dt_layers_select_src_items, DT_LAYERS_ALL_SRC);
@ -1155,6 +1153,7 @@ static const EnumPropertyItem *rna_DataTransferModifier_layers_select_src_itemf(
Mesh *me_eval;
int num_data, i;
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Object *ob_src_eval = DEG_get_evaluated_object(depsgraph, ob_src);
@ -1180,6 +1179,7 @@ static const EnumPropertyItem *rna_DataTransferModifier_layers_select_src_itemf(
Mesh *me_eval;
int num_data, i;
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
Object *ob_src_eval = DEG_get_evaluated_object(depsgraph, ob_src);

View File

@ -465,6 +465,8 @@ static int mesh_looptri_to_poly_index(Mesh *me_eval, const MLoopTri *lt)
return index_mp_to_orig ? index_mp_to_orig[lt->poly] : lt->poly;
}
/* TOOD(sergey): Make the Python API more clear that evaluation might happen, or requite passing
* fully evaluated depsgraph. */
static Object *eval_object_ensure(Object *ob,
bContext *C,
ReportList *reports,
@ -474,7 +476,7 @@ static Object *eval_object_ensure(Object *ob,
Object *ob_orig = ob;
Depsgraph *depsgraph = rnaptr_depsgraph != NULL ? rnaptr_depsgraph->data : NULL;
if (depsgraph == NULL) {
depsgraph = CTX_data_depsgraph(C);
depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
}
if (depsgraph != NULL) {
ob = DEG_get_evaluated_object(depsgraph, ob);
@ -502,6 +504,8 @@ static void rna_Object_ray_cast(Object *ob,
{
bool success = false;
/* TODO(sergey): This isn't very reliable check. It is possible to have non-NULL pointer but
* which is out of date, and possibly dangling one. */
if (ob->runtime.mesh_eval == NULL &&
(ob = eval_object_ensure(ob, C, reports, rnaptr_depsgraph)) == NULL) {
return;

View File

@ -180,8 +180,6 @@ enum {
OPTYPE_LOCK_BYPASS = (1 << 9),
/** Special type of undo which doesn't store itself multiple times. */
OPTYPE_UNDO_GROUPED = (1 << 10),
/** Need evaluated data (i.e. a valid, up-to-date depsgraph for current context). */
OPTYPE_USE_EVAL_DATA = (1 << 11),
};
/** For #WM_cursor_grab_enable wrap axis. */

View File

@ -540,6 +540,7 @@ static int gizmo_find_intersected_3d_intern(wmGizmo **visible_gizmos,
ScrArea *sa = CTX_wm_area(C);
ARegion *ar = CTX_wm_region(C);
View3D *v3d = sa->spacedata.first;
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
rcti rect;
/* Almost certainly overkill, but allow for many custom gizmos. */
GLuint buffer[MAXPICKBUF];
@ -548,7 +549,7 @@ static int gizmo_find_intersected_3d_intern(wmGizmo **visible_gizmos,
BLI_rcti_init_pt_radius(&rect, co, hotspot);
ED_view3d_draw_setup_view(
CTX_wm_window(C), CTX_data_depsgraph(C), CTX_data_scene(C), ar, v3d, NULL, NULL, &rect);
CTX_wm_window(C), depsgraph, CTX_data_scene(C), ar, v3d, NULL, NULL, &rect);
bool use_select_bias = false;
@ -568,7 +569,7 @@ static int gizmo_find_intersected_3d_intern(wmGizmo **visible_gizmos,
}
ED_view3d_draw_setup_view(
CTX_wm_window(C), CTX_data_depsgraph(C), CTX_data_scene(C), ar, v3d, NULL, NULL, NULL);
CTX_wm_window(C), depsgraph, CTX_data_scene(C), ar, v3d, NULL, NULL, NULL);
if (use_select_bias && (hits > 1)) {
float co_direction[3];

View File

@ -495,7 +495,7 @@ void wm_event_do_notifiers(bContext *C)
* twice which can depgraph update the same object at once */
if (G.is_rendering == false) {
/* depsgraph gets called, might send more notifiers */
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
ED_update_for_newframe(CTX_data_main(C), depsgraph);
}
}

Some files were not shown because too many files have changed in this diff Show More