diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-09-18 02:17:33 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-09-18 20:10:40 +0300 |
commit | 5d728d38b94c2e48865de0e90fb433dbc1845fe0 (patch) | |
tree | decce29be944cdf64959994e0135c8206a49e3ac /source/blender/editors/sculpt_paint/sculpt_filter_mesh.c | |
parent | 8ac1ca13c852b8f35306d8aff7d2fa0f2a690ccf (diff) |
Sculpt: Scale Cloth Filter
This filter scales the mesh as it was a softbody, producing folds in the
surface. The orientation of the folds can be controlled using the filter
axis and orientation.
This is an example of a cloth filter that uses deform coordinates instead
of forces, but probably it does not make much sense to expose it to the
user in a different way and with different parameters. I'll remove
FilterCache->enabled_force_axis in a later commit and use always
enabled_axis in SCULPT_filter_zero_disabled_axis_components
for both forces and deformation filters, so this function can also be used
in the mesh filter.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8661
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_filter_mesh.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_filter_mesh.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c index 1cbf9275a56..c2e90638994 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c +++ b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c @@ -97,6 +97,17 @@ void SCULPT_filter_to_object_space(float r_v[3], struct FilterCache *filter_cach } } +void SCULPT_filter_zero_disabled_axis_components(float r_v[3], struct FilterCache *filter_cache) +{ + SCULPT_filter_to_orientation_space(r_v, filter_cache); + for (int axis = 0; axis < 3; axis++) { + if (!filter_cache->enabled_force_axis[axis]) { + r_v[axis] = 0.0f; + } + } + SCULPT_filter_to_object_space(r_v, filter_cache); +} + static void filter_cache_init_task_cb(void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls)) |