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:
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r--source/blender/editors/util/Makefile2
-rw-r--r--source/blender/editors/util/ed_util.c7
-rw-r--r--source/blender/editors/util/editmode_undo.c2
-rw-r--r--source/blender/editors/util/numinput.c2
-rw-r--r--source/blender/editors/util/undo.c21
5 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/editors/util/Makefile b/source/blender/editors/util/Makefile
index 303079daeee..8535b3fb402 100644
--- a/source/blender/editors/util/Makefile
+++ b/source/blender/editors/util/Makefile
@@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2007 Blender Foundation
# All rights reserved.
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index 2796e708932..8e2a30b4a69 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -38,7 +38,6 @@
#include "BLI_editVert.h"
#include "BKE_context.h"
-#include "BKE_global.h"
#include "BKE_main.h"
#include "ED_armature.h"
@@ -77,13 +76,17 @@ void ED_editors_init(bContext *C)
/* frees all editmode stuff */
void ED_editors_exit(bContext *C)
{
+ Main *bmain= CTX_data_main(C);
Scene *sce;
+
+ if(!bmain)
+ return;
/* frees all editmode undos */
undo_editmode_clear();
ED_undo_paint_free();
- for(sce=G.main->scene.first; sce; sce= sce->id.next) {
+ for(sce=bmain->scene.first; sce; sce= sce->id.next) {
if(sce->obedit) {
Object *ob= sce->obedit;
diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c
index 949bf30c4fd..564439a7bb3 100644
--- a/source/blender/editors/util/editmode_undo.c
+++ b/source/blender/editors/util/editmode_undo.c
@@ -40,12 +40,10 @@
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_global.h"
-#include "BKE_object.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
-#include "BKE_utildefines.h"
#include "ED_mesh.h"
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index a5c0bfeb73a..868aa8ac6af 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -30,8 +30,6 @@
#include <math.h> /* fabs */
#include <stdio.h> /* for sprintf */
-#include "BKE_global.h" /* for G */
-#include "BKE_utildefines.h" /* ABS */
#include "WM_types.h"
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index 636ce9dcec5..283e2b49f0d 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -38,16 +38,11 @@
#include "BKE_blender.h"
#include "BKE_context.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_object.h"
-#include "BKE_text.h"
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
#include "BLI_dynstr.h"
-#include "BKE_utildefines.h"
#include "ED_armature.h"
#include "ED_particle.h"
@@ -116,7 +111,9 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
SpaceImage *sima= (SpaceImage *)sa->spacedata.first;
if((obact && obact->mode & OB_MODE_TEXTURE_PAINT) || sima->flag & SI_DRAWTOOL) {
- ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step);
+ if(!ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step, undoname) && undoname)
+ if(U.uiflag & USER_GLOBALUNDO)
+ BKE_undo_name(C, undoname);
WM_event_add_notifier(C, NC_WINDOW, NULL);
return OPERATOR_FINISHED;
@@ -139,10 +136,14 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
else {
int do_glob_undo= 0;
- if(obact && obact->mode & OB_MODE_TEXTURE_PAINT)
- ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step);
- else if(obact && obact->mode & OB_MODE_SCULPT)
- ED_undo_paint_step(C, UNDO_PAINT_MESH, step);
+ if(obact && obact->mode & OB_MODE_TEXTURE_PAINT) {
+ if(!ED_undo_paint_step(C, UNDO_PAINT_IMAGE, step, undoname) && undoname)
+ do_glob_undo= 1;
+ }
+ else if(obact && obact->mode & OB_MODE_SCULPT) {
+ if(!ED_undo_paint_step(C, UNDO_PAINT_MESH, step, undoname) && undoname)
+ do_glob_undo= 1;
+ }
else if(obact && obact->mode & OB_MODE_PARTICLE_EDIT) {
if(step==1)
PE_undo(CTX_data_scene(C));