[Bf-blender-cvs] [479cefc99a5] temp-workspace-object-mode-removal: Cleanup: remove unneeded eval_ctx argument

Campbell Barton noreply at git.blender.org
Tue Feb 6 09:06:01 CET 2018


Commit: 479cefc99a5172c79ce901624876789b7ec71197
Author: Campbell Barton
Date:   Tue Feb 6 19:08:24 2018 +1100
Branches: temp-workspace-object-mode-removal
https://developer.blender.org/rB479cefc99a5172c79ce901624876789b7ec71197

Cleanup: remove unneeded eval_ctx argument

===================================================================

M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_intern.h
M	source/blender/editors/sculpt_paint/sculpt_undo.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 956ea8bdaf0..7edbe6f90cc 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -5211,7 +5211,7 @@ static void sculpt_dynamic_topology_triangulate(BMesh *bm)
 	}
 }
 
-void sculpt_pbvh_clear(const EvaluationContext *eval_ctx, Object *ob)
+void sculpt_pbvh_clear(Object *ob)
 {
 	SculptSession *ss = ob->sculpt;
 	DerivedMesh *dm = ob->derivedFinal;
@@ -5221,7 +5221,7 @@ void sculpt_pbvh_clear(const EvaluationContext *eval_ctx, Object *ob)
 		BKE_pbvh_free(ss->pbvh);
 	ss->pbvh = NULL;
 	if (dm)
-		dm->getPBVH(eval_ctx, NULL, dm);
+		dm->getPBVH(NULL, NULL, dm);
 	BKE_object_free_derived_caches(ob);
 }
 
