Commit: 10488d54d9836b04f36d95269552bd449dd97e7e
Author: Hans Goudey
Date: Thu Jun 2 18:02:48 2022 +0200
Branches: master
https://developer.blender.org/rB10488d54d9836b04f36d95269552bd449dd97e7e
Cleanup: Use const pointers
===================================================================
M source/blender/editors/sculpt_paint/curves_sculpt_ops.cc
===================================================================
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc
b/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc
index aa2ec54c73f..dc3dacf9c81 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_ops.cc
@@ -49,7 +49,7 @@
bool CURVES_SCULPT_mode_poll(bContext *C)
{
- Object *ob = CTX_data_active_object(C);
+ const Object *ob = CTX_data_active_object(C);
return ob && ob->mode & OB_MODE_SCULPT_CURVES;
}
@@ -109,9 +109,9 @@ static std::unique_ptr<CurvesSculptStrokeOperation>
start_brush_operation(bConte
{
const BrushStrokeMode mode =
static_cast<BrushStrokeMode>(RNA_enum_get(op.ptr, "mode"));
- Scene &scene = *CTX_data_scene(&C);
- CurvesSculpt &curves_sculpt = *scene.toolsettings->curves_sculpt;
- Brush &brush = *BKE_paint_brush(&curves_sculpt.paint);
+ const Scene &scene = *CTX_data_scene(&C);
+ const CurvesSculpt &curves_sculpt = *scene.toolsettings->curves_sculpt;
+ const Brush &brush = *BKE_paint_brush_for_read(&curves_sculpt.paint);
switch (brush.curves_sculpt_tool) {
case CURVES_SCULPT_TOOL_COMB:
return new_comb_operation();
@@ -182,8 +182,8 @@ static void stroke_done(const bContext *C, PaintStroke
*stroke)
static int sculpt_curves_stroke_invoke(bContext *C, wmOperator *op, const
wmEvent *event)
{
- Paint *paint = BKE_paint_get_active_from_context(C);
- Brush *brush = BKE_paint_brush(paint);
+ const Paint *paint = BKE_paint_get_active_from_context(C);
+ const Brush *brush = BKE_paint_brush_for_read(paint);
if (brush == nullptr) {
return OPERATOR_CANCELLED;
}
@@ -252,7 +252,7 @@ static void SCULPT_CURVES_OT_brush_stroke(struct
wmOperatorType *ot)
static bool curves_sculptmode_toggle_poll(bContext *C)
{
- Object *ob = CTX_data_active_object(C);
+ const Object *ob = CTX_data_active_object(C);
if (ob == nullptr) {
return false;
}
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs