Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 31 May 2018 10:57:24 +0000 (12:57 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 31 May 2018 10:57:24 +0000 (12:57 +0200)
 Conflicts:
source/blender/blenkernel/BKE_camera.h
source/blender/blenkernel/BKE_dynamicpaint.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/intern/camera.c
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/smoke.c
source/blender/editors/object/object_transform.c
source/blender/editors/physics/dynamicpaint_ops.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/modifiers/intern/MOD_dynamicpaint.c
source/blenderplayer/bad_level_call_stubs/stubs.c

1  2 
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/smoke.c
source/blender/editors/include/ED_object.h
source/blender/editors/object/object_constraint.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/makesrna/intern/rna_constraint.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_pose.c

@@@ -552,73 -529,7 +552,73 @@@ bool BKE_object_is_in_wpaint_select_ver
        return false;
  }
  
- bool BKE_object_exists_check(const Object *obtest)
 +bool BKE_object_has_mode_data(const struct Object *ob, eObjectMode object_mode)
 +{
 +      if (object_mode & OB_MODE_EDIT) {
 +              if (BKE_object_is_in_editmode(ob)) {
 +                      return true;
 +              }
 +      }
 +      else if (object_mode & OB_MODE_VERTEX_PAINT) {
 +              if (ob->sculpt && (ob->sculpt->mode_type == OB_MODE_VERTEX_PAINT)) {
 +                      return true;
 +              }
 +      }
 +      else if (object_mode & OB_MODE_WEIGHT_PAINT) {
 +              if (ob->sculpt && (ob->sculpt->mode_type == OB_MODE_WEIGHT_PAINT)) {
 +                      return true;
 +              }
 +      }
 +      else if (object_mode & OB_MODE_SCULPT) {
 +              if (ob->sculpt && (ob->sculpt->mode_type == OB_MODE_SCULPT)) {
 +                      return true;
 +              }
 +      }
 +      else if (object_mode & OB_MODE_POSE) {
 +              if (ob->pose != NULL) {
 +                      return true;
 +              }
 +      }
 +      return false;
 +}
 +
 +bool BKE_object_is_mode_compat(const struct Object *ob, eObjectMode object_mode)
 +{
 +      return ((ob->mode == object_mode) ||
 +              (ob->mode & object_mode) != 0);
 +}
 +
 +/**
 + * Return if the object is visible, as evaluated by depsgraph
 + */
 +bool BKE_object_is_visible(Object *ob, const eObjectVisibilityCheck mode)
 +{
 +      if ((ob->base_flag & BASE_VISIBLED) == 0) {
 +              return false;
 +      }
 +
 +      if (mode == OB_VISIBILITY_CHECK_UNKNOWN_RENDER_MODE) {
 +              return true;
 +      }
 +
 +      if (((ob->transflag & OB_DUPLI) == 0) &&
 +          (ob->particlesystem.first == NULL))
 +      {
 +              return true;
 +      }
 +
 +      switch (mode) {
 +              case OB_VISIBILITY_CHECK_FOR_VIEWPORT:
 +                      return ((ob->duplicator_visibility_flag & OB_DUPLI_FLAG_VIEWPORT) != 0);
 +              case OB_VISIBILITY_CHECK_FOR_RENDER:
 +                      return ((ob->duplicator_visibility_flag & OB_DUPLI_FLAG_RENDER) != 0);
 +              default:
 +                      BLI_assert(!"Object visible test mode not supported.");
 +                      return false;
 +      }
 +}
 +
+ bool BKE_object_exists_check(Main *bmain, const Object *obtest)
  {
        Object *ob;
        
  #include "BKE_constraint.h"
  #include "BKE_customdata.h"
  #include "BKE_deform.h"
 -#include "BKE_depsgraph.h"
  #include "BKE_DerivedMesh.h"
  #include "BKE_effect.h"
+ #include "BKE_global.h"
  #include "BKE_main.h"
  #include "BKE_modifier.h"
  #include "BKE_object.h"
@@@ -1202,12 -1195,12 +1204,12 @@@ void ED_object_constraint_update(Main *
  {
        if (ob->pose) BKE_pose_update_constraint_flags(ob->pose);
  
-       object_test_constraints(ob);
+       object_test_constraints(bmain, ob);
  
        if (ob->type == OB_ARMATURE) 
 -              DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
 +              DEG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
        else 
 -              DAG_id_tag_update(&ob->id, OB_RECALC_OB);
 +              DEG_id_tag_update(&ob->id, OB_RECALC_OB);
  }
  
  static void object_pose_tag_update(Main *bmain, Object *ob)
@@@ -1230,26 -1223,21 +1232,26 @@@ void ED_object_constraint_dependency_up
        if (ob->pose) {
                object_pose_tag_update(bmain, ob);
        }
 -      DAG_relations_tag_update(bmain);
 +      DEG_relations_tag_update(bmain);
  }
  
- void ED_object_constraint_tag_update(Object *ob, bConstraint *con)
+ void ED_object_constraint_tag_update(Main *bmain, Object *ob, bConstraint *con)
  {
        if (ob->pose) {
                BKE_pose_tag_update_constraint_flags(ob->pose);
        }
  
-       object_test_constraint(ob, con);
+       object_test_constraint(bmain, ob, con);
  
        if (ob->type == OB_ARMATURE)
 -              DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
 +              DEG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
        else
 -              DAG_id_tag_update(&ob->id, OB_RECALC_OB);
 +              DEG_id_tag_update(&ob->id, OB_RECALC_OB);
 +
 +      /* Do Copy-on-Write tag here too, otherwise constraint
 +       * influence/mute buttons in UI have no effect
 +       */
 +      DEG_id_tag_update(&ob->id, DEG_TAG_COPY_ON_WRITE);
  }
  
  void ED_object_constraint_dependency_tag_update(Main *bmain, Object *ob, bConstraint *con)
@@@ -1280,10 -1269,10 +1283,10 @@@ static int constraint_delete_exec(bCont
        if (BKE_constraint_remove_ex(lb, ob, con, true)) {
                /* there's no active constraint now, so make sure this is the case */
                BKE_constraints_active_set(&ob->constraints, NULL);
-               ED_object_constraint_update(ob); /* needed to set the flags on posebones correctly */
+               ED_object_constraint_update(bmain, ob); /* needed to set the flags on posebones correctly */
  
                /* relatiols */
 -              DAG_relations_tag_update(CTX_data_main(C));
 +              DEG_relations_tag_update(CTX_data_main(C));
  
                /* notifiers */
                WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, ob);
  #include "BLI_utildefines.h"
  
  #include "BKE_armature.h"
 +#include "BKE_camera.h"
  #include "BKE_context.h"
  #include "BKE_font.h"
 +#include "BKE_layer.h"
  #include "BKE_library.h"
+ #include "BKE_main.h"
  #include "BKE_object.h"
  #include "BKE_paint.h"
  #include "BKE_report.h"
@@@ -242,9 -237,9 +242,9 @@@ static void rna_Pose_ik_solver_update(M
        
        BKE_pose_update_constraint_flags(pose);
        
-       object_test_constraints(ob);
+       object_test_constraints(bmain, ob);
  
 -      DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
 +      DEG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
  }
  
  /* rotation - axis-angle */