Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/keyingsets.c
| Show First 20 Lines • Show All 321 Lines • ▼ Show 20 Lines | else if (scene->active_keyingset < 0) { | ||||
| BKE_report(op->reports, RPT_ERROR, "Cannot add property to built in keying set"); | BKE_report(op->reports, RPT_ERROR, "Cannot add property to built in keying set"); | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| else { | else { | ||||
| ks = BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1); | ks = BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1); | ||||
| } | } | ||||
| /* try to add to keyingset using property retrieved from UI */ | /* try to add to keyingset using property retrieved from UI */ | ||||
| uiContextActiveProperty(C, &ptr, &prop, &index); | UI_context_active_but_prop_get(C, &ptr, &prop, &index); | ||||
| /* check if property is able to be added */ | /* check if property is able to be added */ | ||||
| if (ptr.id.data && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { | if (ptr.id.data && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { | ||||
| path = RNA_path_from_ID_to_property(&ptr, prop); | path = RNA_path_from_ID_to_property(&ptr, prop); | ||||
| if (path) { | if (path) { | ||||
| /* set flags */ | /* set flags */ | ||||
| if (all) { | if (all) { | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | else if (scene->active_keyingset < 0) { | ||||
| BKE_report(op->reports, RPT_ERROR, "Cannot remove property from built in keying set"); | BKE_report(op->reports, RPT_ERROR, "Cannot remove property from built in keying set"); | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| else { | else { | ||||
| ks = BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1); | ks = BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1); | ||||
| } | } | ||||
| /* try to add to keyingset using property retrieved from UI */ | /* try to add to keyingset using property retrieved from UI */ | ||||
| uiContextActiveProperty(C, &ptr, &prop, &index); | UI_context_active_but_prop_get(C, &ptr, &prop, &index); | ||||
| if (ptr.id.data && ptr.data && prop) { | if (ptr.id.data && ptr.data && prop) { | ||||
| path = RNA_path_from_ID_to_property(&ptr, prop); | path = RNA_path_from_ID_to_property(&ptr, prop); | ||||
| if (path) { | if (path) { | ||||
| KS_Path *ksp; | KS_Path *ksp; | ||||
| /* try to find a path matching this description */ | /* try to find a path matching this description */ | ||||
| ▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
| /* This operator checks if a menu should be shown for choosing the KeyingSet to make the active one */ | /* This operator checks if a menu should be shown for choosing the KeyingSet to make the active one */ | ||||
| static int keyingset_active_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | static int keyingset_active_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | ||||
| { | { | ||||
| uiPopupMenu *pup; | uiPopupMenu *pup; | ||||
| uiLayout *layout; | uiLayout *layout; | ||||
| /* call the menu, which will call this operator again, hence the canceled */ | /* call the menu, which will call this operator again, hence the canceled */ | ||||
| pup = uiPupMenuBegin(C, op->type->name, ICON_NONE); | pup = UI_popup_menu_begin(C, op->type->name, ICON_NONE); | ||||
| layout = uiPupMenuLayout(pup); | layout = UI_popup_menu_layout(pup); | ||||
| uiItemsEnumO(layout, "ANIM_OT_keying_set_active_set", "type"); | uiItemsEnumO(layout, "ANIM_OT_keying_set_active_set", "type"); | ||||
| uiPupMenuEnd(C, pup); | UI_popup_menu_end(C, pup); | ||||
| return OPERATOR_INTERFACE; | return OPERATOR_INTERFACE; | ||||
| } | } | ||||
| static int keyingset_active_menu_exec(bContext *C, wmOperator *op) | static int keyingset_active_menu_exec(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| int type = RNA_enum_get(op->ptr, "type"); | int type = RNA_enum_get(op->ptr, "type"); | ||||
| ▲ Show 20 Lines • Show All 541 Lines • Show Last 20 Lines | |||||