Fix #35653: manual texture space location and size not working in cycles viewport.

This commit is contained in:
Brecht Van Lommel 2013-06-10 13:01:41 +00:00
parent 4a8f71fc1d
commit 88ab28dc5f
2 changed files with 13 additions and 0 deletions

@ -484,6 +484,8 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob, CustomDataMask mask)
Mesh tmp = *me;
int totvert, totedge /*, totface */ /* UNUSED */, totloop, totpoly;
int did_shapekeys = 0;
float *texloc, *texrot, *texsize;
short *texflag;
CustomData_reset(&tmp.vdata);
CustomData_reset(&tmp.edata);
@ -529,6 +531,14 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob, CustomDataMask mask)
shapekey_layers_to_keyblocks(dm, me, uid);
did_shapekeys = 1;
}
/* copy texture space */
if (BKE_object_obdata_texspace_get(ob, &texflag, &texloc, &texsize, &texrot)) {
tmp.texflag = *texflag;
copy_v3_v3(tmp.loc, texloc);
copy_v3_v3(tmp.size, texsize);
copy_v3_v3(tmp.rot, texrot);
}
/* not all DerivedMeshes store their verts/edges/faces in CustomData, so
* we set them here in case they are missing */

@ -908,6 +908,9 @@ static void recalcData_view3d(TransInfo *t)
* otherwise proxies don't function correctly
*/
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
if(t->flag & T_TEXTURE)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
}
}