[Bf-blender-cvs] [28ee6ef31a8] gsoc-2021-porting-modifiers-to-nodes-solidify: - changes previously lost due to merge conflict. - some more cleanup.
Fabian Schempp
noreply at git.blender.org
Fri Jun 25 09:07:12 CEST 2021
Commit: 28ee6ef31a8d6bca1df6e4c6f97855226b596bf4
Author: Fabian Schempp
Date: Fri Jun 25 09:06:18 2021 +0200
Branches: gsoc-2021-porting-modifiers-to-nodes-solidify
https://developer.blender.org/rB28ee6ef31a8d6bca1df6e4c6f97855226b596bf4
- changes previously lost due to merge conflict.
- some more cleanup.
===================================================================
M source/blender/blenkernel/BKE_solidifiy.h
M source/blender/blenkernel/intern/solidify_nonmanifold.c
M source/blender/makesrna/intern/rna_nodetree.c
M source/blender/modifiers/intern/MOD_solidify.c
M source/blender/nodes/geometry/nodes/node_geo_solidify.cc
===================================================================
diff --git a/source/blender/blenkernel/BKE_solidifiy.h b/source/blender/blenkernel/BKE_solidifiy.h
index 327b68b7546..c55a225de84 100644
--- a/source/blender/blenkernel/BKE_solidifiy.h
+++ b/source/blender/blenkernel/BKE_solidifiy.h
@@ -7,9 +7,8 @@ extern "C" {
struct Mesh;
typedef struct SolidifyData {
- /** Name of vertex group to use, MAX_VGROUP_NAME. */
const Object *object;
- /** New surface offset level. */
+ /** New surface offset level. (Thickness) */
float offset;
/** Midpoint of the offset. */
float offset_fac;
@@ -20,26 +19,20 @@ typedef struct SolidifyData {
float offset_fac_vg;
/** Clamp offset based on surrounding geometry. */
float offset_clamp;
- char mode;
/** Variables for #MOD_SOLIDIFY_MODE_NONMANIFOLD. */
char nonmanifold_offset_mode;
char nonmanifold_boundary_mode;
- float crease_inner;
- float crease_outer;
- float crease_rim;
int flag;
- short mat_ofs;
- short mat_ofs_rim;
float merge_tolerance;
float bevel_convex;
float *distance;
} SolidifyData;
-Mesh *solidify_nonmanifold(const SolidifyData *solidify_data,
- Mesh *mesh,
+struct Mesh *solidify_nonmanifold(const SolidifyData *solidify_data,
+ struct Mesh *mesh,
bool **r_shell_verts,
bool **r_rim_verts,
bool **r_shell_faces,
diff --git a/source/blender/blenkernel/intern/solidify_nonmanifold.c b/source/blender/blenkernel/intern/solidify_nonmanifold.c
index 0b8d3f9b251..df1fcc1cd21 100644
--- a/source/blender/blenkernel/intern/solidify_nonmanifold.c
+++ b/source/blender/blenkernel/intern/solidify_nonmanifold.c
@@ -18,22 +18,18 @@
* \ingroup modifiers
*/
-#include "BLI_utildefines.h"
-#include <BKE_customdata.h>
-#include <DNA_modifier_types.h>
-
+#include "BKE_customdata.h"
#include "BLI_math.h"
+#include "BKE_mesh.h"
+#include "BKE_solidifiy.h"
+#include "BLI_utildefines.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
+#include "DNA_modifier_types.h"
#include "MEM_guardedalloc.h"
-#include "BKE_deform.h"
-#include "BKE_lattice.h"
-#include "BKE_mesh.h"
-#include "BKE_solidifiy.h"
-
#ifdef __GNUC__
# pragma GCC diagnostic error "-Wsign-conversion"
#endif
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 578f07ed11e..5779e58f2d3 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -9548,17 +9548,17 @@ static void def_geo_solidify(StructRNA *srna)
prop = RNA_def_property(srna, "thickness_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, rna_node_geometry_attribute_input_type_items_float);
- RNA_def_property_ui_text(prop, "Thickness", "");
+ RNA_def_property_ui_text(prop, "Thickness", "Changes the Thickness input between Float and Attribute");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
prop = RNA_def_property(srna, "nonmanifold_offset_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, nonmanifold_thickness_mode_items);
- RNA_def_property_ui_text(prop, "Mode", "");
+ RNA_def_property_ui_text(prop, "Mode", "Selects the used thickness algorithm");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
prop = RNA_def_property(srna, "nonmanifold_boundary_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, nonmanifold_boundary_mode_items);
- RNA_def_property_ui_text(prop, "Boundary", "");
+ RNA_def_property_ui_text(prop, "Boundary", "Selects the boundary adjustment algorithm");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
}
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 0815711ff24..6140ed5e3d9 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -131,16 +131,10 @@ static SolidifyData solidify_data_from_modifier_data(ModifierData *md,
smd->offset_fac,
smd->offset_fac_vg,
smd->offset_clamp,
- smd->mode,
smd->nonmanifold_offset_mode,
smd->nonmanifold_boundary_mode,
- smd->crease_inner,
- smd->crease_outer,
- smd->crease_rim,
smd->flag,
- smd->mat_ofs,
- smd->mat_ofs_rim,
- smd->mode == MOD_SOLIDIFY_MODE_EXTRUDE ? 0.01f : smd->merge_tolerance,
+ smd->merge_tolerance,
smd->bevel_convex,
NULL,
};
@@ -152,7 +146,7 @@ static SolidifyData solidify_data_from_modifier_data(ModifierData *md,
return solidify_data;
}
-static Mesh *MOD_solidify_nonmanifold(ModifierData *md,
+static Mesh *solidify_nonmanifold_modify_mesh(ModifierData *md,
const ModifierEvalContext *ctx,
Mesh *mesh,
const SolidifyModifierData *smd)
@@ -199,10 +193,10 @@ static Mesh *MOD_solidify_nonmanifold(ModifierData *md,
}
/* Only use material offsets if we have 2 or more materials. */
- const short mat_nrs = solidify_data.object->totcol > 1 ? solidify_data.object->totcol : 1;
+ const short mat_nrs = ctx->object->totcol > 1 ? ctx->object->totcol : 1;
const short mat_nr_max = mat_nrs - 1;
- const short mat_ofs = mat_nrs > 1 ? solidify_data.mat_ofs : 0;
- const short mat_ofs_rim = mat_nrs > 1 ? solidify_data.mat_ofs_rim : 0;
+ const short mat_ofs = mat_nrs > 1 ? smd->mat_ofs : 0;
+ const short mat_ofs_rim = mat_nrs > 1 ? smd->mat_ofs_rim : 0;
short most_mat_nr = 0;
uint most_mat_nr_count = 0;
@@ -246,7 +240,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
case MOD_SOLIDIFY_MODE_EXTRUDE:
return MOD_solidify_extrude_modifyMesh(md, ctx, mesh);
case MOD_SOLIDIFY_MODE_NONMANIFOLD: {
- return MOD_solidify_nonmanifold(md, ctx, mesh, smd);
+ return solidify_nonmanifold_modify_mesh(md, ctx, mesh, smd);
}
default:
BLI_assert(0);
diff --git a/source/blender/nodes/geometry/nodes/node_geo_solidify.cc b/source/blender/nodes/geometry/nodes/node_geo_solidify.cc
index a6f596f6472..71f9176fb5a 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_solidify.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_solidify.cc
@@ -124,15 +124,9 @@ static void geo_node_solidify_exec(GeoNodeExecParams params)
offset,
0.0f,
offset_clamp,
- MOD_SOLIDIFY_MODE_NONMANIFOLD,
node_storage.nonmanifold_offset_mode,
node_storage.nonmanifold_boundary_mode,
- 0.0f,
- 0.0f,
- 0.0f,
flag,
- 0,
- 0,
0.01f,
0.0f,
distance,
More information about the Bf-blender-cvs
mailing list