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-14 01:23:54 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-08-18 14:11:23 +0300
commit976f0113e008b4ff2d96760b0e83d5466dda8c54 (patch)
tree418894ff1ca29b65a823556527bb5fe20960ad92 /source/blender/modifiers/intern/MOD_multires.c
parentdf495e758d0fabc74e8ca5bbf9dc4d71af3ac63c (diff)
Multires: Base Mesh Sculpting
This adds an option to the Multires modifier to sculpt directly on the base mesh while previewing the displacement of a higher subdivisions level. What this does it considering Multires as a regular modifier without exposing the grid displacement to sculpt mode. This allows to see the propagation happening in real time, which enables to use complex tools like Cloth or Pose in much higher resolutions and without surface noise and artifacts. Reviewed By: sergey, Severin Differential Revision: https://developer.blender.org/D8555
Diffstat (limited to 'source/blender/modifiers/intern/MOD_multires.c')
-rw-r--r--source/blender/modifiers/intern/MOD_multires.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c
index 7853bc4acac..9ced297bb48 100644
--- a/source/blender/modifiers/intern/MOD_multires.c
+++ b/source/blender/modifiers/intern/MOD_multires.c
@@ -238,7 +238,9 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
/* Needed when rendering or baking will in sculpt mode. */
const bool for_render = (ctx->flag & MOD_APPLY_RENDER) != 0;
- if ((ctx->object->mode & OB_MODE_SCULPT) && !for_orco && !for_render) {
+ const bool sculpt_base_mesh = mmd->flags & eMultiresModifierFlag_UseSculptBaseMesh;
+
+ if ((ctx->object->mode & OB_MODE_SCULPT) && !for_orco && !for_render && !sculpt_base_mesh) {
/* NOTE: CCG takes ownership over Subdiv. */
result = multires_as_ccg(mmd, ctx, mesh, subdiv);
result->runtime.subdiv_ccg_tot_level = mmd->totlvl;
@@ -341,6 +343,12 @@ static void panel_draw(const bContext *C, Panel *panel)
uiItemR(col, &ptr, "sculpt_levels", 0, IFACE_("Sculpt"), ICON_NONE);
uiItemR(col, &ptr, "render_levels", 0, IFACE_("Render"), ICON_NONE);
+ const bool is_sculpt_mode = CTX_data_active_object(C)->mode & OB_MODE_SCULPT;
+ uiBlock *block = uiLayoutGetBlock(panel->layout);
+ UI_block_lock_set(block, !is_sculpt_mode, IFACE_("Sculpt Base Mesh"));
+ uiItemR(col, &ptr, "use_sculpt_base_mesh", 0, IFACE_("Sculpt Base Mesh"), ICON_NONE);
+ UI_block_lock_clear(block);
+
uiItemR(layout, &ptr, "show_only_control_edges", 0, NULL, ICON_NONE);
modifier_panel_end(layout, &ptr);