[Bf-blender-cvs] [32287212f54] blender2.8: Cleanup: pass eval_ctx to sculpt_init_session

Campbell Barton noreply at git.blender.org
Fri Feb 9 10:26:02 CET 2018


Commit: 32287212f540e1b7360d551810387f6852ccde62
Author: Campbell Barton
Date:   Fri Feb 9 17:46:46 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB32287212f540e1b7360d551810387f6852ccde62

Cleanup: pass eval_ctx to sculpt_init_session

Matches vertex paint mode

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

M	source/blender/editors/sculpt_paint/sculpt.c

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

diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 5b59de06d0a..06705f6715d 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -5600,16 +5600,13 @@ static void SCULPT_OT_symmetrize(wmOperatorType *ot)
 
 /**** Toggle operator for turning sculpt mode on or off ****/
 
-static void sculpt_init_session(const bContext *C, Scene *scene, Object *ob)
+static void sculpt_init_session(const EvaluationContext *eval_ctx, Scene *scene, Object *ob)
 {
-	EvaluationContext eval_ctx;
-	CTX_data_eval_ctx(C, &eval_ctx);
-
 	/* Create persistent sculpt mode data */
 	BKE_sculpt_toolsettings_data_ensure(scene);
 
 	ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
-	BKE_sculpt_update_mesh_elements(&eval_ctx, scene, scene->toolsettings->sculpt, ob, 0, false);
+	BKE_sculpt_update_mesh_elements(eval_ctx, scene, scene->toolsettings->sculpt, ob, 0, false);
 }
 
 
@@ -5677,7 +5674,9 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
 			BKE_sculptsession_free(ob);
 		}
 
-		sculpt_init_session(C, scene, ob);
+		EvaluationContext eval_ctx;
+		CTX_data_eval_ctx(C, &eval_ctx);
+		sculpt_init_session(&eval_ctx, scene, ob);
 
 		/* Mask layer is required */
 		if (mmd) {



More information about the Bf-blender-cvs mailing list