Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_stroke.c
| Show First 20 Lines • Show All 903 Lines • ▼ Show 20 Lines | PaintStroke *paint_stroke_new(bContext *C, | ||||
| BKE_paint_set_overlay_override(br->overlay_flags); | BKE_paint_set_overlay_override(br->overlay_flags); | ||||
| return stroke; | return stroke; | ||||
| } | } | ||||
| void paint_stroke_free(bContext *C, wmOperator *op) | void paint_stroke_free(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| RegionView3D *rv3d = CTX_wm_region_view3d(C); | RegionView3D *rv3d = CTX_wm_region_view3d(C); | ||||
| if (rv3d) { | |||||
| rv3d->rflag &= ~RV3D_PAINTING; | |||||
| } | |||||
| BKE_paint_set_overlay_override(0); | |||||
| PaintStroke *stroke = op->customdata; | PaintStroke *stroke = op->customdata; | ||||
| UnifiedPaintSettings *ups = stroke->ups; | if (!stroke) { | ||||
brecht: Convention is to use `if (stroke == NULL)` | |||||
| return; | |||||
| } | |||||
| UnifiedPaintSettings *ups = stroke->ups; | |||||
| ups->draw_anchored = false; | ups->draw_anchored = false; | ||||
| ups->stroke_active = false; | ups->stroke_active = false; | ||||
| if (rv3d) { | |||||
| rv3d->rflag &= ~RV3D_PAINTING; | |||||
| } | |||||
| if (stroke->timer) { | if (stroke->timer) { | ||||
| WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), stroke->timer); | WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), stroke->timer); | ||||
| } | } | ||||
| if (stroke->rng) { | if (stroke->rng) { | ||||
| BLI_rng_free(stroke->rng); | BLI_rng_free(stroke->rng); | ||||
| } | } | ||||
| if (stroke->stroke_cursor) { | if (stroke->stroke_cursor) { | ||||
| WM_paint_cursor_end(CTX_wm_manager(C), stroke->stroke_cursor); | WM_paint_cursor_end(CTX_wm_manager(C), stroke->stroke_cursor); | ||||
| } | } | ||||
| BLI_freelistN(&stroke->line); | BLI_freelistN(&stroke->line); | ||||
| BKE_paint_set_overlay_override(0); | |||||
| MEM_SAFE_FREE(op->customdata); | MEM_SAFE_FREE(op->customdata); | ||||
| } | } | ||||
| static void stroke_done(bContext *C, wmOperator *op) | static void stroke_done(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| PaintStroke *stroke = op->customdata; | PaintStroke *stroke = op->customdata; | ||||
| UnifiedPaintSettings *ups = stroke->ups; | UnifiedPaintSettings *ups = stroke->ups; | ||||
| ▲ Show 20 Lines • Show All 621 Lines • Show Last 20 Lines | |||||
Convention is to use if (stroke == NULL)