diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-14 21:30:49 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-14 21:30:49 +0400 |
commit | 8a9d1c0a795aad31c19cc3f0c70e2f53578f49dd (patch) | |
tree | d210ca241bcd97c9dd9d07a5a8bf5b8a5863d3f7 /source/blender/makesrna/intern/rna_object_api.c | |
parent | f67ee4ff00bcb651821fc5478a21456122d2fa43 (diff) |
Fix #31021: Render settings are not taken into account for curves
Refactored code a bit to make naming a bit more clear and added a
function to create mesh from given display list rather than from
object's displist.
Tested using plain curves (which doesn't imply using derived meshes)
and curves with constructive modifiers (which are using derived meshed).
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index a3e538da9b1..ae8c331bf1e 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -84,7 +84,9 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_ switch (ob->type) { case OB_FONT: case OB_CURVE: - case OB_SURF: + case OB_SURF: { + ListBase dispbase = {NULL, NULL}; + DerivedMesh *derivedFinal = NULL; /* copies object and modifiers (but not the data) */ tmpobj = BKE_object_copy(ob); @@ -105,12 +107,16 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_ copycu->editnurb = tmpcu->editnurb; /* get updated display list, and convert to a mesh */ - BKE_displist_make_curveTypes(sce, tmpobj, 0); + BKE_displist_make_curveTypes_forRender(sce, tmpobj, &dispbase, &derivedFinal, FALSE); copycu->editfont = NULL; copycu->editnurb = NULL; - BKE_mesh_from_nurbs(tmpobj); + tmpobj->derivedFinal = derivedFinal; + + BKE_mesh_from_nurbs_displist(tmpobj, &dispbase); + + BKE_displist_free(&dispbase); /* BKE_mesh_from_nurbs changes the type to a mesh, check it worked */ if (tmpobj->type != OB_MESH) { @@ -121,6 +127,7 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_ tmpmesh = tmpobj->data; BKE_libblock_free_us(&G.main->object, tmpobj); break; + } case OB_MBALL: { /* metaballs don't have modifiers, so just convert to mesh */ |