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:
authorLukas Tönne <lukas.toenne@gmail.com>2016-12-28 19:30:58 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2016-12-28 19:30:58 +0300
commit6ecab6dd8e48d564a2b43e0e81e79d079e8b4c77 (patch)
tree618e2d24eb34a05a81f726dd52eb2b7468e9296d /source/blender/editors/util
parent605263177b8eea24c1449e4dbf0138175ec3dddf (diff)
Revert particle system and point cache removal in blender2.8 branch.
This reverts commit 5aa19be91263a249ffae75573e3b32f24269d890 and b4a721af694817fa921b119df83d33ede7d7fed0. Due to postponement of particle system rewrite it was decided to put particle code back into the 2.8 branch for the time being.
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r--source/blender/editors/util/CMakeLists.txt1
-rw-r--r--source/blender/editors/util/undo.c34
2 files changed, 30 insertions, 5 deletions
diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt
index 321b1043595..c0b30f93939 100644
--- a/source/blender/editors/util/CMakeLists.txt
+++ b/source/blender/editors/util/CMakeLists.txt
@@ -72,6 +72,7 @@ set(SRC
../include/ED_object.h
../include/ED_outliner.h
../include/ED_paint.h
+ ../include/ED_particle.h
../include/ED_physics.h
../include/ED_render.h
../include/ED_screen.h
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index 7fd67849414..4a9311416b3 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -49,6 +49,7 @@
#include "BKE_screen.h"
#include "ED_armature.h"
+#include "ED_particle.h"
#include "ED_curve.h"
#include "ED_gpencil.h"
#include "ED_mball.h"
@@ -97,6 +98,11 @@ void ED_undo_push(bContext *C, const char *str)
else if (obedit->type == OB_ARMATURE)
undo_push_armature(C, str);
}
+ else if (obact && obact->mode & OB_MODE_PARTICLE_EDIT) {
+ if (U.undosteps == 0) return;
+
+ PE_undo_push(CTX_data_scene(C), str);
+ }
else if (obact && obact->mode & OB_MODE_SCULPT) {
/* do nothing for now */
}
@@ -172,6 +178,12 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
else if (obact && obact->mode & OB_MODE_SCULPT) {
ED_undo_paint_step(C, UNDO_PAINT_MESH, step, undoname);
}
+ else if (obact && obact->mode & OB_MODE_PARTICLE_EDIT) {
+ if (step == 1)
+ PE_undo(scene);
+ else
+ PE_redo(scene);
+ }
else if (U.uiflag & USER_GLOBALUNDO) {
// note python defines not valid here anymore.
//#ifdef WITH_PYTHON
@@ -284,6 +296,9 @@ bool ED_undo_is_valid(const bContext *C, const char *undoname)
if (ED_undo_paint_is_valid(UNDO_PAINT_MESH, undoname))
return 1;
}
+ else if (obact && obact->mode & OB_MODE_PARTICLE_EDIT) {
+ return PE_undo_is_valid(CTX_data_scene(C));
+ }
if (U.uiflag & USER_GLOBALUNDO) {
return BKE_undo_is_valid(undoname);
@@ -443,8 +458,9 @@ void ED_undo_operator_repeat_cb_evt(bContext *C, void *arg_op, int UNUSED(arg_ev
enum {
UNDOSYSTEM_GLOBAL = 1,
UNDOSYSTEM_EDITMODE = 2,
- UNDOSYSTEM_IMAPAINT = 3,
- UNDOSYSTEM_SCULPT = 4,
+ UNDOSYSTEM_PARTICLE = 3,
+ UNDOSYSTEM_IMAPAINT = 4,
+ UNDOSYSTEM_SCULPT = 5,
};
static int get_undo_system(bContext *C)
@@ -470,7 +486,9 @@ static int get_undo_system(bContext *C)
}
else {
if (obact) {
- if (obact->mode & OB_MODE_TEXTURE_PAINT) {
+ if (obact->mode & OB_MODE_PARTICLE_EDIT)
+ return UNDOSYSTEM_PARTICLE;
+ else if (obact->mode & OB_MODE_TEXTURE_PAINT) {
if (!ED_undo_paint_empty(UNDO_PAINT_IMAGE))
return UNDOSYSTEM_IMAPAINT;
}
@@ -496,7 +514,10 @@ static EnumPropertyItem *rna_undo_itemf(bContext *C, int undosys, int *totitem)
while (true) {
const char *name = NULL;
- if (undosys == UNDOSYSTEM_EDITMODE) {
+ if (undosys == UNDOSYSTEM_PARTICLE) {
+ name = PE_undo_get_name(CTX_data_scene(C), i, &active);
+ }
+ else if (undosys == UNDOSYSTEM_EDITMODE) {
name = undo_editmode_get_name(C, i, &active);
}
else if (undosys == UNDOSYSTEM_IMAPAINT) {
@@ -576,7 +597,10 @@ static int undo_history_exec(bContext *C, wmOperator *op)
int undosys = get_undo_system(C);
int item = RNA_int_get(op->ptr, "item");
- if (undosys == UNDOSYSTEM_EDITMODE) {
+ if (undosys == UNDOSYSTEM_PARTICLE) {
+ PE_undo_number(CTX_data_scene(C), item);
+ }
+ else if (undosys == UNDOSYSTEM_EDITMODE) {
undo_editmode_number(C, item + 1);
WM_event_add_notifier(C, NC_GEOM | ND_DATA, NULL);
}