Fix #35653: manual texture space location and size not working in cycles viewport.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 10 Jun 2013 13:01:41 +0000 (13:01 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 10 Jun 2013 13:01:41 +0000 (13:01 +0000)
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/editors/transform/transform_generics.c

index 5730fd26bcc68ca8e8d8dc0949b81d3d13bcd968..fc226288f04e79cbf0b760a78d59f45512a7fc0b 100644 (file)
@@ -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 */
index 6b0139aa8d9ceb6f9c1f094f1bc8229e6e3cd817..9e075c9e8e090a329aec769f877df7c5843d5d40 100644 (file)
@@ -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);
                }
        }
 }