diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-11-28 20:14:40 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-11-28 20:16:48 +0300 |
commit | 98ecab1af07a6f8f31b7889d1da92593deb87ae2 (patch) | |
tree | 81c011aea4d84294cef38ff80c701b16d2946178 /source | |
parent | 6d2da3950e9df9b613c4f57ad5141fdfcbd84686 (diff) |
Fix T56906: Mesh from Curve not working on curves beveled by curves.
Not exactly sure why we did not have cached displist for bevel object
here... But anyway, that conversion operation should really happen
outside of depsgraph evaluation area, so makes sense to do it as when
generating geometry for rendering, imho. Also solves issues like loosing
hidden parts of the curve/surface, etc. Still using viewport resolution
for curves, though.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_displist.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 9 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/effect.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object_update.c | 2 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 5 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 2 |
8 files changed, 16 insertions, 11 deletions
diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h index 02c86642b11..e6b08a8a063 100644 --- a/source/blender/blenkernel/BKE_displist.h +++ b/source/blender/blenkernel/BKE_displist.h @@ -91,7 +91,8 @@ void BKE_displist_make_surf( struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct Mesh **r_final, const bool for_render, const bool for_orco, const bool use_render_resolution); void BKE_displist_make_curveTypes( - struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, const bool for_orco); + struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, + const bool for_render, const bool for_orco); void BKE_displist_make_curveTypes_forRender( struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct ListBase *dispbase, struct Mesh **r_final, const bool for_orco, const bool use_render_resolution); diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 8d49521831f..182c3204ccb 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -694,7 +694,7 @@ static float displist_calc_taper(Depsgraph *depsgraph, Scene *scene, Object *tap dl = taperobj->runtime.curve_cache ? taperobj->runtime.curve_cache->disp.first : NULL; if (dl == NULL) { - BKE_displist_make_curveTypes(depsgraph, scene, taperobj, 0); + BKE_displist_make_curveTypes(depsgraph, scene, taperobj, false, false); dl = taperobj->runtime.curve_cache->disp.first; } if (dl) { @@ -1578,7 +1578,7 @@ static void do_makeDispListCurveTypes( if (!for_orco) curve_calc_modifiers_pre(depsgraph, scene, ob, &nubase, for_render, use_render_resolution); - BKE_curve_bevelList_make(ob, &nubase, for_render != false); + BKE_curve_bevelList_make(ob, &nubase, use_render_resolution); /* If curve has no bevel will return nothing */ BKE_curve_bevel_make(depsgraph, scene, ob, &dlbev, for_render, use_render_resolution); @@ -1788,7 +1788,8 @@ static void do_makeDispListCurveTypes( } } -void BKE_displist_make_curveTypes(Depsgraph *depsgraph, Scene *scene, Object *ob, const bool for_orco) +void BKE_displist_make_curveTypes( + Depsgraph *depsgraph, Scene *scene, Object *ob, const bool for_render, const bool for_orco) { ListBase *dispbase; @@ -1806,7 +1807,7 @@ void BKE_displist_make_curveTypes(Depsgraph *depsgraph, Scene *scene, Object *ob dispbase = &(ob->runtime.curve_cache->disp); - do_makeDispListCurveTypes(depsgraph, scene, ob, dispbase, &ob->runtime.mesh_eval, 0, for_orco, 0); + do_makeDispListCurveTypes(depsgraph, scene, ob, dispbase, &ob->runtime.mesh_eval, for_render, for_orco, false); boundbox_displist_object(ob); } diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 7c86c0722dc..f54082de153 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -168,7 +168,7 @@ static void precalculate_effector(struct Depsgraph *depsgraph, EffectorCache *ef Curve *cu = eff->ob->data; if (cu->flag & CU_PATH) { if (eff->ob->runtime.curve_cache == NULL || eff->ob->runtime.curve_cache->path == NULL || eff->ob->runtime.curve_cache->path->data == NULL) - BKE_displist_make_curveTypes(depsgraph, eff->scene, eff->ob, 0); + BKE_displist_make_curveTypes(depsgraph, eff->scene, eff->ob, false, false); if (eff->ob->runtime.curve_cache->path && eff->ob->runtime.curve_cache->path->data) { where_on_path(eff->ob, 0.0, eff->guide_loc, eff->guide_dir, NULL, &eff->guide_radius, NULL); diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index f88747908b0..2ac4c739e09 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -225,7 +225,7 @@ void BKE_object_handle_data_update( case OB_CURVE: case OB_SURF: case OB_FONT: - BKE_displist_make_curveTypes(depsgraph, scene, ob, 0); + BKE_displist_make_curveTypes(depsgraph, scene, ob, false, false); break; case OB_LATTICE: diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 8a8046d5c38..8ec79ff50a9 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -6658,7 +6658,7 @@ static int match_texture_space_exec(bContext *C, wmOperator *UNUSED(op)) int a; if (object->runtime.curve_cache == NULL) { - BKE_displist_make_curveTypes(depsgraph, scene, object, false); + BKE_displist_make_curveTypes(depsgraph, scene, object, false, false); } INIT_MINMAX(min, max); diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 50f36d7af47..8abef6f6793 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1723,9 +1723,12 @@ static void convert_ensure_curve_cache(Depsgraph *depsgraph, Scene *scene, Objec if (ob->runtime.curve_cache == NULL) { /* Force creation. This is normally not needed but on operator * redo we might end up with an object which isn't evaluated yet. + * Also happens in case we are working on a copy of the object (all its caches have been nuked then). */ if (ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT)) { - BKE_displist_make_curveTypes(depsgraph, scene, ob, false); + /* We need 'for render' ON here, to enable computing bevel dipslist if needed. + * Also makes sense anyway, we would not want e.g. to loose hidden parts etc. */ + BKE_displist_make_curveTypes(depsgraph, scene, ob, true, false); } else if (ob->type == OB_MBALL) { BKE_displist_make_mball(depsgraph, scene, ob); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index c4385f9896d..7923e300377 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -112,7 +112,7 @@ static void object_force_modifier_update_for_bind(Depsgraph *depsgraph, Scene *s BKE_displist_make_mball(depsgraph, scene, ob); } else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { - BKE_displist_make_curveTypes(depsgraph, scene, ob, 0); + BKE_displist_make_curveTypes(depsgraph, scene, ob, false, false); } } diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 352597c603d..da92b9e41be 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -631,7 +631,7 @@ bool ED_object_parent_set(ReportList *reports, const bContext *C, Scene *scene, if ((cu->flag & CU_PATH) == 0) { cu->flag |= CU_PATH | CU_FOLLOW; - BKE_displist_make_curveTypes(depsgraph, scene, par, 0); /* force creation of path data */ + BKE_displist_make_curveTypes(depsgraph, scene, par, false, false); /* force creation of path data */ } else { cu->flag |= CU_FOLLOW; |