Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_object.h1
-rw-r--r--source/blender/blenkernel/intern/armature_update.c14
-rw-r--r--source/blender/blenkernel/intern/object_update.c22
3 files changed, 8 insertions, 29 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index cd253ca4bbc..32d99191067 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -288,7 +288,6 @@ void BKE_object_eval_uber_data(struct Depsgraph *depsgraph,
struct Object *ob);
void BKE_object_eval_assign_data(struct Object *object, struct ID *data, bool is_owned);
-void BKE_object_eval_boundbox(struct Depsgraph *depsgraph, struct Object *object);
void BKE_object_sync_to_original(struct Depsgraph *depsgraph, struct Object *object);
void BKE_object_eval_ptcache_reset(struct Depsgraph *depsgraph,
diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index de00372c3ec..8c666597276 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -830,18 +830,6 @@ void BKE_pose_splineik_evaluate(struct Depsgraph *depsgraph,
BKE_splineik_execute_tree(depsgraph, scene, object, rootchan, ctime);
}
-/* Common part for both original and proxy armatrues. */
-static void pose_eval_done_common(struct Depsgraph *depsgraph, Object *object)
-{
- const bArmature *armature = (bArmature *)object->data;
- if (armature->edbo != NULL) {
- return;
- }
- bPose *pose = object->pose;
- UNUSED_VARS_NDEBUG(pose);
- BLI_assert(pose != NULL);
- BKE_object_eval_boundbox(depsgraph, object);
-}
static void pose_eval_cleanup_common(Object *object)
{
bPose *pose = object->pose;
@@ -857,7 +845,6 @@ void BKE_pose_eval_done(struct Depsgraph *depsgraph, Object *object)
UNUSED_VARS_NDEBUG(pose);
DEG_debug_print_eval(depsgraph, __func__, object->id.name, object);
BLI_assert(object->type == OB_ARMATURE);
- pose_eval_done_common(depsgraph, object);
}
void BKE_pose_eval_cleanup(struct Depsgraph *depsgraph, Scene *scene, Object *object)
@@ -885,7 +872,6 @@ void BKE_pose_eval_proxy_done(struct Depsgraph *depsgraph, Object *object)
{
BLI_assert(ID_IS_LINKED(object) && object->proxy_from != NULL);
DEG_debug_print_eval(depsgraph, __func__, object->id.name, object);
- pose_eval_done_common(depsgraph, object);
}
void BKE_pose_eval_proxy_cleanup(struct Depsgraph *depsgraph, Object *object)
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index 1b4dc98252a..1d79f871fa2 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -268,25 +268,17 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *o
}
}
}
- BKE_object_eval_boundbox(depsgraph, ob);
}
-/**
- * TODO(sergey): Ensure that bounding box is already calculated, and move this
- * into #BKE_object_sync_to_original().
- */
-void BKE_object_eval_boundbox(Depsgraph *depsgraph, Object *object)
+/** Bounding box from evaluated geometry. */
+static void object_sync_boundbox_to_original(Object *object_orig, Object *object_eval)
{
- if (!DEG_is_active(depsgraph)) {
- return;
- }
- Object *ob_orig = DEG_get_original_object(object);
- BoundBox *bb = BKE_object_boundbox_get(object);
+ BoundBox *bb = BKE_object_boundbox_get(object_eval);
if (bb != NULL) {
- if (ob_orig->runtime.bb == NULL) {
- ob_orig->runtime.bb = MEM_mallocN(sizeof(*ob_orig->runtime.bb), __func__);
+ if (object_orig->runtime.bb == NULL) {
+ object_orig->runtime.bb = MEM_mallocN(sizeof(*object_orig->runtime.bb), __func__);
}
- *ob_orig->runtime.bb = *bb;
+ *object_orig->runtime.bb = *bb;
}
}
@@ -315,6 +307,8 @@ void BKE_object_sync_to_original(Depsgraph *depsgraph, Object *object)
md_orig->error = BLI_strdup(md->error);
}
}
+
+ object_sync_boundbox_to_original(object_orig, object);
}
bool BKE_object_eval_proxy_copy(Depsgraph *depsgraph, Object *object)