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:
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_cloth.py1
-rw-r--r--source/blender/blenkernel/BKE_cloth_remesh.hh2
-rw-r--r--source/blender/blenkernel/intern/cloth_remesh.cc5
-rw-r--r--source/blender/makesdna/DNA_cloth_types.h3
-rw-r--r--source/blender/makesdna/DNA_modifier_defaults.h2
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h3
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c6
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c6
-rw-r--r--source/blender/modifiers/intern/MOD_adaptive_remesh.cc2
9 files changed, 27 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py
index 8a252b0bac4..07f652cf3d3 100644
--- a/release/scripts/startup/bl_ui/properties_physics_cloth.py
+++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py
@@ -338,6 +338,7 @@ class PHYSICS_PT_cloth_remesh(PhysicButtonsPanel, Panel):
col.prop(cloth, "remeshing_edge_length_min", text="Remeshing Minimum Edge Length")
col.prop(cloth, "remeshing_edge_length_max", text="Remeshing Maximum Edge Length")
col.prop(cloth, "remeshing_aspect_ratio_min", text="Remeshing Minimum Aspect Ratio")
+ col.prop(cloth, "remeshing_change_in_vertex_normal_max", text="Remeshing Maximum Change in Vertex Normal")
class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel):
diff --git a/source/blender/blenkernel/BKE_cloth_remesh.hh b/source/blender/blenkernel/BKE_cloth_remesh.hh
index 0f8c49f2ac9..9bf2dac6792 100644
--- a/source/blender/blenkernel/BKE_cloth_remesh.hh
+++ b/source/blender/blenkernel/BKE_cloth_remesh.hh
@@ -117,6 +117,7 @@ template<typename END, typename ExtraData> struct AdaptiveRemeshParams {
float edge_length_min;
float edge_length_max;
float aspect_ratio_min;
+ float change_in_vertex_normal_max;
/* AdaptiveRemeshParamsFlags */
uint32_t flags;
/* AdaptiveRemeshParamsType */
@@ -3581,6 +3582,7 @@ struct TempEmptyAdaptiveRemeshParams {
float edge_length_min;
float edge_length_max;
float aspect_ratio_min;
+ float change_in_vertex_normal_max;
/* AdaptiveRemeshParamsFlags */
uint32_t flags;
/* AdaptiveRemeshParamsType */
diff --git a/source/blender/blenkernel/intern/cloth_remesh.cc b/source/blender/blenkernel/intern/cloth_remesh.cc
index f872b65a579..90c373ec11b 100644
--- a/source/blender/blenkernel/intern/cloth_remesh.cc
+++ b/source/blender/blenkernel/intern/cloth_remesh.cc
@@ -782,7 +782,7 @@ class AdaptiveMesh : public Mesh<NodeData<END>, VertData, EdgeData, FaceData> {
const float edge_length_min = params.edge_length_min;
const float edge_length_max = params.edge_length_max;
const float aspect_ratio_min = params.aspect_ratio_min;
- const float change_in_vertex_normal_max = 0.01;
+ const float change_in_vertex_normal_max = params.change_in_vertex_normal_max;
BLI_assert(face.get_verts().size() == 3);
const auto &n1 = this->get_checked_node_of_vert(this->get_checked_vert(face.get_verts()[0]));
@@ -2042,6 +2042,7 @@ void BKE_cloth_serialize_adaptive_mesh(Object *ob,
params.edge_length_min = clmd->sim_parms->remeshing_edge_length_min;
params.edge_length_max = clmd->sim_parms->remeshing_edge_length_max;
params.aspect_ratio_min = clmd->sim_parms->remeshing_aspect_ratio_min;
+ params.change_in_vertex_normal_max = clmd->sim_parms->remeshing_change_in_vertex_normal_max;
params.extra_data_to_end = [](const Cloth &cloth, size_t index) {
BLI_assert(index < cloth.mvert_num);
BLI_assert(cloth.verts);
@@ -2118,6 +2119,7 @@ Mesh *BKE_cloth_remesh(Object *ob, ClothModifierData *clmd, Mesh *mesh)
params.edge_length_min = clmd->sim_parms->remeshing_edge_length_min;
params.edge_length_max = clmd->sim_parms->remeshing_edge_length_max;
params.aspect_ratio_min = clmd->sim_parms->remeshing_aspect_ratio_min;
+ params.change_in_vertex_normal_max = clmd->sim_parms->remeshing_change_in_vertex_normal_max;
params.flags = 0;
if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SEW) {
params.flags |= ADAPTIVE_REMESH_PARAMS_SEWING;
@@ -2186,6 +2188,7 @@ Mesh *__temp_empty_adaptive_remesh(const TempEmptyAdaptiveRemeshParams &input_pa
params.edge_length_min = input_params.edge_length_min;
params.edge_length_max = input_params.edge_length_max;
params.aspect_ratio_min = input_params.aspect_ratio_min;
+ params.change_in_vertex_normal_max = input_params.change_in_vertex_normal_max;
params.flags = input_params.flags;
params.type = input_params.type;
params.extra_data_to_end = [](const EmptyData &UNUSED(data), size_t UNUSED(index)) {
diff --git a/source/blender/makesdna/DNA_cloth_types.h b/source/blender/makesdna/DNA_cloth_types.h
index 1f9c7dec6ba..2009b740ab8 100644
--- a/source/blender/makesdna/DNA_cloth_types.h
+++ b/source/blender/makesdna/DNA_cloth_types.h
@@ -189,8 +189,7 @@ typedef struct ClothSimSettings {
float remeshing_edge_length_min;
float remeshing_edge_length_max;
float remeshing_aspect_ratio_min;
- char _pad2[4];
-
+ float remeshing_change_in_vertex_normal_max;
} ClothSimSettings;
/* SIMULATION FLAGS: goal flags,.. */
diff --git a/source/blender/makesdna/DNA_modifier_defaults.h b/source/blender/makesdna/DNA_modifier_defaults.h
index b8af689a4c2..35eefe50b7e 100644
--- a/source/blender/makesdna/DNA_modifier_defaults.h
+++ b/source/blender/makesdna/DNA_modifier_defaults.h
@@ -31,6 +31,7 @@
.edge_length_min = 0.05f, \
.edge_length_max = 0.5f, \
.aspect_ratio_min = 0.2f, \
+ .change_in_vertex_normal_max = 0.01f, \
}
#define _DNA_DEFAULT_ArmatureModifierData \
@@ -180,6 +181,7 @@
.remeshing_edge_length_min = 0.05f, \
.remeshing_edge_length_max = 0.5f, \
.remeshing_aspect_ratio_min = 0.2f, \
+ .remeshing_change_in_vertex_normal_max = 0.01f, \
}
#define _DNA_DEFAULT_ClothCollSettings \
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index d502620c80c..fc255dfcb35 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -2360,6 +2360,9 @@ typedef struct AdaptiveRemeshModifierData {
float edge_length_min;
float edge_length_max;
float aspect_ratio_min;
+ float change_in_vertex_normal_max;
+
+ char _pad1[4];
} AdaptiveRemeshModifierData;
typedef enum AdaptiveRemeshFlag {
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 8024cb0ef92..83bbca1c7f8 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -1092,6 +1092,12 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Remeshing Minimum Aspect Ratio", "");
RNA_def_property_update(prop, 0, "rna_cloth_update");
+ prop = RNA_def_property(srna, "remeshing_change_in_vertex_normal_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "remeshing_change_in_vertex_normal_max");
+ RNA_def_property_ui_range(prop, 0.0001f, 2.0f, 0.005f, 4);
+ RNA_def_property_ui_text(prop, "Remeshing Maximum Change in Vertex Normal", "");
+ RNA_def_property_update(prop, 0, "rna_cloth_update");
+
/* unused */
/* unused still */
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 2391bfc3210..9e7c56c645f 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -7309,6 +7309,12 @@ static void rna_def_modifier_adaptive_remesh(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Remeshing Minimum Aspect Ratio", "");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+ prop = RNA_def_property(srna, "change_in_vertex_normal_max", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "change_in_vertex_normal_max");
+ RNA_def_property_ui_range(prop, 0.0001f, 2.0f, 0.005f, 4);
+ RNA_def_property_ui_text(prop, "Remeshing Maximum Change in Vertex Normal", "");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
RNA_define_lib_overridable(false);
}
diff --git a/source/blender/modifiers/intern/MOD_adaptive_remesh.cc b/source/blender/modifiers/intern/MOD_adaptive_remesh.cc
index 47f1179c3dd..1c34d2da3f0 100644
--- a/source/blender/modifiers/intern/MOD_adaptive_remesh.cc
+++ b/source/blender/modifiers/intern/MOD_adaptive_remesh.cc
@@ -65,6 +65,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *UNUSED(ctx)
params.edge_length_min = armd->edge_length_min;
params.edge_length_max = armd->edge_length_max;
params.aspect_ratio_min = armd->aspect_ratio_min;
+ params.change_in_vertex_normal_max = armd->change_in_vertex_normal_max;
params.flags = 0;
if (armd->flag & ADAPTIVE_REMESH_SEWING) {
params.flags |= ADAPTIVE_REMESH_PARAMS_SEWING;
@@ -197,6 +198,7 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
uiItemR(layout, ptr, "edge_length_min", 0, nullptr, ICON_NONE);
uiItemR(layout, ptr, "edge_length_max", 0, nullptr, ICON_NONE);
uiItemR(layout, ptr, "aspect_ratio_min", 0, nullptr, ICON_NONE);
+ uiItemR(layout, ptr, "change_in_vertex_normal_max", 0, nullptr, ICON_NONE);
uiItemR(layout, ptr, "enable_sewing", 0, nullptr, ICON_NONE);
uiItemR(layout, ptr, "force_split_for_sewing", 0, nullptr, ICON_NONE);
}