Cleanup: use namespace and code sections

This commit is contained in:
Jacques Lucke 2022-02-21 12:01:30 +01:00
parent 7f2beb79c6
commit fcb84e32e0
1 changed files with 17 additions and 0 deletions

View File

@ -20,6 +20,12 @@ bool CURVES_SCULPT_mode_poll(struct bContext *C)
return ob && ob->mode & OB_MODE_SCULPT_CURVES;
}
namespace blender::ed::sculpt_paint {
/* --------------------------------------------------------------------
* SCULPT_CURVES_OT_brush_stroke.
*/
static bool stroke_get_location(bContext *C, float out[3], const float mouse[2])
{
out[0] = mouse[0];
@ -86,6 +92,10 @@ static void SCULPT_CURVES_OT_brush_stroke(struct wmOperatorType *ot)
paint_stroke_operator_properties(ot);
}
/* --------------------------------------------------------------------
* CURVES_OT_sculptmode_toggle.
*/
static bool curves_sculptmode_toggle_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
@ -135,8 +145,15 @@ static void CURVES_OT_sculptmode_toggle(wmOperatorType *ot)
ot->flag = OPTYPE_UNDO | OPTYPE_REGISTER;
}
} // namespace blender::ed::sculpt_paint
/* --------------------------------------------------------------------
* Registration.
*/
void ED_operatortypes_sculpt_curves()
{
using namespace blender::ed::sculpt_paint;
WM_operatortype_append(SCULPT_CURVES_OT_brush_stroke);
WM_operatortype_append(CURVES_OT_sculptmode_toggle);
}