[Bf-blender-cvs] [068ee2c] master: Fix T47754: Meshes glitch on cycling Viewport Shading mode with Linked Groups

Sergey Sharybin noreply at git.blender.org
Tue Apr 12 17:16:48 CEST 2016


Commit: 068ee2cd98fc987453cd50285c387c6480c6d99c
Author: Sergey Sharybin
Date:   Tue Apr 12 17:14:13 2016 +0200
Branches: master
https://developer.blender.org/rB068ee2cd98fc987453cd50285c387c6480c6d99c

Fix T47754: Meshes glitch on cycling Viewport Shading mode with Linked Groups

This is a regression since 4310128 which is cased by really bad logic:
there might be dependencies between dupli-objects, which means _if_ we
really want to ensure derived mesh on dupli creation we have to do it
before any matrix is overwritten.

I'm not sure if such derived mesh trick is really the only way to go
without major refactor, but seems simple fix for now will do it.

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

M	source/blender/blenkernel/intern/object_dupli.c

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

diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index 7f742de..63c37fd 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -1253,15 +1253,16 @@ DupliApplyData *duplilist_apply(Object *ob, Scene *scene, ListBase *duplilist)
 		                                "DupliObject apply extra data");
 
 		for (dob = duplilist->first, i = 0; dob; dob = dob->next, ++i) {
-			/* copy obmat from duplis */
-			copy_m4_m4(apply_data->extra[i].obmat, dob->ob->obmat);
-
 			/* make sure derivedmesh is calculated once, before drawing */
 			if (scene && !(dob->ob->transflag & OB_DUPLICALCDERIVED) && dob->ob->type == OB_MESH) {
 				mesh_get_derived_final(scene, dob->ob, scene->customdata_mask);
 				dob->ob->transflag |= OB_DUPLICALCDERIVED;
 			}
+		}
 
+		for (dob = duplilist->first, i = 0; dob; dob = dob->next, ++i) {
+			/* copy obmat from duplis */
+			copy_m4_m4(apply_data->extra[i].obmat, dob->ob->obmat);
 			copy_m4_m4(dob->ob->obmat, dob->mat);
 			
 			/* copy layers from the main duplicator object */




More information about the Bf-blender-cvs mailing list