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:
authorHans Goudey <h.goudey@me.com>2021-06-28 23:14:43 +0300
committerHans Goudey <h.goudey@me.com>2021-06-28 23:14:43 +0300
commitd2e473a2dd488934c064c18f682750cac27c106f (patch)
treedb8dfa6ea72b7e5dbdff3cb99d6181deb87d5527 /source/blender/blenkernel/intern/displist.cc
parenta0c45a2d5416f780451a23830087a6e712d26ef1 (diff)
Cleanup: Remove unused "for_orco" argument to curve evaluation
`BKE_displist_make_curveTypes` had a `for_orco` argument that was always false in calls to the function. Removing it allows the curve displist and modifier evaluation code to become simpler. There are some related cleanups in rBdf4299465279 and rB93aecd2b8107.
Diffstat (limited to 'source/blender/blenkernel/intern/displist.cc')
-rw-r--r--source/blender/blenkernel/intern/displist.cc72
1 files changed, 25 insertions, 47 deletions
diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc
index 65251ac1807..6a57c5ad5a2 100644
--- a/source/blender/blenkernel/intern/displist.cc
+++ b/source/blender/blenkernel/intern/displist.cc
@@ -630,7 +630,7 @@ static float displist_calc_taper(Depsgraph *depsgraph,
(DispList *)taperobj->runtime.curve_cache->disp.first :
nullptr;
if (dl == nullptr) {
- BKE_displist_make_curveTypes(depsgraph, scene, taperobj, false, false);
+ BKE_displist_make_curveTypes(depsgraph, scene, taperobj, false);
dl = (DispList *)taperobj->runtime.curve_cache->disp.first;
}
if (dl) {
@@ -1097,8 +1097,7 @@ static void displist_make_surf(Depsgraph *depsgraph,
Object *ob,
ListBase *dispbase,
Mesh **r_final,
- const bool for_render,
- const bool for_orco)
+ const bool for_render)
{
ListBase nubase = {nullptr, nullptr};
const Curve *cu = (const Curve *)ob->data;
@@ -1110,11 +1109,8 @@ static void displist_make_surf(Depsgraph *depsgraph,
BKE_nurbList_duplicate(&nubase, &cu->nurb);
}
- bool force_mesh_conversion = false;
- if (!for_orco) {
- force_mesh_conversion = BKE_curve_calc_modifiers_pre(
- depsgraph, scene, ob, &nubase, &nubase, for_render);
- }
+ bool force_mesh_conversion = BKE_curve_calc_modifiers_pre(
+ depsgraph, scene, ob, &nubase, &nubase, for_render);
LISTBASE_FOREACH (Nurb *, nu, &nubase) {
if (!(for_render || nu->hide == 0) || !BKE_nurb_check_valid_uv(nu)) {
@@ -1177,11 +1173,9 @@ static void displist_make_surf(Depsgraph *depsgraph,
}
}
- if (!for_orco) {
- BKE_nurbList_duplicate(&ob->runtime.curve_cache->deformed_nurbs, &nubase);
- curve_calc_modifiers_post(
- depsgraph, scene, ob, dispbase, for_render, force_mesh_conversion, r_final);
- }
+ BKE_nurbList_duplicate(&ob->runtime.curve_cache->deformed_nurbs, &nubase);
+ curve_calc_modifiers_post(
+ depsgraph, scene, ob, dispbase, for_render, force_mesh_conversion, r_final);
BKE_nurbList_free(&nubase);
}
@@ -1408,7 +1402,6 @@ static void do_makeDispListCurveTypes(Depsgraph *depsgraph,
Object *ob,
ListBase *dispbase,
const bool for_render,
- const bool for_orco,
Mesh **r_final)
{
const Curve *cu = (const Curve *)ob->data;
@@ -1419,24 +1412,18 @@ static void do_makeDispListCurveTypes(Depsgraph *depsgraph,
}
if (ob->type == OB_SURF) {
- displist_make_surf(depsgraph, scene, ob, dispbase, r_final, for_render, for_orco);
+ displist_make_surf(depsgraph, scene, ob, dispbase, r_final, for_render);
return;
}
ListBase nubase = {nullptr, nullptr};
- bool force_mesh_conversion = false;
BKE_curve_bevelList_free(&ob->runtime.curve_cache->bev);
- /* We only re-evaluate path if evaluation is not happening for orco.
- * If the calculation happens for orco, we should never free data which
- * was needed before and only not needed for orco calculation. */
- if (!for_orco) {
- if (ob->runtime.curve_cache->anim_path_accum_length) {
- MEM_freeN((void *)ob->runtime.curve_cache->anim_path_accum_length);
- }
- ob->runtime.curve_cache->anim_path_accum_length = nullptr;
+ if (ob->runtime.curve_cache->anim_path_accum_length) {
+ MEM_freeN((void *)ob->runtime.curve_cache->anim_path_accum_length);
}
+ ob->runtime.curve_cache->anim_path_accum_length = nullptr;
if (ob->type == OB_FONT) {
BKE_vfont_to_curve_nubase(ob, FO_EDIT, &nubase);
@@ -1445,10 +1432,8 @@ static void do_makeDispListCurveTypes(Depsgraph *depsgraph,
BKE_nurbList_duplicate(&nubase, BKE_curve_nurbs_get(const_cast<Curve *>(cu)));
}
- if (!for_orco) {
- force_mesh_conversion = BKE_curve_calc_modifiers_pre(
- depsgraph, scene, ob, &nubase, &nubase, for_render);
- }
+ bool force_mesh_conversion = BKE_curve_calc_modifiers_pre(
+ depsgraph, scene, ob, &nubase, &nubase, for_render);
BKE_curve_bevelList_make(ob, &nubase, for_render);
@@ -1635,17 +1620,15 @@ static void do_makeDispListCurveTypes(Depsgraph *depsgraph,
curve_to_filledpoly(cu, dispbase);
}
- if (!for_orco) {
- if ((cu->flag & CU_PATH) ||
- DEG_get_eval_flags_for_id(depsgraph, &ob->id) & DAG_EVAL_NEED_CURVE_PATH) {
- BKE_anim_path_calc_data(ob);
- }
-
- BKE_nurbList_duplicate(&ob->runtime.curve_cache->deformed_nurbs, &nubase);
- curve_calc_modifiers_post(
- depsgraph, scene, ob, dispbase, for_render, force_mesh_conversion, r_final);
+ if ((cu->flag & CU_PATH) ||
+ DEG_get_eval_flags_for_id(depsgraph, &ob->id) & DAG_EVAL_NEED_CURVE_PATH) {
+ BKE_anim_path_calc_data(ob);
}
+ BKE_nurbList_duplicate(&ob->runtime.curve_cache->deformed_nurbs, &nubase);
+ curve_calc_modifiers_post(
+ depsgraph, scene, ob, dispbase, for_render, force_mesh_conversion, r_final);
+
if (cu->flag & CU_DEFORM_FILL && !ob->runtime.data_eval) {
curve_to_filledpoly(cu, dispbase);
}
@@ -1656,8 +1639,7 @@ static void do_makeDispListCurveTypes(Depsgraph *depsgraph,
void BKE_displist_make_curveTypes(Depsgraph *depsgraph,
const Scene *scene,
Object *ob,
- const bool for_render,
- const bool for_orco)
+ const bool for_render)
{
/* The same check for duplis as in do_makeDispListCurveTypes.
* Happens when curve used for constraint/bevel was converted to mesh.
@@ -1676,7 +1658,7 @@ void BKE_displist_make_curveTypes(Depsgraph *depsgraph,
ListBase *dispbase = &(ob->runtime.curve_cache->disp);
Mesh *mesh_eval = nullptr;
- do_makeDispListCurveTypes(depsgraph, scene, ob, dispbase, for_render, for_orco, &mesh_eval);
+ do_makeDispListCurveTypes(depsgraph, scene, ob, dispbase, for_render, &mesh_eval);
if (mesh_eval != nullptr) {
BKE_object_eval_assign_data(ob, &mesh_eval->id, true);
@@ -1685,19 +1667,15 @@ void BKE_displist_make_curveTypes(Depsgraph *depsgraph,
boundbox_displist_object(ob);
}
-void BKE_displist_make_curveTypes_forRender(Depsgraph *depsgraph,
- const Scene *scene,
- Object *ob,
- ListBase *dispbase,
- const bool for_orco,
- Mesh **r_final)
+void BKE_displist_make_curveTypes_forRender(
+ Depsgraph *depsgraph, const Scene *scene, Object *ob, ListBase *dispbase, Mesh **r_final)
{
if (ob->runtime.curve_cache == nullptr) {
ob->runtime.curve_cache = (CurveCache *)MEM_callocN(sizeof(CurveCache),
"CurveCache for Curve");
}
- do_makeDispListCurveTypes(depsgraph, scene, ob, dispbase, true, for_orco, r_final);
+ do_makeDispListCurveTypes(depsgraph, scene, ob, dispbase, true, r_final);
}
void BKE_displist_minmax(const ListBase *dispbase, float min[3], float max[3])