diff options
author | Jacques Lucke <jacques@blender.org> | 2022-02-18 11:12:41 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-02-18 11:14:54 +0300 |
commit | 61aaeb3745ad72c681c17f4535dd06ffaaf78c58 (patch) | |
tree | c843b445e3e68938aa8c1f5f704dc55eb2be5c6d /source/blender/editors/curves/intern | |
parent | 964d3a38fac8fd9ba90e6a94d26546f2d0651116 (diff) |
Curves: initial brush system integration for curves sculpt mode
This adds the boilerplate code that is necessary to use the tool/brush/paint
systems in the new sculpt curves mode.
Two temporary dummy tools are part of this patch. They do nothing and
only serve to test the boilerplate. When the first actual tool is added,
those dummy tools will be removed.
Differential Revision: https://developer.blender.org/D14117
Diffstat (limited to 'source/blender/editors/curves/intern')
-rw-r--r-- | source/blender/editors/curves/intern/curves_ops.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/curves/intern/curves_ops.cc b/source/blender/editors/curves/intern/curves_ops.cc index fdda8e636f7..0aa8c4b253e 100644 --- a/source/blender/editors/curves/intern/curves_ops.cc +++ b/source/blender/editors/curves/intern/curves_ops.cc @@ -10,9 +10,13 @@ #include "ED_object.h" #include "WM_api.h" +#include "WM_toolsystem.h" #include "WM_types.h" #include "BKE_context.h" +#include "BKE_paint.h" + +#include "DNA_scene_types.h" #include "RNA_access.h" #include "RNA_define.h" @@ -32,6 +36,7 @@ static bool curves_sculptmode_toggle_poll(bContext *C) static int curves_sculptmode_toggle_exec(bContext *C, wmOperator *op) { + Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C); const bool is_mode_set = ob->mode == OB_MODE_SCULPT_CURVES; @@ -45,9 +50,11 @@ static int curves_sculptmode_toggle_exec(bContext *C, wmOperator *op) ob->mode = OB_MODE_OBJECT; } else { + BKE_paint_ensure(scene->toolsettings, (Paint **)&scene->toolsettings->curves_sculpt); ob->mode = OB_MODE_SCULPT_CURVES; } + WM_toolsystem_update_from_context_view3d(C); WM_event_add_notifier(C, NC_SCENE | ND_MODE, nullptr); return OPERATOR_CANCELLED; } |