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>2020-08-06 19:03:11 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-08-06 19:03:56 +0300
commitd693d77fed968c126dbde62c73bbaffc5b14b43c (patch)
tree18dd4d34d1fec8a7a3c70f1005afcc68659fbd36 /source/blender/editors/sculpt_paint/paint_cursor.c
parent97c56b7628d100990bb49ee6749374b15001d46e (diff)
Sculpt: Cloth Brush simulation area property
This makes possible to choose between a local and a global simulation when the cloth brush is used. Local simulation is the current default. When global simulation is enabled, the cloth brush simulates the entire mesh without taking any simulation limits into account. This was possible before by setting the simulation limits to 10 (the current maximum value allowed) so the entire mesh was inside the limits, but this was a hack as the limits scale with the radius and there should not be any limitation on how big the simulated area can be to be able to simulate an entire object. This also allows to make a more clear distinction between cloth brush presets that are intended to be used in local areas to add details or globally to generate the base shape of the mesh. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8481
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_cursor.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index e3027ead1f1..c5f1063d494 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -1612,8 +1612,9 @@ static void paint_cursor_draw_3d_view_brush_cursor_inactive(PaintCursorContext *
/* Main inactive cursor. */
paint_cursor_draw_main_inactive_cursor(pcontext);
- /* Cloth brush simulation areas. */
- if (brush->sculpt_tool == SCULPT_TOOL_CLOTH) {
+ /* Cloth brush local simulation areas. */
+ if (brush->sculpt_tool == SCULPT_TOOL_CLOTH &&
+ brush->cloth_simulation_area_type == BRUSH_CLOTH_SIMULATION_AREA_LOCAL) {
const float white[3] = {1.0f, 1.0f, 1.0f};
const float zero_v[3] = {0.0f};
/* This functions sets its own drawing space in order to draw the simulation limits when the
@@ -1691,9 +1692,10 @@ static void paint_cursor_cursor_draw_3d_view_brush_cursor_active(PaintCursorCont
SCULPT_cloth_plane_falloff_preview_draw(
pcontext->pos, ss, pcontext->outline_col, pcontext->outline_alpha);
}
- else if (brush->cloth_force_falloff_type == BRUSH_CLOTH_FORCE_FALLOFF_RADIAL) {
+ else if (brush->cloth_force_falloff_type == BRUSH_CLOTH_FORCE_FALLOFF_RADIAL &&
+ brush->cloth_simulation_area_type == BRUSH_CLOTH_SIMULATION_AREA_LOCAL) {
/* Display the simulation limits if sculpting outside them. */
- /* This does not makes much sense of plane fallof as the fallof is infinte. */
+ /* This does not makes much sense of plane fallof as the fallof is infinte or global. */
if (len_v3v3(ss->cache->true_location, ss->cache->true_initial_location) >
ss->cache->radius * (1.0f + brush->cloth_sim_limit)) {