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/intern/object_update.c')
-rw-r--r--source/blender/blenkernel/intern/object_update.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index 2ac4c739e09..b95f1c821e2 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -142,14 +142,6 @@ void BKE_object_eval_transform_final(Depsgraph *depsgraph, Object *ob)
/* Set negative scale flag in object. */
if (is_negative_m4(ob->obmat)) ob->transflag |= OB_NEG_SCALE;
else ob->transflag &= ~OB_NEG_SCALE;
-
- if (DEG_is_active(depsgraph)) {
- Object *ob_orig = DEG_get_original_object(ob);
- copy_m4_m4(ob_orig->obmat, ob->obmat);
- copy_m4_m4(ob_orig->constinv, ob->constinv);
- ob_orig->transflag = ob->transflag;
- ob_orig->flag = ob->flag;
- }
}
void BKE_object_handle_data_update(
@@ -271,6 +263,8 @@ void BKE_object_handle_data_update(
BKE_object_eval_boundbox(depsgraph, ob);
}
+/* TODO(sergey): Ensure that bounding box is already calculated, and move this
+ * into BKE_object_synchronize_to_original(). */
void BKE_object_eval_boundbox(Depsgraph *depsgraph, Object *object)
{
if (!DEG_is_active(depsgraph)) {
@@ -286,6 +280,21 @@ void BKE_object_eval_boundbox(Depsgraph *depsgraph, Object *object)
}
}
+void BKE_object_synchronize_to_original(Depsgraph *depsgraph, Object *object)
+{
+ if (!DEG_is_active(depsgraph)) {
+ return;
+ }
+ Object *object_orig = DEG_get_original_object(object);
+ /* Base flags. */
+ object_orig->base_flag = object->base_flag;
+ /* Transformation flags. */
+ copy_m4_m4(object_orig->obmat, object->obmat);
+ copy_m4_m4(object_orig->constinv, object->constinv);
+ object_orig->transflag = object->transflag;
+ object_orig->flag = object->flag;
+}
+
bool BKE_object_eval_proxy_copy(Depsgraph *depsgraph,
Object *object)
{
@@ -430,12 +439,6 @@ void BKE_object_eval_flush_base_flags(Depsgraph *depsgraph,
}
object->base_local_view_bits = base->local_view_bits;
- /* Copy to original object datablock if needed. */
- if (DEG_is_active(depsgraph)) {
- Object *object_orig = DEG_get_original_object(object);
- object_orig->base_flag = object->base_flag;
- }
-
if (object->mode == OB_MODE_PARTICLE_EDIT) {
for (ParticleSystem *psys = object->particlesystem.first;
psys != NULL;