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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-12-04 18:04:10 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-12-04 18:04:10 +0300
commitcf2e35fcfe31aa2c1836f51d1206901b4be6aeba (patch)
treebea7f3e6234470e70ab2aa45e6faae28b0f267a2 /source/blender/blenkernel
parente666ee965c63322531fba5203905e7d9ca567ed3 (diff)
Fix T58118: Make duplicates real does nothing
The issue was caused by transflag set in geometry evaluation never copied back top original object. Now we have a dedicated operation which does all sort copy back to original object, so we don't have to worry about atomic assignments or what gets set where. Still need to move boundbox to the same function, but it needs some careful doublechecking first.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_object.h5
-rw-r--r--source/blender/blenkernel/intern/object_update.c31
2 files changed, 21 insertions, 15 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 35de1501494..ff069bcbe79 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -247,7 +247,10 @@ void BKE_object_eval_uber_data(
struct Scene *scene,
struct Object *ob);
-void BKE_object_eval_boundbox(struct Depsgraph *depsgraph, struct Object *object);
+void BKE_object_eval_boundbox(struct Depsgraph *depsgraph,
+ struct Object *object);
+void BKE_object_synchronize_to_original(struct Depsgraph *depsgraph,
+ struct Object *object);
void BKE_object_eval_ptcache_reset(
struct Depsgraph *depsgraph,
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;