Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/keyframing.c
| Show First 20 Lines • Show All 1,765 Lines • ▼ Show 20 Lines | static int insert_key_button_exec(bContext *C, wmOperator *op) | ||||
| int index; | int index; | ||||
| const bool all = RNA_boolean_get(op->ptr, "all"); | const bool all = RNA_boolean_get(op->ptr, "all"); | ||||
| short flag = 0; | short flag = 0; | ||||
| /* flags for inserting keyframes */ | /* flags for inserting keyframes */ | ||||
| flag = ANIM_get_keyframing_flags(scene, 1); | flag = ANIM_get_keyframing_flags(scene, 1); | ||||
| /* try to insert keyframe using property retrieved from UI */ | /* try to insert keyframe using property retrieved from UI */ | ||||
| but = UI_context_active_but_get(C); | if (!(but = UI_context_active_but_prop_get(C, &ptr, &prop, &index))) { | ||||
| UI_context_active_but_prop_get(C, &ptr, &prop, &index); | /* pass event on if no button found */ | ||||
| return OPERATOR_PASS_THROUGH; | |||||
| } | |||||
| if ((ptr.id.data && ptr.data && prop) && RNA_property_animateable(&ptr, prop)) { | if ((ptr.id.data && ptr.data && prop) && RNA_property_animateable(&ptr, prop)) { | ||||
| if (ptr.type == &RNA_NlaStrip) { | if (ptr.type == &RNA_NlaStrip) { | ||||
| /* Handle special properties for NLA Strips, whose F-Curves are stored on the | /* Handle special properties for NLA Strips, whose F-Curves are stored on the | ||||
| * strips themselves. These are stored separately or else the properties will | * strips themselves. These are stored separately or else the properties will | ||||
| * not have any effect. | * not have any effect. | ||||
| */ | */ | ||||
| NlaStrip *strip = (NlaStrip *)ptr.data; | NlaStrip *strip = (NlaStrip *)ptr.data; | ||||
| ▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | static int delete_key_button_exec(bContext *C, wmOperator *op) | ||||
| PropertyRNA *prop = NULL; | PropertyRNA *prop = NULL; | ||||
| char *path; | char *path; | ||||
| float cfra = (float)CFRA; // XXX for now, don't bother about all the yucky offset crap | float cfra = (float)CFRA; // XXX for now, don't bother about all the yucky offset crap | ||||
| short success = 0; | short success = 0; | ||||
| int index; | int index; | ||||
| const bool all = RNA_boolean_get(op->ptr, "all"); | const bool all = RNA_boolean_get(op->ptr, "all"); | ||||
| /* try to insert keyframe using property retrieved from UI */ | /* try to insert keyframe using property retrieved from UI */ | ||||
| UI_context_active_but_prop_get(C, &ptr, &prop, &index); | if (!UI_context_active_but_prop_get(C, &ptr, &prop, &index)) { | ||||
| /* pass event on if no button found */ | |||||
| return OPERATOR_PASS_THROUGH; | |||||
| } | |||||
| if (ptr.id.data && ptr.data && prop) { | if (ptr.id.data && ptr.data && prop) { | ||||
| if (ptr.type == &RNA_NlaStrip) { | if (ptr.type == &RNA_NlaStrip) { | ||||
| /* Handle special properties for NLA Strips, whose F-Curves are stored on the | /* Handle special properties for NLA Strips, whose F-Curves are stored on the | ||||
| * strips themselves. These are stored separately or else the properties will | * strips themselves. These are stored separately or else the properties will | ||||
| * not have any effect. | * not have any effect. | ||||
| */ | */ | ||||
| ID *id = ptr.id.data; | ID *id = ptr.id.data; | ||||
| ▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | static int clear_key_button_exec(bContext *C, wmOperator *op) | ||||
| PointerRNA ptr = {{NULL}}; | PointerRNA ptr = {{NULL}}; | ||||
| PropertyRNA *prop = NULL; | PropertyRNA *prop = NULL; | ||||
| char *path; | char *path; | ||||
| short success = 0; | short success = 0; | ||||
| int index; | int index; | ||||
| const bool all = RNA_boolean_get(op->ptr, "all"); | const bool all = RNA_boolean_get(op->ptr, "all"); | ||||
| /* try to insert keyframe using property retrieved from UI */ | /* try to insert keyframe using property retrieved from UI */ | ||||
| UI_context_active_but_prop_get(C, &ptr, &prop, &index); | if (!UI_context_active_but_prop_get(C, &ptr, &prop, &index)) { | ||||
| /* pass event on if no button found */ | |||||
| return OPERATOR_PASS_THROUGH; | |||||
| } | |||||
| 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) { | ||||
| if (all) { | if (all) { | ||||
| /* -1 indicates operating on the entire array (or the property itself otherwise) */ | /* -1 indicates operating on the entire array (or the property itself otherwise) */ | ||||
| index = -1; | index = -1; | ||||
| ▲ Show 20 Lines • Show All 283 Lines • Show Last 20 Lines | |||||