Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mask/mask_ops.c
| Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | switch (area->spacetype) { | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return mask; | return mask; | ||||
| } | } | ||||
| /** | |||||
| * Get active layer. Will create mask/layer to be sure there's an active layer. | |||||
| */ | |||||
| MaskLayer *ED_mask_layer_ensure(bContext *C, bool *r_added_mask) | MaskLayer *ED_mask_layer_ensure(bContext *C, bool *r_added_mask) | ||||
| { | { | ||||
| Mask *mask = CTX_data_edit_mask(C); | Mask *mask = CTX_data_edit_mask(C); | ||||
| MaskLayer *mask_layer; | MaskLayer *mask_layer; | ||||
| if (mask == NULL) { | if (mask == NULL) { | ||||
| /* If there's no active mask, create one. */ | /* If there's no active mask, create one. */ | ||||
| mask = ED_mask_new(C, NULL); | mask = ED_mask_new(C, NULL); | ||||
| ▲ Show 20 Lines • Show All 1,514 Lines • ▼ Show 20 Lines | if (changed) { | ||||
| WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask); | WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| /* Named to match mesh recalculate normals. */ | |||||
| void MASK_OT_normals_make_consistent(wmOperatorType *ot) | void MASK_OT_normals_make_consistent(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Recalculate Handles"; | ot->name = "Recalculate Handles"; | ||||
| ot->description = "Recalculate the direction of selected handles"; | ot->description = "Recalculate the direction of selected handles"; | ||||
| ot->idname = "MASK_OT_normals_make_consistent"; | ot->idname = "MASK_OT_normals_make_consistent"; | ||||
| /* api callbacks */ | /* api callbacks */ | ||||
| ▲ Show 20 Lines • Show All 511 Lines • Show Last 20 Lines | |||||