Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_tools.c
| Show First 20 Lines • Show All 1,452 Lines • ▼ Show 20 Lines | else { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| ED_undo_push(C, str); | ED_undo_push(C, str); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static const char *OUTLINER_OT_object_operation_event_description(int event) | |||||
| { | |||||
| switch (event) { | |||||
| case OL_OP_SELECT: | |||||
| return "Select"; | |||||
| case OL_OP_DESELECT: | |||||
| return "Deselect"; | |||||
| case OL_OP_SELECT_HIERARCHY: | |||||
| return "Select the entire hierarchy"; | |||||
| case OL_OP_DELETE: | |||||
| return "Delete"; | |||||
| case OL_OP_DELETE_HIERARCHY: | |||||
| return "Delete the entire hierarchy"; | |||||
| case OL_OP_REMAP: | |||||
| return "Remap"; | |||||
| case OL_OP_TOGVIS: | |||||
| return "Toggle visibility"; | |||||
| case OL_OP_TOGSEL: | |||||
| return "Toggle selectability"; | |||||
| case OL_OP_TOGREN: | |||||
| return "Toggle renderability"; | |||||
| case OL_OP_RENAME: | |||||
| return "Rename object"; | |||||
| case OL_OP_OBJECT_MODE_ENTER: | |||||
| return "Enter object mode"; | |||||
| case OL_OP_OBJECT_MODE_EXIT: | |||||
| return "Exit object mode"; | |||||
| default: | |||||
| return ""; | |||||
| }; | |||||
| } | |||||
| static char *OUTLINER_OT_object_operation_description(bContext *UNUSED(C), | |||||
| wmOperatorType *UNUSED(ot), | |||||
| PointerRNA *ptr) | |||||
| { | |||||
| int event = RNA_enum_get(ptr, "type"); | |||||
| const char *description = OUTLINER_OT_object_operation_event_description(event); | |||||
| const int size = BLI_strnlen(description, 64); | |||||
| char *r_description = MEM_mallocN(size + 1, __func__); | |||||
| BLI_strncpy(r_description, description, size); | |||||
| return r_description; | |||||
| } | |||||
| void OUTLINER_OT_object_operation(wmOperatorType *ot) | void OUTLINER_OT_object_operation(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Outliner Object Operation"; | ot->name = "Outliner Object Operation"; | ||||
| ot->idname = "OUTLINER_OT_object_operation"; | ot->idname = "OUTLINER_OT_object_operation"; | ||||
| ot->get_description = OUTLINER_OT_object_operation_description; | |||||
| /* callbacks */ | /* callbacks */ | ||||
| ot->invoke = WM_menu_invoke; | ot->invoke = WM_menu_invoke; | ||||
| ot->exec = outliner_object_operation_exec; | ot->exec = outliner_object_operation_exec; | ||||
| ot->poll = ED_operator_outliner_active; | ot->poll = ED_operator_outliner_active; | ||||
| ot->flag = 0; | ot->flag = 0; | ||||
| ▲ Show 20 Lines • Show All 980 Lines • Show Last 20 Lines | |||||