Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-04-03 15:19:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-04-03 15:19:51 +0300
commita2c0a382cd00b9b1a3058ad0017887e451b73465 (patch)
treebe978c24be659a22afb22eb53c52c468e4087c06 /source/blender/editors
parentfeb7852e1ba55b4c7f697ec52fee672a8cc2261c (diff)
parentb3004d30f5d5060035c5f8ac4cb6338463872877 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c1
-rw-r--r--source/blender/editors/gpencil/gpencil_undo.c1
-rw-r--r--source/blender/editors/include/ED_undo.h2
-rw-r--r--source/blender/editors/mesh/editmesh_extrude.c1
-rw-r--r--source/blender/editors/mesh/editmesh_utils.c1
-rw-r--r--source/blender/editors/physics/particle_edit.c1
-rw-r--r--source/blender/editors/physics/particle_edit_undo.c2
-rw-r--r--source/blender/editors/physics/physics_fluid.c1
-rw-r--r--source/blender/editors/sculpt_paint/paint_curve_undo.c11
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_undo.c14
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c18
-rw-r--r--source/blender/editors/space_action/action_buttons.c1
-rw-r--r--source/blender/editors/space_action/action_data.c1
-rw-r--r--source/blender/editors/space_action/action_edit.c1
-rw-r--r--source/blender/editors/space_text/text_undo.c1
-rw-r--r--source/blender/editors/undo/ed_undo.c14
16 files changed, 38 insertions, 33 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index c25e4d3ea73..77e5dc8fe5d 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -46,7 +46,6 @@
#include "PIL_time.h"
-#include "BKE_main.h"
#include "BKE_paint.h"
#include "BKE_gpencil.h"
#include "BKE_context.h"
diff --git a/source/blender/editors/gpencil/gpencil_undo.c b/source/blender/editors/gpencil/gpencil_undo.c
index 7a9ad2b32c0..202d7630ae0 100644
--- a/source/blender/editors/gpencil/gpencil_undo.c
+++ b/source/blender/editors/gpencil/gpencil_undo.c
@@ -45,7 +45,6 @@
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_gpencil.h"
-#include "BKE_main.h"
#include "ED_gpencil.h"
diff --git a/source/blender/editors/include/ED_undo.h b/source/blender/editors/include/ED_undo.h
index 044d69cfced..b3814ab5899 100644
--- a/source/blender/editors/include/ED_undo.h
+++ b/source/blender/editors/include/ED_undo.h
@@ -51,6 +51,8 @@ void ED_undo_operator_repeat_cb_evt(struct bContext *C, void *arg_op, int arg
bool ED_undo_is_valid(const struct bContext *C, const char *undoname);
+struct UndoStack *ED_undo_stack_get(void);
+
/* undo_system_types.c */
void ED_undosys_type_init(void);
void ED_undosys_type_free(void);
diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c
index 64980b84a0b..41b3ab0079b 100644
--- a/source/blender/editors/mesh/editmesh_extrude.c
+++ b/source/blender/editors/mesh/editmesh_extrude.c
@@ -36,7 +36,6 @@
#include "BLI_listbase.h"
#include "BKE_context.h"
-#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "BKE_editmesh.h"
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index 393fa475a9b..3382847c8a4 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -43,7 +43,6 @@
#include "BKE_DerivedMesh.h"
#include "BKE_context.h"
-#include "BKE_main.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_report.h"
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 9deae22e4e1..14bcba3416f 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -4436,6 +4436,7 @@ void PE_create_particle_edit(
recalc_lengths(edit);
if (psys && !cache)
recalc_emitter_field(ob, psys);
+
PE_update_object(eval_ctx, scene, ob, 1);
}
}
diff --git a/source/blender/editors/physics/particle_edit_undo.c b/source/blender/editors/physics/particle_edit_undo.c
index 1264800afc8..5199b1c54fa 100644
--- a/source/blender/editors/physics/particle_edit_undo.c
+++ b/source/blender/editors/physics/particle_edit_undo.c
@@ -44,11 +44,9 @@
#include "BLI_string.h"
#include "BLI_utildefines.h"
-#include "BKE_global.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "BKE_context.h"
-#include "BKE_main.h"
#include "BKE_undo_system.h"
#include "DEG_depsgraph.h"
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index bb29a619139..65ef3ad44d0 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -48,7 +48,6 @@
#include "BKE_context.h"
#include "BKE_customdata.h"
#include "BKE_fluidsim.h"
-#include "BKE_main.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BKE_report.h"
diff --git a/source/blender/editors/sculpt_paint/paint_curve_undo.c b/source/blender/editors/sculpt_paint/paint_curve_undo.c
index d5b7496fa3e..77f06180df6 100644
--- a/source/blender/editors/sculpt_paint/paint_curve_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_curve_undo.c
@@ -34,11 +34,10 @@
#include "BKE_context.h"
#include "BKE_paint.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
#include "BKE_undo_system.h"
#include "ED_paint.h"
+#include "ED_undo.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -155,15 +154,15 @@ void ED_paintcurve_undosys_type(UndoType *ut)
void ED_paintcurve_undo_push_begin(const char *name)
{
+ UndoStack *ustack = ED_undo_stack_get();
bContext *C = NULL; /* special case, we never read from this. */
- wmWindowManager *wm = G.main->wm.first;
- BKE_undosys_step_push_init_with_type(wm->undo_stack, C, name, BKE_UNDOSYS_TYPE_PAINTCURVE);
+ BKE_undosys_step_push_init_with_type(ustack, C, name, BKE_UNDOSYS_TYPE_PAINTCURVE);
}
void ED_paintcurve_undo_push_end(void)
{
- wmWindowManager *wm = G.main->wm.first; /* XXX, avoids adding extra arg. */
- BKE_undosys_step_push(wm->undo_stack, NULL, NULL);
+ UndoStack *ustack = ED_undo_stack_get();
+ BKE_undosys_step_push(ustack, NULL, NULL);
}
/** \} */
diff --git a/source/blender/editors/sculpt_paint/paint_image_undo.c b/source/blender/editors/sculpt_paint/paint_image_undo.c
index 5308ef0fae8..5184f5cc757 100644
--- a/source/blender/editors/sculpt_paint/paint_image_undo.c
+++ b/source/blender/editors/sculpt_paint/paint_image_undo.c
@@ -41,12 +41,12 @@
#include "BKE_context.h"
#include "BKE_image.h"
#include "BKE_main.h"
-#include "BKE_global.h"
#include "BKE_undo_system.h"
#include "DEG_depsgraph.h"
#include "ED_paint.h"
+#include "ED_undo.h"
#include "GPU_draw.h"
@@ -360,15 +360,15 @@ static void image_undo_free_list(ListBase *lb)
void ED_image_undo_push_begin(const char *name)
{
+ UndoStack *ustack = ED_undo_stack_get();
bContext *C = NULL; /* special case, we never read from this. */
- wmWindowManager *wm = G.main->wm.first;
- BKE_undosys_step_push_init_with_type(wm->undo_stack, C, name, BKE_UNDOSYS_TYPE_IMAGE);
+ BKE_undosys_step_push_init_with_type(ustack, C, name, BKE_UNDOSYS_TYPE_IMAGE);
}
void ED_image_undo_push_end(void)
{
- wmWindowManager *wm = G.main->wm.first; /* XXX, avoids adding extra arg. */
- BKE_undosys_step_push(wm->undo_stack, NULL, NULL);
+ UndoStack *ustack = ED_undo_stack_get();
+ BKE_undosys_step_push(ustack, NULL, NULL);
}
static void image_undo_invalidate(void)
@@ -489,8 +489,8 @@ ListBase *ED_image_undosys_step_get_tiles(UndoStep *us_p)
ListBase *ED_image_undo_get_tiles(void)
{
- wmWindowManager *wm = G.main->wm.first; /* XXX, avoids adding extra arg. */
- UndoStep *us = BKE_undosys_stack_init_or_active_with_type(wm->undo_stack, BKE_UNDOSYS_TYPE_IMAGE);
+ UndoStack *ustack = ED_undo_stack_get();
+ UndoStep *us = BKE_undosys_stack_init_or_active_with_type(ustack, BKE_UNDOSYS_TYPE_IMAGE);
return ED_image_undosys_step_get_tiles(us);
}
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 7158c0fc88f..694e1f048f5 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -59,11 +59,10 @@
#include "BKE_key.h"
#include "BKE_mesh.h"
#include "BKE_subsurf.h"
-#include "DEG_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
#include "BKE_undo_system.h"
+#include "DEG_depsgraph.h"
+
#include "WM_api.h"
#include "WM_types.h"
@@ -72,6 +71,7 @@
#include "ED_paint.h"
#include "ED_object.h"
#include "ED_sculpt.h"
+#include "ED_undo.h"
#include "bmesh.h"
#include "paint_intern.h"
@@ -981,9 +981,9 @@ SculptUndoNode *sculpt_undo_push_node(
void sculpt_undo_push_begin(const char *name)
{
+ UndoStack *ustack = ED_undo_stack_get();
bContext *C = NULL; /* special case, we never read from this. */
- wmWindowManager *wm = G.main->wm.first;
- BKE_undosys_step_push_init_with_type(wm->undo_stack, C, name, BKE_UNDOSYS_TYPE_SCULPT);
+ BKE_undosys_step_push_init_with_type(ustack, C, name, BKE_UNDOSYS_TYPE_SCULPT);
}
void sculpt_undo_push_end(void)
@@ -1002,8 +1002,8 @@ void sculpt_undo_push_end(void)
BKE_pbvh_node_layer_disp_free(unode->node);
}
- wmWindowManager *wm = G.main->wm.first; /* XXX, avoids adding extra arg. */
- BKE_undosys_step_push(wm->undo_stack, NULL, NULL);
+ UndoStack *ustack = ED_undo_stack_get();
+ BKE_undosys_step_push(ustack, NULL, NULL);
}
/* -------------------------------------------------------------------- */
@@ -1091,8 +1091,8 @@ static UndoSculpt *sculpt_undosys_step_get_nodes(UndoStep *us_p)
static UndoSculpt *sculpt_undo_get_nodes(void)
{
- wmWindowManager *wm = G.main->wm.first; /* XXX, avoids adding extra arg. */
- UndoStep *us = BKE_undosys_stack_init_or_active_with_type(wm->undo_stack, BKE_UNDOSYS_TYPE_SCULPT);
+ UndoStack *ustack = ED_undo_stack_get();
+ UndoStep *us = BKE_undosys_stack_init_or_active_with_type(ustack, BKE_UNDOSYS_TYPE_SCULPT);
return sculpt_undosys_step_get_nodes(us);
}
diff --git a/source/blender/editors/space_action/action_buttons.c b/source/blender/editors/space_action/action_buttons.c
index 82768bedc95..3ba59b3be75 100644
--- a/source/blender/editors/space_action/action_buttons.c
+++ b/source/blender/editors/space_action/action_buttons.c
@@ -49,7 +49,6 @@
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_fcurve.h"
-#include "BKE_main.h"
#include "BKE_screen.h"
#include "BKE_unit.h"
diff --git a/source/blender/editors/space_action/action_data.c b/source/blender/editors/space_action/action_data.c
index ca8dbbce1a1..f1153b5bed0 100644
--- a/source/blender/editors/space_action/action_data.c
+++ b/source/blender/editors/space_action/action_data.c
@@ -56,7 +56,6 @@
#include "BKE_fcurve.h"
#include "BKE_library.h"
#include "BKE_key.h"
-#include "BKE_main.h"
#include "BKE_nla.h"
#include "BKE_scene.h"
#include "BKE_context.h"
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index 72b1245ca8a..1c15a7c5950 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -59,7 +59,6 @@
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_key.h"
-#include "BKE_main.h"
#include "BKE_nla.h"
#include "BKE_context.h"
#include "BKE_report.h"
diff --git a/source/blender/editors/space_text/text_undo.c b/source/blender/editors/space_text/text_undo.c
index 4f62c409d58..ef9cfccdc1c 100644
--- a/source/blender/editors/space_text/text_undo.c
+++ b/source/blender/editors/space_text/text_undo.c
@@ -38,7 +38,6 @@
#include "BKE_context.h"
#include "BKE_library.h"
-#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_text.h"
#include "BKE_undo_system.h"
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c
index 691ba066bf9..4f62e38dc0b 100644
--- a/source/blender/editors/undo/ed_undo.c
+++ b/source/blender/editors/undo/ed_undo.c
@@ -42,6 +42,7 @@
#include "BKE_blender_undo.h"
#include "BKE_context.h"
#include "BKE_global.h"
+#include "BKE_main.h"
#include "BKE_screen.h"
#include "BKE_undo_system.h"
@@ -190,6 +191,19 @@ bool ED_undo_is_valid(const bContext *C, const char *undoname)
return BKE_undosys_stack_has_undo(wm->undo_stack, undoname);
}
+/**
+ * Ideally we wont access the stack directly,
+ * this is needed for modes which handle undo themselves (bypassing #ED_undo_push).
+ *
+ * Using global isn't great, this just avoids doing inline,
+ * causing 'BKE_global.h' & 'BKE_main.h' includes.
+ */
+UndoStack *ED_undo_stack_get(void)
+{
+ wmWindowManager *wm = G.main->wm.first;
+ return wm->undo_stack;
+}
+
/** \} */
/* -------------------------------------------------------------------- */