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.
This commit is contained in:
Sergey Sharybin 2016-04-12 17:14:13 +02:00
parent 3a977ff502
commit 068ee2cd98
Notes: blender-bot 2023-02-14 08:06:40 +01:00
Referenced by issue #47754, Meshes glitch on cycling Viewport Shading mode with Linked Groups and
1 changed files with 4 additions and 3 deletions

View File

@ -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 */