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:
authorHans Goudey <h.goudey@me.com>2022-07-07 16:06:30 +0300
committerHans Goudey <h.goudey@me.com>2022-07-07 16:06:30 +0300
commite3ef56ef91417519a3301746f4cfd244cd08ef85 (patch)
tree8995e7532d15c64de3c4629aba7b528376a1c4c6 /source/blender/draw/engines/overlay/overlay_engine.c
parent5d6e7df4a8b70aa98d86655b024a87ca3319c6be (diff)
Curves: Add sculpt selection overlay
This commit adds visualization to the selection in curves sculpt mode. Previously it was only possible to see the selection when it was connected to a material. In order to obstruct the users vision as little as possible, the selected areas of the curve are left as is, but a dark overlay is drawn over unselected areas. To make it work, the overlay requests the selection attribute and then ensures that the evaluation is complete for curves. Then it retrieves the evaluated selection GPU texture and passes that to the shader. This reuses the existing generic attribute extraction system because there currently wouldn't be any benefits to dealing with selection separately, and because it avoids duplication of the logic that extracts attributes from curves and evaluates them if necessary. Differential Revision: https://developer.blender.org/D15219
Diffstat (limited to 'source/blender/draw/engines/overlay/overlay_engine.c')
-rw-r--r--source/blender/draw/engines/overlay/overlay_engine.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_engine.c b/source/blender/draw/engines/overlay/overlay_engine.c
index f8c28394b16..9ec0398e5cb 100644
--- a/source/blender/draw/engines/overlay/overlay_engine.c
+++ b/source/blender/draw/engines/overlay/overlay_engine.c
@@ -192,6 +192,8 @@ static void OVERLAY_cache_init(void *vedata)
OVERLAY_edit_curves_cache_init(vedata);
break;
case CTX_MODE_SCULPT_CURVES:
+ OVERLAY_sculpt_curves_cache_init(vedata);
+ break;
case CTX_MODE_OBJECT:
break;
default:
@@ -310,6 +312,8 @@ static void OVERLAY_cache_populate(void *vedata, Object *ob)
(draw_ctx->object_mode & OB_MODE_ALL_PAINT);
const bool in_sculpt_mode = (ob == draw_ctx->obact) && (ob->sculpt != NULL) &&
(ob->sculpt->mode_type == OB_MODE_SCULPT);
+ const bool in_curves_sculpt_mode = (ob == draw_ctx->obact) &&
+ (ob->mode == OB_MODE_SCULPT_CURVES);
const bool has_surface = ELEM(ob->type,
OB_MESH,
OB_CURVES_LEGACY,
@@ -428,6 +432,9 @@ static void OVERLAY_cache_populate(void *vedata, Object *ob)
if (in_sculpt_mode) {
OVERLAY_sculpt_cache_populate(vedata, ob);
}
+ else if (in_curves_sculpt_mode) {
+ OVERLAY_sculpt_curves_cache_populate(vedata, ob);
+ }
if (draw_motion_paths) {
OVERLAY_motion_path_cache_populate(vedata, ob);
@@ -591,6 +598,9 @@ static void OVERLAY_draw_scene(void *vedata)
case CTX_MODE_SCULPT:
OVERLAY_sculpt_draw(vedata);
break;
+ case CTX_MODE_SCULPT_CURVES:
+ OVERLAY_sculpt_curves_draw(vedata);
+ break;
case CTX_MODE_EDIT_MESH:
case CTX_MODE_POSE:
case CTX_MODE_PAINT_WEIGHT: