Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/displist.cc')
-rw-r--r--source/blender/blenkernel/intern/displist.cc45
1 files changed, 5 insertions, 40 deletions
diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc
index 0bf436aa8b2..edf043de63f 100644
--- a/source/blender/blenkernel/intern/displist.cc
+++ b/source/blender/blenkernel/intern/displist.cc
@@ -66,8 +66,6 @@
using blender::IndexRange;
-static void boundbox_displist_object(Object *ob);
-
static void displist_elem_free(DispList *dl)
{
if (dl) {
@@ -404,12 +402,6 @@ static void curve_to_displist(const Curve *cu,
}
}
-/**
- * \param normal_proj: Optional normal that's used to project the scanfill verts into 2d coords.
- * Pass this along if known since it saves time calculating the normal.
- * This is also used to initialize #DispList.nors (one normal per display list).
- * \param flipnormal: Flip the normal (same as passing \a normal_proj negated)
- */
void BKE_displist_fill(const ListBase *dispbase,
ListBase *to,
const float normal_proj[3],
@@ -832,7 +824,7 @@ static bool do_curve_implicit_mesh_conversion(const Curve *curve,
}
/* Curve objects with implicit "tube" meshes should convert implicitly to a mesh. */
- if (curve->ext1 != 0.0f || curve->ext2 != 0.0f) {
+ if (curve->extrude != 0.0f || curve->bevel_radius != 0.0f) {
return true;
}
@@ -1312,11 +1304,11 @@ static GeometrySet evaluate_curve_type_object(Depsgraph *depsgraph,
ListBase dlbev = BKE_curve_bevel_make(cu);
/* no bevel or extrude, and no width correction? */
- if (BLI_listbase_is_empty(&dlbev) && cu->width == 1.0f) {
+ if (BLI_listbase_is_empty(&dlbev) && cu->offset == 1.0f) {
curve_to_displist(cu, deformed_nurbs, for_render, r_dispbase);
}
else {
- const float widfac = cu->width - 1.0f;
+ const float widfac = cu->offset - 1.0f;
const BevList *bl = (BevList *)ob->runtime.curve_cache->bev.first;
const Nurb *nu = (Nurb *)deformed_nurbs->first;
@@ -1528,7 +1520,7 @@ void BKE_displist_make_curveTypes(Depsgraph *depsgraph,
ob->runtime.geometry_set_eval = new GeometrySet(std::move(geometry));
}
- boundbox_displist_object(ob);
+ BKE_object_boundbox_calc_from_evaluated_geometry(ob);
}
void BKE_displist_minmax(const ListBase *dispbase, float min[3], float max[3])
@@ -1536,7 +1528,7 @@ void BKE_displist_minmax(const ListBase *dispbase, float min[3], float max[3])
bool doit = false;
LISTBASE_FOREACH (const DispList *, dl, dispbase) {
- const int tot = (dl->type == DL_INDEX3) ? dl->nr : dl->nr * dl->parts;
+ const int tot = (ELEM(dl->type, DL_INDEX3, DL_INDEX4)) ? dl->nr : dl->nr * dl->parts;
for (const int i : IndexRange(tot)) {
minmax_v3v3_v3(min, max, &dl->verts[i * 3]);
}
@@ -1551,30 +1543,3 @@ void BKE_displist_minmax(const ListBase *dispbase, float min[3], float max[3])
zero_v3(max);
}
}
-
-/* this is confusing, there's also min_max_object, applying the obmat... */
-static void boundbox_displist_object(Object *ob)
-{
- BLI_assert(ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT));
- /* Curve's BB is already calculated as a part of modifier stack,
- * here we only calculate object BB based on final display list. */
-
- /* object's BB is calculated from final displist */
- if (ob->runtime.bb == nullptr) {
- ob->runtime.bb = (BoundBox *)MEM_callocN(sizeof(BoundBox), __func__);
- }
-
- const Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob);
- if (mesh_eval) {
- BKE_object_boundbox_calc_from_mesh(ob, mesh_eval);
- }
- else {
- float min[3], max[3];
-
- INIT_MINMAX(min, max);
- BKE_displist_minmax(&ob->runtime.curve_cache->disp, min, max);
- BKE_boundbox_init_from_minmax(ob->runtime.bb, min, max);
-
- ob->runtime.bb->flag &= ~BOUNDBOX_DIRTY;
- }
-}