Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_data.c
| Show First 20 Lines • Show All 325 Lines • ▼ Show 20 Lines | static int gp_layer_remove_exec(bContext *C, wmOperator *op) | ||||
| BKE_gpencil_layer_delete(gpd, gpl); | BKE_gpencil_layer_delete(gpd, gpl); | ||||
| /* Reorder masking. */ | /* Reorder masking. */ | ||||
| BKE_gpencil_layer_mask_sort_all(gpd); | BKE_gpencil_layer_mask_sort_all(gpd); | ||||
| /* notifiers */ | /* notifiers */ | ||||
| DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | ||||
| WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | ||||
| WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL); | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void GPENCIL_OT_layer_remove(wmOperatorType *ot) | void GPENCIL_OT_layer_remove(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Remove Layer"; | ot->name = "Remove Layer"; | ||||
| ▲ Show 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | BLI_uniquename(&gpd->layers, | ||||
| '.', | '.', | ||||
| offsetof(bGPDlayer, info), | offsetof(bGPDlayer, info), | ||||
| sizeof(new_layer->info)); | sizeof(new_layer->info)); | ||||
| BKE_gpencil_layer_active_set(gpd, new_layer); | BKE_gpencil_layer_active_set(gpd, new_layer); | ||||
| /* notifiers */ | /* notifiers */ | ||||
| DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | ||||
| WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | ||||
| WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL); | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void GPENCIL_OT_layer_duplicate(wmOperatorType *ot) | void GPENCIL_OT_layer_duplicate(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Duplicate Layer"; | ot->name = "Duplicate Layer"; | ||||
| ▲ Show 20 Lines • Show All 734 Lines • ▼ Show 20 Lines | static int gp_merge_layer_exec(bContext *C, wmOperator *op) | ||||
| BLI_ghash_free(gh_frames_cur, NULL, NULL); | BLI_ghash_free(gh_frames_cur, NULL, NULL); | ||||
| /* Reorder masking. */ | /* Reorder masking. */ | ||||
| BKE_gpencil_layer_mask_sort(gpd, gpl_current); | BKE_gpencil_layer_mask_sort(gpd, gpl_current); | ||||
| /* notifiers */ | /* notifiers */ | ||||
| DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | ||||
| WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | ||||
| WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL); | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void GPENCIL_OT_layer_merge(wmOperatorType *ot) | void GPENCIL_OT_layer_merge(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Merge Down"; | ot->name = "Merge Down"; | ||||
| ▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | static int gp_layer_change_exec(bContext *C, wmOperator *op) | ||||
| } | } | ||||
| /* Set active layer */ | /* Set active layer */ | ||||
| BKE_gpencil_layer_active_set(gpd, gpl); | BKE_gpencil_layer_active_set(gpd, gpl); | ||||
| /* updates */ | /* updates */ | ||||
| DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | ||||
| WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | ||||
| WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL); | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void GPENCIL_OT_layer_change(wmOperatorType *ot) | void GPENCIL_OT_layer_change(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Change Layer"; | ot->name = "Change Layer"; | ||||
| Show All 29 Lines | static int gp_layer_active_exec(bContext *C, wmOperator *op) | ||||
| } | } | ||||
| /* Set active layer */ | /* Set active layer */ | ||||
| BKE_gpencil_layer_active_set(gpd, gpl); | BKE_gpencil_layer_active_set(gpd, gpl); | ||||
| /* updates */ | /* updates */ | ||||
| DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); | ||||
| WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); | ||||
| WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL); | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void GPENCIL_OT_layer_active(wmOperatorType *ot) | void GPENCIL_OT_layer_active(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Active Layer"; | ot->name = "Active Layer"; | ||||
| ▲ Show 20 Lines • Show All 2,138 Lines • Show Last 20 Lines | |||||