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:
authorPablo Dobarro <pablodp606@gmail.com>2019-09-12 04:54:12 +0300
committerPablo Dobarro <pablodp606@gmail.com>2019-09-12 04:55:53 +0300
commit70a934770521b538b98b8a3e27739ae6a643ebfa (patch)
tree34933a99bcc22e3b74ada14a447b71b484ccc94d
parent1e375ab5a104a71c45c1bf85ea34ab886c61e93d (diff)
Fix T69737: Crash using the Elastic Deform brush and Compressibility
Also renamed "compressibility" to "volume preservation" Reviewed By: brecht Maniphest Tasks: T69737 Differential Revision: https://developer.blender.org/D5757
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py2
-rw-r--r--source/blender/blenloader/intern/versioning_280.c4
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c2
-rw-r--r--source/blender/makesdna/DNA_brush_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_brush.c14
5 files changed, 13 insertions, 11 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index ff3cbb08aab..ccd777f799c 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -422,7 +422,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
row = col.row()
row.prop(brush, "elastic_deform_type")
row = col.row()
- row.prop(brush, "elastic_deform_compressibility", slider=True)
+ row.prop(brush, "elastic_deform_volume_preservation", slider=True)
col.separator()
row = col.row()
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index d06da062d49..2615c17ace5 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3836,8 +3836,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
/* Elatic deform brush */
for (Brush *br = bmain->brushes.first; br; br = br->id.next) {
- if (br->ob_mode & OB_MODE_SCULPT && br->elastic_deform_compressibility == 0.0f) {
- br->elastic_deform_compressibility = 0.5f;
+ if (br->ob_mode & OB_MODE_SCULPT && br->elastic_deform_volume_preservation == 0.0f) {
+ br->elastic_deform_volume_preservation = 0.5f;
}
}
}
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index df499c28125..afbe7e14794 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -3345,7 +3345,7 @@ static void do_elastic_deform_brush_task_cb_ex(void *__restrict userdata,
radius_scaled[2] = radius_scaled[1] * radius_e[2];
float shear_modulus = 1.0f;
- float poisson_ratio = brush->elastic_deform_compressibility;
+ float poisson_ratio = brush->elastic_deform_volume_preservation;
float a = 1.0f / (4.0f * (float)M_PI * shear_modulus);
float b = a / (4.0f * (1.0f - poisson_ratio));
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 450788dc81d..957f5b75974 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -322,7 +322,7 @@ typedef struct Brush {
char _pad1[4];
int elastic_deform_type;
- float elastic_deform_compressibility;
+ float elastic_deform_volume_preservation;
/* overlay */
int texture_overlay_alpha;
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 182b9bc2e01..b5f4582d844 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1837,12 +1837,14 @@ static void rna_def_brush(BlenderRNA *brna)
prop, "Normal Weight", "How much grab will pull vertexes out of surface during a grab");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop = RNA_def_property(srna, "elastic_deform_compressibility", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "elastic_deform_compressibility");
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01f, 3);
- RNA_def_property_ui_text(
- prop, "Compressibility", "Material compressibility when simulating the elasticity");
+ prop = RNA_def_property(srna, "elastic_deform_volume_preservation", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "elastic_deform_volume_preservation");
+ RNA_def_property_range(prop, 0.0f, 0.9f);
+ RNA_def_property_ui_range(prop, 0.0f, 0.9f, 0.01f, 3);
+ RNA_def_property_ui_text(prop,
+ "Volume Preservation",
+ "Poisson ratio for elastic deformation. Higher values preserve volume "
+ "more, but also lead to more bulging");
RNA_def_property_update(prop, 0, "rna_Brush_update");
prop = RNA_def_property(srna, "rake_factor", PROP_FLOAT, PROP_FACTOR);