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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-02-21 17:37:28 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-02-21 17:40:17 +0300
commit0625a10efbe4e2a61fbfcf79dbf42ae399798aea (patch)
tree60abe440400497db5060b3d5389c864581399abe /source/blender/editors/transform/transform_conversions.c
parent3b88e301816da7626af928cc6ab14af2ecfdbd22 (diff)
Fix T61787: Duplicating a collection instance does not duplicate the dupli_group.
Transfomr init code called just after duplication (presumably before regular depsgraph update is executed) would erase new objects' transflags. This is more like a hack than a real fix, but since that transform piece of code is already a hack... Other solution would have been to force DEG to run after object duplication, think it's better to go with that solution for now. Not to mention to fact that dupli flags are put into transflag... ;)
Diffstat (limited to 'source/blender/editors/transform/transform_conversions.c')
-rw-r--r--source/blender/editors/transform/transform_conversions.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index b67e4954064..0c6377fea0a 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -5801,7 +5801,10 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
/* Copy newly evaluated fields to the original object, similar to how
* active dependency graph will do it. */
copy_m4_m4(ob->obmat, object_eval->obmat);
- ob->transflag = object_eval->transflag;
+ /* Hack over hack, looks like in some cases eval object has not yet been fully flushed or so?
+ * In some cases, macro operators starting transform just after creating a new object (OBJECT_OT_duplicate),
+ * if dupli flags are not protected, they can be erased here (see T61787). */
+ ob->transflag = (object_eval->transflag & ~(OB_DUPLI | OB_DUPLIFACES_SCALE | OB_DUPLIROT));
td->ob = ob;