[Bf-blender-cvs] [0625a10efbe] master: Fix T61787: Duplicating a collection instance does not duplicate the dupli_group.

Bastien Montagne noreply at git.blender.org
Thu Feb 21 15:40:33 CET 2019


Commit: 0625a10efbe4e2a61fbfcf79dbf42ae399798aea
Author: Bastien Montagne
Date:   Thu Feb 21 15:37:28 2019 +0100
Branches: master
https://developer.blender.org/rB0625a10efbe4e2a61fbfcf79dbf42ae399798aea

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... ;)

===================================================================

M	source/blender/editors/transform/transform_conversions.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list