Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 30 Nov 2017 14:11:06 +0000 (15:11 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 30 Nov 2017 14:11:06 +0000 (15:11 +0100)
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_snap_object.c
source/blender/makesdna/DNA_object_types.h

index d2c48c4aea00a03df600a04d4a423a1f87186815..5e8c2e2c09acd7e6bf4db049b86b47a561a7b906 100644 (file)
@@ -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);
        }
 }
 
index d92417ec68ac7db6a97f291efb7fc2a47d3810ba..ce8de2ef4d3645d4cce426e0a1719ca9f271d408 100644 (file)
@@ -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)))
                {
index e39c6c378145b9860c7bd05561090c172e0b0a78..070d34ef051d6c972120059c7dedc3070d3ac42f 100644 (file)
@@ -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)