Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_data.c
| Show First 20 Lines • Show All 1,462 Lines • ▼ Show 20 Lines | static int gpencil_layer_change_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | ||||
| UI_popup_menu_end(C, pup); | UI_popup_menu_end(C, pup); | ||||
| return OPERATOR_INTERFACE; | return OPERATOR_INTERFACE; | ||||
| } | } | ||||
| static int gpencil_layer_change_exec(bContext *C, wmOperator *op) | static int gpencil_layer_change_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| bGPdata *gpd = CTX_data_gpencil_data(C); | bGPdata *gpd = CTX_data_gpencil_data(C); | ||||
| if (gpd == NULL) { | |||||
| return OPERATOR_CANCELLED; | |||||
| } | |||||
| bGPDlayer *gpl = NULL; | bGPDlayer *gpl = NULL; | ||||
| int layer_num = RNA_enum_get(op->ptr, "layer"); | int layer_num = RNA_enum_get(op->ptr, "layer"); | ||||
| /* Get layer or create new one */ | /* Get layer or create new one */ | ||||
| if (layer_num == -1) { | if (layer_num == -1) { | ||||
| /* Create layer */ | /* Create layer */ | ||||
| gpl = BKE_gpencil_layer_addnew(gpd, DATA_("GP_Layer"), true, false); | gpl = BKE_gpencil_layer_addnew(gpd, DATA_("GP_Layer"), true, false); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,423 Lines • Show Last 20 Lines | |||||