[Bf-blender-cvs] [59be5bf228a] curve-nodes-modifier: Remove "Curve deform fill" setting, avoid duplicating spline list
Hans Goudey
noreply at git.blender.org
Tue Jul 13 01:40:44 CEST 2021
Commit: 59be5bf228a3ff52879e9c55785f21a379e57536
Author: Hans Goudey
Date: Mon Jun 28 16:49:48 2021 -0500
Branches: curve-nodes-modifier
https://developer.blender.org/rB59be5bf228a3ff52879e9c55785f21a379e57536
Remove "Curve deform fill" setting, avoid duplicating spline list
===================================================================
M release/scripts/startup/bl_ui/properties_data_curve.py
M source/blender/blenkernel/intern/displist.cc
M source/blender/editors/curve/editcurve_add.c
M source/blender/io/alembic/intern/abc_reader_curves.cc
M source/blender/makesdna/DNA_curve_types.h
M source/blender/makesrna/intern/rna_curve.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py
index 85f672cd50f..e5b675db2c5 100644
--- a/release/scripts/startup/bl_ui/properties_data_curve.py
+++ b/release/scripts/startup/bl_ui/properties_data_curve.py
@@ -120,7 +120,6 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel):
sub = col.column()
sub.active = (curve.dimensions == '2D' or (curve.bevel_mode != 'OBJECT' and curve.dimensions == '3D'))
sub.prop(curve, "fill_mode")
- col.prop(curve, "use_fill_deform")
if is_curve:
col = layout.column()
diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc
index 05202e40c3f..9c301962f86 100644
--- a/source/blender/blenkernel/intern/displist.cc
+++ b/source/blender/blenkernel/intern/displist.cc
@@ -546,11 +546,6 @@ static void bevels_to_filledpoly(const Curve *cu, ListBase *dispbase)
LISTBASE_FOREACH (const DispList *, dl, dispbase) {
if (dl->type == DL_SURF) {
-
- /* This should be moved specifically to the surface evaluation functions,
- * now that they are further separated. */
- BLI_assert_unreachable();
-
if ((dl->flag & DL_CYCL_V) && (dl->flag & DL_CYCL_U) == 0) {
if ((cu->flag & CU_BACK) && (dl->flag & DL_BACK_CURVE)) {
DispList *dlnew = (DispList *)MEM_callocN(sizeof(DispList), __func__);
@@ -874,9 +869,7 @@ static GeometrySet curve_calc_modifiers_post(Depsgraph *depsgraph,
geometry_set.replace_curve(curve_eval.release());
}
else {
- if (cu->flag & CU_DEFORM_FILL) {
- curve_to_filledpoly(cu, dispbase);
- }
+ curve_to_filledpoly(cu, dispbase);
Mesh *mesh = BKE_mesh_new_nomain_from_curve_displist(ob, dispbase);
/* Copy materials, since BKE_mesh_new_nomain_from_curve_displist() doesn't. */
mesh->mat = (Material **)MEM_dupallocN(cu->mat);
@@ -1295,8 +1288,6 @@ static void evaluate_curve_type_object(Depsgraph *depsgraph,
const Curve *cu = (const Curve *)ob->data;
BLI_assert(ELEM(ob->type, OB_CURVE, OB_FONT));
- ListBase nubase = {nullptr, nullptr};
-
BKE_curve_bevelList_free(&ob->runtime.curve_cache->bev);
if (ob->runtime.curve_cache->anim_path_accum_length) {
@@ -1304,29 +1295,31 @@ static void evaluate_curve_type_object(Depsgraph *depsgraph,
}
ob->runtime.curve_cache->anim_path_accum_length = nullptr;
+ ListBase *nubase = &ob->runtime.curve_cache->deformed_nurbs;
+
if (ob->type == OB_FONT) {
- BKE_vfont_to_curve_nubase(ob, FO_EDIT, &nubase);
+ BKE_vfont_to_curve_nubase(ob, FO_EDIT, nubase);
}
else {
- BKE_nurbList_duplicate(&nubase, BKE_curve_nurbs_get(const_cast<Curve *>(cu)));
+ BKE_nurbList_duplicate(nubase, BKE_curve_nurbs_get(const_cast<Curve *>(cu)));
}
- BKE_curve_calc_modifiers_pre(depsgraph, scene, ob, &nubase, &nubase, for_render);
+ BKE_curve_calc_modifiers_pre(depsgraph, scene, ob, nubase, nubase, for_render);
- BKE_curve_bevelList_make(ob, &nubase, for_render);
+ BKE_curve_bevelList_make(ob, nubase, for_render);
/* If curve has no bevel will return nothing */
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) {
- curve_to_displist(cu, &nubase, for_render, dispbase);
+ curve_to_displist(cu, nubase, for_render, dispbase);
}
else {
const float widfac = cu->width - 1.0f;
- BevList *bl = (BevList *)ob->runtime.curve_cache->bev.first;
- Nurb *nu = (Nurb *)nubase.first;
+ const BevList *bl = (BevList *)ob->runtime.curve_cache->bev.first;
+ const Nurb *nu = (Nurb *)nubase->first;
for (; bl && nu; bl = bl->next, nu = nu->next) {
float *data;
@@ -1491,23 +1484,16 @@ static void evaluate_curve_type_object(Depsgraph *depsgraph,
}
}
}
- BKE_displist_free(&dlbev);
}
- if (!(cu->flag & CU_DEFORM_FILL)) {
- curve_to_filledpoly(cu, dispbase);
- }
+ BKE_displist_free(&dlbev);
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);
-
*r_geometry_set = curve_calc_modifiers_post(depsgraph, scene, ob, dispbase, for_render);
-
- BKE_nurbList_free(&nubase);
}
void BKE_displist_make_curveTypes(Depsgraph *depsgraph,
diff --git a/source/blender/editors/curve/editcurve_add.c b/source/blender/editors/curve/editcurve_add.c
index 065763764c1..1afbb594c9b 100644
--- a/source/blender/editors/curve/editcurve_add.c
+++ b/source/blender/editors/curve/editcurve_add.c
@@ -535,7 +535,6 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf)
newob = true;
cu = (Curve *)obedit->data;
- cu->flag |= CU_DEFORM_FILL;
if (type & CU_PRIM_PATH) {
cu->flag |= CU_PATH | CU_3D;
diff --git a/source/blender/io/alembic/intern/abc_reader_curves.cc b/source/blender/io/alembic/intern/abc_reader_curves.cc
index 8d6605d6973..8cdabcd4530 100644
--- a/source/blender/io/alembic/intern/abc_reader_curves.cc
+++ b/source/blender/io/alembic/intern/abc_reader_curves.cc
@@ -94,7 +94,7 @@ void AbcCurveReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSele
{
Curve *cu = BKE_curve_add(bmain, m_data_name.c_str(), OB_CURVE);
- cu->flag |= CU_DEFORM_FILL | CU_3D;
+ cu->flag |= CU_3D;
cu->actvert = CU_ACT_NONE;
cu->resolu = 1;
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index f6242679808..b7f5ea85ac6 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -344,8 +344,6 @@ enum {
CU_DS_EXPAND = 1 << 11,
/** make use of the path radius if this is enabled (default for new curves) */
CU_PATH_RADIUS = 1 << 12,
- /** fill 2d curve after deformation */
- CU_DEFORM_FILL = 1 << 13,
/** fill bevel caps */
CU_FILL_CAPS = 1 << 14,
/** map taper object to beveled area */
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 299cd2504a8..01740cf4fff 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -1809,12 +1809,6 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Twist Smooth", "Smoothing iteration for tangents");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
- prop = RNA_def_property(srna, "use_fill_deform", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_DEFORM_FILL);
- RNA_def_property_ui_text(
- prop, "Fill Deformed", "Fill curve after applying shape keys and all modifiers");
- RNA_def_property_update(prop, 0, "rna_Curve_update_data");
-
prop = RNA_def_property(srna, "use_fill_caps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FILL_CAPS);
RNA_def_property_ui_text(prop, "Fill Caps", "Fill caps for beveled curves");
More information about the Bf-blender-cvs
mailing list