diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-30 17:11:06 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-30 17:11:06 +0300 |
commit | a989913dd4c777ac936671ab214144429087e4ad (patch) | |
tree | 2d6a43d604b11814b731a8e76a5e2de4a7b2a6fe /source/blender | |
parent | 79bbbf7e200258b63c0e4e71e9a8508b11a95946 (diff) | |
parent | c241d79dc8a8ee144bc904f0a9b039b452df44bd (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 19 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_snap_object.c | 11 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_types.h | 10 |
3 files changed, 15 insertions, 25 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index d2c48c4aea0..5e8c2e2c09a 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1890,7 +1890,6 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) { TransData *td = NULL; TransDataExtension *tx; - Base *base = CTX_data_active_base(C); Object *ob = CTX_data_active_object(C); ParticleEditSettings *pset = PE_settings(t->scene); PTCacheEdit *edit = PE_get_current(t->scene, t->view_layer, ob); @@ -1910,8 +1909,6 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) if (psys) psmd = psys_get_modifier(ob, psys); - base->flag |= BA_HAS_RECALC_DATA; - for (i = 0, point = edit->points; i < edit->totpoint; i++, point++) { point->flag &= ~PEP_TRANSFORM; transformparticle = 0; @@ -5612,10 +5609,9 @@ static void set_trans_object_base_flags(TransInfo *t) /* and we store them temporal in base (only used for transform code) */ /* this because after doing updates, the object->recalc is cleared */ for (base = view_layer->object_bases.first; base; base = base->next) { - if (base->object->recalc & OB_RECALC_OB) - base->flag_legacy |= BA_HAS_RECALC_OB; - if (base->object->recalc & OB_RECALC_DATA) - base->flag_legacy |= BA_HAS_RECALC_DATA; + if (base->object->recalc & (OB_RECALC_OB | OB_RECALC_DATA)) { + base->flag |= BA_SNAP_FIX_DEPS_FIASCO; + } } } @@ -5696,10 +5692,9 @@ static int count_proportional_objects(TransInfo *t) /* and we store them temporal in base (only used for transform code) */ /* this because after doing updates, the object->recalc is cleared */ for (base = view_layer->object_bases.first; base; base = base->next) { - if (base->object->recalc & OB_RECALC_OB) - base->flag_legacy |= BA_HAS_RECALC_OB; - if (base->object->recalc & OB_RECALC_DATA) - base->flag_legacy |= BA_HAS_RECALC_DATA; + if (base->object->recalc & (OB_RECALC_OB | OB_RECALC_DATA)) { + base->flag |= BA_SNAP_FIX_DEPS_FIASCO; + } } return total; @@ -5715,7 +5710,7 @@ static void clear_trans_object_base_flags(TransInfo *t) base->flag |= BASE_SELECTED; } - base->flag_legacy &= ~(BA_WAS_SEL | BA_HAS_RECALC_OB | BA_HAS_RECALC_DATA | BA_TEMP_TAG | BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT); + base->flag_legacy &= ~(BA_WAS_SEL | BA_SNAP_FIX_DEPS_FIASCO | BA_TEMP_TAG | BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT); } } diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index d92417ec68a..ce8de2ef4d3 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -161,17 +161,8 @@ static void iter_snap_objects( void *data) { Base *base_act = sctx->eval_ctx.view_layer->basact; - /* Need an exception for particle edit because the base is flagged with BA_HAS_RECALC_DATA - * which makes the loop skip it, even the derived mesh will never change - * - * To solve that problem, we do it first as an exception. - * */ - if (base_act && base_act->object && base_act->object->mode & OB_MODE_PARTICLE_EDIT) { - sob_callback(sctx, false, base_act->object, base_act->object->obmat, data); - } - for (Base *base = sctx->eval_ctx.view_layer->object_bases.first; base != NULL; base = base->next) { - if ((BASE_VISIBLE(base)) && (base->flag_legacy & (BA_HAS_RECALC_OB | BA_HAS_RECALC_DATA)) == 0 && + if ((BASE_VISIBLE(base)) && (base->flag_legacy & BA_SNAP_FIX_DEPS_FIASCO) == 0 && !((snap_select == SNAP_NOT_SELECTED && ((base->flag & BASE_SELECTED) || (base->flag_legacy & BA_WAS_SEL))) || (snap_select == SNAP_NOT_ACTIVE && base == base_act))) { diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index e39c6c37814..070d34ef051 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -531,9 +531,13 @@ enum { /* also needed for base!!!!! or rather, they interfere....*/ /* base->flag and ob->flag */ -#define BA_WAS_SEL (1 << 1) -#define BA_HAS_RECALC_OB (1 << 2) -#define BA_HAS_RECALC_DATA (1 << 3) +enum { + BA_WAS_SEL = (1 << 1), + /* NOTE: BA_HAS_RECALC_DATA can be re-used later if freed in readfile.c. */ + // BA_HAS_RECALC_OB = (1 << 2), /* DEPRECATED */ + // BA_HAS_RECALC_DATA = (1 << 3), /* DEPRECATED */ + BA_SNAP_FIX_DEPS_FIASCO = (1 << 2), /* Yes, re-use deprecated bit, all fine since it's runtime only. */ +}; /* NOTE: this was used as a proper setting in past, so nullify before using */ #define BA_TEMP_TAG (1 << 5) |