Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Tue, 7 Jun 2016 07:58:27 +0000 (09:58 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 7 Jun 2016 07:59:26 +0000 (09:59 +0200)
Conflicts:
source/blender/blenkernel/intern/particle.c
source/blender/editors/transform/transform_snap_object.c

26 files changed:
1  2 
intern/cycles/blender/addon/ui.py
release/scripts/startup/bl_ui/__init__.py
release/scripts/startup/bl_ui/properties_data_modifier.py
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/idcode.c
source/blender/blenkernel/intern/object_update.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/versioning_270.c
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
source/blender/editors/include/ED_physics.h
source/blender/editors/object/object_add.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/transform/transform_snap.c
source/blender/editors/transform/transform_snap_object.c
source/blender/gpu/intern/gpu_buffers.c
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_modifier_types.h
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/modifiers/intern/MOD_shapekey.c
source/blenderplayer/bad_level_call_stubs/stubs.c

Simple merge
@@@ -487,9 -563,12 +487,11 @@@ int closest_point_on_surface(SurfaceMod
  }
  int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *point, int real_velocity)
  {
 -      float cfra = eff->scene->r.cfra;
        int ret = 0;
  
-       if (eff->pd && eff->pd->shape==PFIELD_SHAPE_SURFACE && eff->surmd) {
+       /* In case surface object is in Edit mode when loading the .blend, surface modifier is never executed
+        * and bvhtree never built, see T48415. */
+       if (eff->pd && eff->pd->shape==PFIELD_SHAPE_SURFACE && eff->surmd && eff->surmd->bvhtree) {
                /* closest point in the object surface is an effector */
                float vec[3];
  
@@@ -39,13 -39,18 +39,13 @@@ struct wmKeyConfig
  struct Scene;
  struct Object;
  
 -/* particle_edit.c */
 -int PE_poll(struct bContext *C);
 -int PE_hair_poll(struct bContext *C);
 -int PE_poll_view3d(struct bContext *C);
 -
  /* rigidbody_object.c */
- bool ED_rigidbody_object_add(struct Scene *scene, struct Object *ob, int type, struct ReportList *reports);
- void ED_rigidbody_object_remove(struct Scene *scene, struct Object *ob);
+ bool ED_rigidbody_object_add(struct Main *bmain, struct Scene *scene, struct Object *ob, int type, struct ReportList *reports);
+ void ED_rigidbody_object_remove(struct Main *bmain, struct Scene *scene, struct Object *ob);
  
  /* rigidbody_constraint.c */
- bool ED_rigidbody_constraint_add(struct Scene *scene, struct Object *ob, int type, struct ReportList *reports);
- void ED_rigidbody_constraint_remove(struct Scene *scene, struct Object *ob);
+ bool ED_rigidbody_constraint_add(struct Main *bmain, struct Scene *scene, struct Object *ob, int type, struct ReportList *reports);
+ void ED_rigidbody_constraint_remove(struct Main *bmain, struct Scene *scene, struct Object *ob);
  
  /* operators */
  void ED_operatortypes_physics(void);
@@@ -551,12 -553,18 +551,12 @@@ static void initSnappingMode(TransInfo 
                {
                        /* Exclude editmesh if using proportional edit */
                        if ((obedit->type == OB_MESH) && (t->flag & T_PROP_EDIT)) {
-                               t->tsnap.modeSelect = SNAP_NOT_OBEDIT;
+                               t->tsnap.modeSelect = SNAP_NOT_ACTIVE;
                        }
                        else {
-                               t->tsnap.modeSelect = t->tsnap.snap_self ? SNAP_ALL : SNAP_NOT_OBEDIT;
+                               t->tsnap.modeSelect = t->tsnap.snap_self ? SNAP_ALL : SNAP_NOT_ACTIVE;
                        }
                }
 -              /* Particles edit mode*/
 -              else if (t->tsnap.applySnap != NULL && // A snapping function actually exist
 -                       (obedit == NULL && base_act && base_act->object && base_act->object->mode & OB_MODE_PARTICLE_EDIT))
 -              {
 -                      t->tsnap.modeSelect = SNAP_ALL;
 -              }
                /* Object mode */
                else if (t->tsnap.applySnap != NULL && // A snapping function actually exist
                         (obedit == NULL) ) // Object Mode
@@@ -1326,22 -1323,38 +1323,23 @@@ static bool snapObjectsRay
          Object **r_ob, float r_obmat[4][4],
          ListBase *r_hit_list)
  {
-       Base *base;
        bool retval = false;
-       bool snap_obedit_first = snap_select == SNAP_ALL && obedit;
        unsigned int ob_index = 0;
 -
 -      /* 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.
 -       * */
+       Object *obedit = use_object_edit_cage ? sctx->scene->obedit : NULL;
 -      if (base_act && base_act->object && base_act->object->mode & OB_MODE_PARTICLE_EDIT) {
 -              Object *ob = base_act->object;
 -
 -              retval |= snapObject(
 -                      sctx, ob, ob->obmat, false, snap_to,
 -                      mval, dist_px, ob_index++,
 -                      ray_start, ray_normal, ray_origin, ray_depth,
 -                      r_loc, r_no, r_index, r_ob, r_obmat, r_hit_list);
 -      }
+       Base *base_act = sctx->scene->basact;
  
-       if (snap_obedit_first) {
-               Object *ob = obedit;
-               retval |= snapObject(
-                       sctx, ob, ob->obmat, true, snap_to,
-                       mval, dist_px, ob_index++,
-                       ray_start, ray_normal, ray_origin, ray_depth,
-                       r_loc, r_no, r_index, r_ob, r_obmat, r_hit_list);
+       bool ignore_object_selected = false, ignore_object_active = false;
+       switch (snap_select) {
+               case SNAP_ALL:
+                       break;
+               case SNAP_NOT_SELECTED:
+                       ignore_object_selected = true;
+                       break;
+               case SNAP_NOT_ACTIVE:
+                       ignore_object_active = true;
+                       break;
        }
-       for (base = sctx->scene->base.first; base != NULL; base = base->next) {
+       for (Base *base = sctx->scene->base.first; base != NULL; base = base->next) {
                if ((BASE_VISIBLE_BGMODE(sctx->v3d_data.v3d, sctx->scene, base)) &&
                    (base->flag & (BA_HAS_RECALC_OB | BA_HAS_RECALC_DATA)) == 0 &&
  
Simple merge