diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-01-10 21:37:17 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-01-10 21:37:17 +0400 |
commit | b39090bb5ab54a396128178923bf3caf543c3a33 (patch) | |
tree | e420636e4414d68edc3619cf91734a4c37876a5d /source/blender/makesrna/intern/rna_object_api.c | |
parent | 18536e201f26f20bde6379afa996153433404c65 (diff) |
Fix #33752: UV Orco coordinates were wrong for Cycles (and other external
render engines). Replaced generating orco_index by filling the UV loop data
directly which is easier and all that needed to be done anyway.
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index d7115256fe5..40b8d4cce66 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -129,9 +129,6 @@ static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int DerivedMesh *derivedFinal = NULL; int uv_from_orco; - int (*orco_index)[4] = NULL; - float (*orco)[3] = NULL; - /* copies object and modifiers (but not the data) */ tmpobj = BKE_object_copy_with_caches(ob); tmpcu = (Curve *)tmpobj->data; @@ -158,38 +155,12 @@ static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int tmpobj->derivedFinal = derivedFinal; - uv_from_orco = (tmpcu->flag & CU_UV_ORCO) != 0; - - if (uv_from_orco) { - /* before curve conversion */ - orco = (float (*)[3])BKE_curve_make_orco(sce, tmpobj); - } - /* convert object type to mesh */ - BKE_mesh_from_nurbs_displist(tmpobj, &dispbase, uv_from_orco ? (int **)&orco_index : NULL); + uv_from_orco = (tmpcu->flag & CU_UV_ORCO) != 0; + BKE_mesh_from_nurbs_displist(tmpobj, &dispbase, uv_from_orco); tmpmesh = tmpobj->data; - if (uv_from_orco && orco && orco_index) { - const char *uvname = "Orco"; - /* add UV's */ - MTexPoly *mtpoly = CustomData_add_layer_named(&tmpmesh->pdata, CD_MTEXPOLY, CD_DEFAULT, NULL, tmpmesh->totpoly, uvname); - MLoopUV *mloopuvs = CustomData_add_layer_named(&tmpmesh->ldata, CD_MLOOPUV, CD_DEFAULT, NULL, tmpmesh->totloop, uvname); - - BKE_mesh_nurbs_to_mdata_orco(tmpmesh->mpoly, tmpmesh->totpoly, - tmpmesh->mloop, mloopuvs, - orco, orco_index); - - (void)mtpoly; - } - - if (orco_index) { - MEM_freeN(orco_index); - } - if (orco) { - MEM_freeN(orco); - } - BKE_displist_free(&dispbase); /* BKE_mesh_from_nurbs changes the type to a mesh, check it worked */ |