Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 29 Nov 2017 14:47:00 +0000 (15:47 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 29 Nov 2017 14:47:00 +0000 (15:47 +0100)
1  2 
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/intern/object_update.c
source/blender/editors/transform/transform_snap.c

index 311255456702f86c4b585c1db677943a1eb4e034,2772b3e2e6b4ea0100648ddaf0120af5a9f262f2..e446451d9999b0e3a630748d4eb62b5c1cead0aa
@@@ -205,27 -200,19 +205,32 @@@ void BKE_object_eval_cloth(const struc
                             struct Scene *scene,
                             struct Object *object);
  
 -
+ void BKE_object_eval_transform_all(struct EvaluationContext *eval_ctx,
+                                    struct Scene *scene,
+                                    struct Object *object);
 -void BKE_object_handle_data_update(struct EvaluationContext *eval_ctx,
 -                                   struct Scene *scene,
 -                                   struct Object *ob);
 -void BKE_object_handle_update(struct EvaluationContext *eval_ctx, struct Scene *scene, struct Object *ob);
 -void BKE_object_handle_update_ex(struct EvaluationContext *eval_ctx,
 -                                 struct Scene *scene, struct Object *ob,
 -                                 struct RigidBodyWorld *rbw,
 -                                 const bool do_proxy_update);
 +void BKE_object_eval_update_shading(const struct EvaluationContext *eval_ctx,
 +                                    struct Object *object);
 +void BKE_object_data_select_update(const struct EvaluationContext *eval_ctx,
 +                                   struct ID *object_data);
 +
 +void BKE_object_eval_flush_base_flags(const struct EvaluationContext *eval_ctx,
 +                                      struct Object *object, struct Base *base,
 +                                      const bool is_from_set);
 +
 +void BKE_object_handle_data_update(
 +        const struct EvaluationContext *eval_ctx,
 +        struct Scene *scene,
 +        struct Object *ob);
 +void BKE_object_handle_update(
 +        const struct EvaluationContext *eval_ctx,
 +        struct Scene *scene, struct Object *ob);
 +void BKE_object_handle_update_ex(
 +        const struct EvaluationContext *eval_ctx,
 +        struct Scene *scene, struct Object *ob,
 +        struct RigidBodyWorld *rbw,
 +        const bool do_proxy_update);
++
  void BKE_object_sculpt_modifiers_changed(struct Object *ob);
  
  int BKE_object_obdata_texspace_get(struct Object *ob, short **r_texflag, float **r_loc, float **r_size, float **r_rot);
index 1e8de416ea91ad1439cf95665a2d78a9aa2000c5,fd2b5ff589f3786a18cef8a91a0fb1d673ee3e7c..4d2cf0c5dc61cbb2603944afb858fdbb59cb5362
@@@ -391,50 -343,18 +391,66 @@@ void BKE_object_eval_cloth(const Evalua
        BKE_ptcache_object_reset(scene, object, PTCACHE_RESET_DEPSGRAPH);
  }
  
+ void BKE_object_eval_transform_all(EvaluationContext *eval_ctx,
+                                    Scene *scene,
+                                    Object *object)
+ {
+       /* This mimics full transform update chain from new depsgraph. */
+       BKE_object_eval_local_transform(eval_ctx, scene, object);
+       if (object->parent != NULL) {
+               BKE_object_eval_parent(eval_ctx, scene, object);
+       }
+       if (!BLI_listbase_is_empty(&object->constraints)) {
+               BKE_object_eval_constraints(eval_ctx, scene, object);
+       }
+       BKE_object_eval_uber_transform(eval_ctx, scene, object);
+       BKE_object_eval_done(eval_ctx, object);
+ }
++
 +void BKE_object_eval_update_shading(const EvaluationContext *UNUSED(eval_ctx),
 +                                    Object *object)
 +{
 +      DEBUG_PRINT("%s on %s (%p)\n", __func__, object->id.name, object);
 +      if (object->type == OB_MESH) {
 +              BKE_mesh_batch_cache_dirty(object->data, BKE_MESH_BATCH_DIRTY_SHADING);
 +      }
 +}
 +
 +void BKE_object_data_select_update(const EvaluationContext *UNUSED(eval_ctx),
 +                                   struct ID *object_data)
 +{
 +      DEBUG_PRINT("%s on %s (%p)\n", __func__, object_data->name, object_data);
 +      switch (GS(object_data->name)) {
 +              case ID_ME:
 +                      BKE_mesh_batch_cache_dirty((Mesh *)object_data,
 +                                                 BKE_CURVE_BATCH_DIRTY_SELECT);
 +                      break;
 +              case ID_CU:
 +                      BKE_curve_batch_cache_dirty((Curve *)object_data,
 +                                                  BKE_CURVE_BATCH_DIRTY_SELECT);
 +                      break;
 +              case ID_LT:
 +                      BKE_lattice_batch_cache_dirty((struct Lattice *)object_data,
 +                                                    BKE_CURVE_BATCH_DIRTY_SELECT);
 +                      break;
 +              default:
 +                      break;
 +      }
 +}
 +
 +void BKE_object_eval_flush_base_flags(const EvaluationContext *UNUSED(eval_ctx),
 +                                      Object *object, Base *base, bool is_from_set)
 +{
 +      DEBUG_PRINT("%s on %s (%p)\n", __func__, object->id.name, object);
 +      /* Make sure we have the base collection settings is already populated.
 +       * This will fail when BKE_layer_eval_layer_collection_pre hasn't run yet
 +       * Which usually means a missing call to DEG_id_tag_update(). */
 +      BLI_assert(!BLI_listbase_is_empty(&base->collection_properties->data.group));
 +      /* Copy flags and settings from base. */
 +      object->base_flag = base->flag;
 +      if (is_from_set) {
 +              object->base_flag |= BASE_FROM_SET;
 +              object->base_flag &= ~(BASE_SELECTED | BASE_SELECTABLED);
 +      }
 +      object->base_collection_properties = base->collection_properties;
 +}