[Bf-blender-cvs] [2af6e0b7cb1] temp-workspace-object-mode-removal: Correct bad eval_ctx.mode use. Use workspace object mode instead

Campbell Barton noreply at git.blender.org
Wed Feb 7 02:38:46 CET 2018


Commit: 2af6e0b7cb1556739e65a583234b4403c104f0ec
Author: Campbell Barton
Date:   Wed Feb 7 12:38:15 2018 +1100
Branches: temp-workspace-object-mode-removal
https://developer.blender.org/rB2af6e0b7cb1556739e65a583234b4403c104f0ec

Correct bad eval_ctx.mode use. Use workspace object mode instead

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

M	source/blender/editors/physics/particle_object.c

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

diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index 537b8ce2ff6..7a22a0d81d9 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -133,26 +133,24 @@ void OBJECT_OT_particle_system_add(wmOperatorType *ot)
 
 static int particle_system_remove_exec(bContext *C, wmOperator *UNUSED(op))
 {
-	EvaluationContext eval_ctx;
-	CTX_data_eval_ctx(C, &eval_ctx);
+	WorkSpace *workspace = CTX_wm_workspace(C);
 	Object *ob = ED_object_context(C);
 	Scene *scene = CTX_data_scene(C);
 	ViewLayer *view_layer = CTX_data_view_layer(C);
-	int mode_orig;
+	eObjectMode mode_orig;
 
 	if (!scene || !ob)
 		return OPERATOR_CANCELLED;
 
-	mode_orig = eval_ctx.mode;
+	mode_orig = workspace->object_mode;
 	object_remove_particle_system(scene, ob);
 
 	/* possible this isn't the active object
 	 * object_remove_particle_system() clears the mode on the last psys
 	 */
 	if (mode_orig & OB_MODE_PARTICLE_EDIT) {
-		if ((eval_ctx.object_mode & OB_MODE_PARTICLE_EDIT) == 0) {
+		if ((workspace->object_mode & OB_MODE_PARTICLE_EDIT) == 0) {
 			if (view_layer->basact && view_layer->basact->object == ob) {
-				WorkSpace *workspace = CTX_wm_workspace(C);
 				workspace->object_mode &= ~OB_MODE_PARTICLE_EDIT;
 				WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, NULL);
 			}



More information about the Bf-blender-cvs mailing list