diff options
-rw-r--r-- | source/blender/blenkernel/BKE_displist.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/displist.cc | 72 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/effect.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_convert.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object_update.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 2 |
8 files changed, 34 insertions, 58 deletions
diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h index de2a746dc3e..0f37ba6c4ce 100644 --- a/source/blender/blenkernel/BKE_displist.h +++ b/source/blender/blenkernel/BKE_displist.h @@ -87,13 +87,11 @@ bool BKE_displist_has_faces(const struct ListBase *lb); void BKE_displist_make_curveTypes(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, - const bool for_render, - const bool for_orco); + const bool for_render); void BKE_displist_make_curveTypes_forRender(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, struct ListBase *dispbase, - const bool for_orco, struct Mesh **r_final); void BKE_displist_make_mball(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob); void BKE_displist_make_mball_forRender(struct Depsgraph *depsgraph, 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]) diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index ff0fc4754e3..97aba5e787d 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -163,7 +163,7 @@ static void precalculate_effector(struct Depsgraph *depsgraph, EffectorCache *ef if (cu->flag & CU_PATH) { if (eff->ob->runtime.curve_cache == NULL || eff->ob->runtime.curve_cache->anim_path_accum_length == NULL) { - BKE_displist_make_curveTypes(depsgraph, eff->scene, eff->ob, false, false); + BKE_displist_make_curveTypes(depsgraph, eff->scene, eff->ob, false); } if (eff->ob->runtime.curve_cache->anim_path_accum_length) { diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c index 1b938855291..825963a2210 100644 --- a/source/blender/blenkernel/intern/mesh_convert.c +++ b/source/blender/blenkernel/intern/mesh_convert.c @@ -1107,7 +1107,7 @@ static void curve_to_mesh_eval_ensure(Object *object) * Brecht says hold off with that. */ Mesh *mesh_eval = NULL; BKE_displist_make_curveTypes_forRender( - NULL, NULL, &remapped_object, &remapped_object.runtime.curve_cache->disp, false, &mesh_eval); + NULL, NULL, &remapped_object, &remapped_object.runtime.curve_cache->disp, &mesh_eval); /* Note: this is to be consistent with `BKE_displist_make_curveTypes()`, however that is not a * real issue currently, code here is broken in more than one way, fix(es) will be done diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index b1afd968bdc..ab247ef5507 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -224,7 +224,7 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *o case OB_SURF: case OB_FONT: { bool for_render = (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER); - BKE_displist_make_curveTypes(depsgraph, scene, ob, for_render, false); + BKE_displist_make_curveTypes(depsgraph, scene, ob, for_render); break; } diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 91e25b5fc7f..11cf3ea5083 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -2575,7 +2575,7 @@ static void object_data_convert_ensure_curve_cache(Depsgraph *depsgraph, Scene * if (ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT)) { /* We need 'for render' ON here, to enable computing bevel dipslist if needed. * Also makes sense anyway, we would not want e.g. to lose hidden parts etc. */ - BKE_displist_make_curveTypes(depsgraph, scene, ob, true, false); + BKE_displist_make_curveTypes(depsgraph, scene, ob, true); } 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 c336f77eaa9..c5c60c94d4a 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -125,7 +125,7 @@ static void object_force_modifier_update_for_bind(Depsgraph *depsgraph, Object * BKE_displist_make_mball(depsgraph, scene_eval, ob_eval); } else if (ELEM(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { - BKE_displist_make_curveTypes(depsgraph, scene_eval, ob_eval, false, false); + BKE_displist_make_curveTypes(depsgraph, scene_eval, ob_eval, false); } else if (ob->type == OB_GPENCIL) { BKE_gpencil_modifiers_calc(depsgraph, scene_eval, ob_eval); @@ -1923,8 +1923,8 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - const eMultiresSubdivideModeType subdivide_mode = (eMultiresSubdivideModeType)( - RNA_enum_get(op->ptr, "mode")); + const eMultiresSubdivideModeType subdivide_mode = (eMultiresSubdivideModeType)(RNA_enum_get( + op->ptr, "mode")); multiresModifier_subdivide(object, mmd, subdivide_mode); ED_object_iter_other( diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index e2b7a079775..15695c4c6f7 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -715,7 +715,7 @@ bool ED_object_parent_set(ReportList *reports, cu->flag |= CU_PATH | CU_FOLLOW; cu_eval->flag |= CU_PATH | CU_FOLLOW; /* force creation of path data */ - BKE_displist_make_curveTypes(depsgraph, scene, par, false, false); + BKE_displist_make_curveTypes(depsgraph, scene, par, false); } else { cu->flag |= CU_FOLLOW; |