From ca05219f3ec3574d2e1cb9c8eaa2790f685f26bb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 27 Mar 2012 00:01:35 +0000 Subject: fix [#30651] bpy.ops.object.mode_set(...) editmode removes faces. problem was that BMesh had tessellation call when undo pushes were called. if python called an operator with no undo push, tessfaces would not be created. fix this by making it the responsibility of each editmesh operator to re-tessellate, as it is with notifiers and depsgraph. added EDBM_update_generic() function to add notifier, tag for depsgraph update and optionally re-tessellate. --- source/blender/makesdna/DNA_object_types.h | 13 +++++++------ source/blender/makesdna/DNA_particle_types.h | 14 +++++++------- 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index d3f8c65995a..86a2bb60cc9 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -439,13 +439,14 @@ typedef struct DupliObject { // #define OB_RADIO 2048 /* deprecated */ #define OB_FROMGROUP 4096 +/* WARNING - when adding flags check on PSYS_RECALC */ /* ob->recalc (flag bits!) */ -#define OB_RECALC_OB 1 -#define OB_RECALC_DATA 2 - /* time flag is set when time changes need recalc, so baked systems can ignore it */ -#define OB_RECALC_TIME 4 - /* only use for matching any flag, NOT as an argument since more flags may be added. */ -#define OB_RECALC_ALL (OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME) +#define OB_RECALC_OB (1 << 0) +#define OB_RECALC_DATA (1 << 1) +/* time flag is set when time changes need recalc, so baked systems can ignore it */ +#define OB_RECALC_TIME (1 << 2) +/* only use for matching any flag, NOT as an argument since more flags may be added. */ +#define OB_RECALC_ALL (OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME) /* controller state */ #define OB_MAX_STATES 30 diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 63c4806028a..58ffcf6480e 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -481,13 +481,13 @@ typedef struct ParticleSystem #define PART_CHILD_FACES 2 /* psys->recalc */ -/* starts from 8 so that the first bits can be ob->recalc */ -#define PSYS_RECALC_REDO 8 /* only do pathcache etc */ -#define PSYS_RECALC_RESET 16 /* reset everything including pointcache */ -#define PSYS_RECALC_TYPE 32 /* handle system type change */ -#define PSYS_RECALC_CHILD 64 /* only child settings changed */ -#define PSYS_RECALC_PHYS 128 /* physics type changed */ -#define PSYS_RECALC 248 +/* starts from (1 << 3) so that the first bits can be ob->recalc */ +#define PSYS_RECALC_REDO (1 << 3) /* only do pathcache etc */ +#define PSYS_RECALC_RESET (1 << 4) /* reset everything including pointcache */ +#define PSYS_RECALC_TYPE (1 << 5) /* handle system type change */ +#define PSYS_RECALC_CHILD (1 << 6) /* only child settings changed */ +#define PSYS_RECALC_PHYS (1 << 7) /* physics type changed */ +#define PSYS_RECALC (PSYS_RECALC_REDO | PSYS_RECALC_RESET | PSYS_RECALC_TYPE | PSYS_RECALC_CHILD | PSYS_RECALC_PHYS) /* psys->flag */ #define PSYS_CURRENT 1 -- cgit v1.2.3