@@ -5273,15 +5273,13 @@ void sculpt_update_after_dynamic_topology_toggle(bContext *C)
 
 void sculpt_dynamic_topology_enable(bContext *C)
 {
-	EvaluationContext eval_ctx;
-	CTX_data_eval_ctx(C, &eval_ctx);
 	Scene *scene = CTX_data_scene(C);
 	Object *ob = CTX_data_active_object(C);
 	SculptSession *ss = ob->sculpt;
 	Mesh *me = ob->data;
 	const BMAllocTemplate allocsize = BMALLOC_TEMPLATE_FROM_ME(me);
 
-	sculpt_pbvh_clear(&eval_ctx, ob);
+	sculpt_pbvh_clear(ob);
 
 	ss->bm_smooth_shading = (scene->toolsettings->sculpt->flags & SCULPT_DYNTOPO_SMOOTH_SHADING) != 0;
 
@@ -5322,13 +5320,11 @@ void sculpt_dynamic_topology_enable(bContext *C)
 void sculpt_dynamic_topology_disable(bContext *C,
                                      SculptUndoNode *unode)
 {
-	EvaluationContext eval_ctx;
-	CTX_data_eval_ctx(C, &eval_ctx);
 	Object *ob = CTX_data_active_object(C);
 	SculptSession *ss = ob->sculpt;
 	Mesh *me = ob->data;
 
-	sculpt_pbvh_clear(&eval_ctx, ob);
+	sculpt_pbvh_clear(ob);
 
 	if (unode) {
 		/* Free all existing custom data */
@@ -5518,11 +5514,9 @@ static void SCULPT_OT_dynamic_topology_toggle(wmOperatorType *ot)
 
 static int sculpt_optimize_exec(bContext *C, wmOperator *UNUSED(op))
 {
-	EvaluationContext eval_ctx;
-	CTX_data_eval_ctx(C, &eval_ctx);
 	Object *ob = CTX_data_active_object(C);
 
-	sculpt_pbvh_clear(&eval_ctx, ob);
+	sculpt_pbvh_clear(ob);
 	WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
 
 	return OPERATOR_FINISHED;
@@ -5557,8 +5551,6 @@ static void SCULPT_OT_optimize(wmOperatorType *ot)
 
 static int sculpt_symmetrize_exec(bContext *C, wmOperator *UNUSED(op))
 {
-	EvaluationContext eval_ctx;
-	CTX_data_eval_ctx(C, &eval_ctx);
 	Object *ob = CTX_data_active_object(C);
 	const Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
 	SculptSession *ss = ob->sculpt;
@@ -5589,7 +5581,7 @@ static int sculpt_symmetrize_exec(bContext *C, wmOperator *UNUSED(op))
 	sculpt_undo_push_end(C);
 
 	/* Redraw */
-	sculpt_pbvh_clear(&eval_ctx, ob);
+	sculpt_pbvh_clear(ob);
 	WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
 
 	return OPERATOR_FINISHED;
@@ -5788,9 +5780,6 @@ static int sculpt_and_dynamic_topology_constant_detail_poll(bContext *C)
 
 static int sculpt_detail_flood_fill_exec(bContext *C, wmOperator *UNUSED(op))
 {
-	EvaluationContext eval_ctx;
-	CTX_data_eval_ctx(C, &eval_ctx);
-
 	Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
 	Object *ob = CTX_data_active_object(C);
 	SculptSession *ss = ob->sculpt;
@@ -5832,7 +5821,7 @@ static int sculpt_detail_flood_fill_exec(bContext *C, wmOperator *UNUSED(op))
 	sculpt_undo_push_end(C);
 
 	/* force rebuild of pbvh for better BB placement */
-	sculpt_pbvh_clear(&eval_ctx, ob);
+	sculpt_pbvh_clear(ob);
 	/* Redraw */
 	WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
 
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index 5f2e87fc857..58fad870ab3 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -58,7 +58,7 @@ int sculpt_poll_view3d(struct bContext *C);
 bool sculpt_stroke_get_location(struct bContext *C, float out[3], const float mouse[2]);
 
 /* Dynamic topology */
-void sculpt_pbvh_clear(const struct EvaluationContext *eval_ctx, Object *ob);
+void sculpt_pbvh_clear(Object *ob);
 void sculpt_dyntopo_node_layers_add(struct SculptSession *ss);
 void sculpt_update_after_dynamic_topology_toggle(struct bContext *C);
 void sculpt_dynamic_topology_enable(struct bContext *C);
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index fa7b27dd47e..2530a90e75b 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -334,9 +334,6 @@ static void sculpt_undo_bmesh_restore_generic(bContext *C,
                                               Object *ob,
                                               SculptSession *ss)
 {
-	EvaluationContext eval_ctx;
-	CTX_data_eval_ctx(C, &eval_ctx);
- 
 	if (unode->applied) {
 		BM_log_undo(ss->bm, ss->bm_log);
 		unode->applied = false;
@@ -366,19 +363,17 @@ static void sculpt_undo_bmesh_restore_generic(bContext *C,
 			MEM_freeN(nodes);
 	}
 	else {
-		sculpt_pbvh_clear(&eval_ctx, ob);
+		sculpt_pbvh_clear(ob);
 	}
 }
 
 /* Create empty sculpt BMesh and enable logging */
-static void sculpt_undo_bmesh_enable(
-        const EvaluationContext *eval_ctx,
-        Object *ob, SculptUndoNode *unode)
+static void sculpt_undo_bmesh_enable(Object *ob, SculptUndoNode *unode)
 {
 	SculptSession *ss = ob->sculpt;
 	Mesh *me = ob->data;
 
-	sculpt_pbvh_clear(eval_ctx, ob);
+	sculpt_pbvh_clear(ob);
 
 	/* Create empty BMesh and enable logging */
 	ss->bm = BM_mesh_create(
@@ -398,14 +393,12 @@ static void sculpt_undo_bmesh_restore_begin(bContext *C,
                                             Object *ob,
                                             SculptSession *ss)
 {
-	EvaluationContext eval_ctx;
-	CTX_data_eval_ctx(C, &eval_ctx);
 	if (unode->applied) {
 		sculpt_dynamic_topology_disable(C, unode);
 		unode->applied = false;
 	}
 	else {
-		sculpt_undo_bmesh_enable(&eval_ctx, ob, unode);
+		sculpt_undo_bmesh_enable(ob, unode);
 
 		/* Restore the mesh from the first log entry */
 		BM_log_redo(ss->bm, ss->bm_log);
@@ -419,10 +412,8 @@ static void sculpt_undo_bmesh_restore_end(bContext *C,
                                           Object *ob,
                                           SculptSession *ss)
 {
-	EvaluationContext eval_ctx;
-	CTX_data_eval_ctx(C, &eval_ctx);
 	if (unode->applied) {
-		sculpt_undo_bmesh_enable(&eval_ctx, ob, unode);
+		sculpt_undo_bmesh_enable(ob, unode);
 
 		/* Restore the mesh from the last log entry */
 		BM_log_undo(ss->bm, ss->bm_log);



More information about the Bf-blender-cvs mailing list