diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-03-18 04:48:59 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-03-18 04:48:59 +0400 |
commit | c1ceab1281ccf061f03f8000bf190a082a5385d8 (patch) | |
tree | 01b9a9cfca80432d316bdad6c18c74eb025e9eb0 /source/blender/editors/animation | |
parent | 0d9c98c4bbfbc8c70c4772086dd09a51d01921ef (diff) | |
parent | 66a35e089a64d27bfc09c2225a530069eca05875 (diff) |
Merged changes in the trunk up to revision 55357.
Resolved conflicts:
release/datafiles/startup.blend
source/blender/editors/space_nla/nla_buttons.c
Also updated source/blender/blenkernel/intern/linestyle.c as a follow-up of
recent changes for the use of bool.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_channels_defines.c | 42 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 8 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 41 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_ipo_utils.c | 6 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 95 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 27 | ||||
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 4 |
8 files changed, 142 insertions, 87 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 533420ad641..d6188720cdf 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -384,6 +384,10 @@ static short acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListEle case ACHANNEL_SETTING_MUTE: return ((ac) && (ac->spacetype == SPACE_NLA)); + /* select is ok for most "ds*" channels (e.g. dsmat) */ + case ACHANNEL_SETTING_SELECT: + return 1; + /* other flags are never supported */ default: return 0; @@ -425,7 +429,7 @@ static void acf_summary_backdrop(bAnimContext *ac, bAnimListElem *ale, float ymi static void acf_summary_name(bAnimListElem *UNUSED(ale), char *name) { if (name) - BLI_strncpy(name, "DopeSheet Summary", ANIM_CHAN_NAME_SIZE); + BLI_strncpy(name, IFACE_("DopeSheet Summary"), ANIM_CHAN_NAME_SIZE); } // FIXME: this is really a temp icon I think @@ -896,6 +900,27 @@ static void acf_fcurve_name(bAnimListElem *ale, char *name) getname_anim_fcurve(name, ale->id, ale->data); } +/* "name" property for fcurve entries */ +static short acf_fcurve_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop) +{ + FCurve *fcu = (FCurve *)ale->data; + + /* Ctrl-Click Usability Convenience Hack: + * For disabled F-Curves, allow access to the RNA Path + * as our "name" so that user can perform quick fixes + */ + if (fcu->flag & FCURVE_DISABLED) { + RNA_pointer_create(ale->id, &RNA_FCurve, ale->data, ptr); + *prop = RNA_struct_find_property(ptr, "data_path"); + } + else { + /* for "normal" F-Curves - no editable name, but *prop may not be set properly yet... */ + *prop = NULL; + } + + return (*prop != NULL); +} + /* check if some setting exists for this channel */ static short acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting) { @@ -967,7 +992,7 @@ static bAnimChannelType ACF_FCURVE = acf_generic_group_offset, /* offset */ acf_fcurve_name, /* name */ - NULL, /* name prop */ + acf_fcurve_name_prop, /* name prop */ NULL, /* icon */ acf_fcurve_setting_valid, /* has setting */ @@ -1070,7 +1095,7 @@ static int acf_filldrivers_icon(bAnimListElem *UNUSED(ale)) static void acf_filldrivers_name(bAnimListElem *UNUSED(ale), char *name) { - BLI_strncpy(name, "Drivers", ANIM_CHAN_NAME_SIZE); + BLI_strncpy(name, IFACE_("Drivers"), ANIM_CHAN_NAME_SIZE); } /* check if some setting exists for this channel */ @@ -2338,7 +2363,7 @@ static void acf_shapekey_name(bAnimListElem *ale, char *name) if (kb->name[0]) BLI_strncpy(name, kb->name, ANIM_CHAN_NAME_SIZE); else - BLI_snprintf(name, ANIM_CHAN_NAME_SIZE, "Key %d", ale->index); + BLI_snprintf(name, ANIM_CHAN_NAME_SIZE, IFACE_("Key %d"), ale->index); } } @@ -3490,10 +3515,13 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale /* if rename index matches, add widget for this */ if (ac->ads->renameIndex == channel_index + 1) { - PointerRNA ptr; - PropertyRNA *prop; + PointerRNA ptr = {{NULL}}; + PropertyRNA *prop = NULL; - /* draw renaming widget if we can get RNA pointer for it */ + /* draw renaming widget if we can get RNA pointer for it + * NOTE: property may only be available in some cases, even if we have + * a callback available (e.g. broken F-Curve rename) + */ if (acf->name_prop(ale, &ptr, &prop)) { uiBut *but; diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 15a8222dec2..dd18d07732d 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -2272,7 +2272,7 @@ static void rename_anim_channels(bAnimContext *ac, int channel_index) ED_region_tag_redraw(ac->ar); } -static int animchannels_rename_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *evt) +static int animchannels_rename_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { bAnimContext ac; ARegion *ar; @@ -2293,7 +2293,7 @@ static int animchannels_rename_invoke(bContext *C, wmOperator *UNUSED(op), wmEve * so that the tops of channels get caught ok. Since ACHANNEL_FIRST is really ACHANNEL_HEIGHT, we simply use * ACHANNEL_HEIGHT_HALF. */ - UI_view2d_region_to_view(v2d, evt->mval[0], evt->mval[1], &x, &y); + UI_view2d_region_to_view(v2d, event->mval[0], event->mval[1], &x, &y); if (ac.datatype == ANIMCONT_NLA) { SpaceNla *snla = (SpaceNla *)ac.sl; @@ -2609,7 +2609,7 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in /* ------------------- */ /* handle clicking */ -static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, const wmEvent *event) { bAnimContext ac; ARegion *ar; @@ -2667,7 +2667,7 @@ static void ANIM_OT_channels_click(wmOperatorType *ot) ot->poll = animedit_poll_channels_active; /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + ot->flag = OPTYPE_UNDO; /* properties */ /* NOTE: don't save settings, otherwise, can end up with some weird behaviour (sticky extend) */ diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 3480db2c5d8..7648d998216 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -449,7 +449,7 @@ short ANIM_animdata_get_context(const bContext *C, bAnimContext *ac) if (ANIMDATA_HAS_NLA(id)) { \ nlaOk \ } \ - else if (!(ads->filterflag & ADS_FILTER_NLA_NOACT) && ANIMDATA_HAS_KEYS(id)) { \ + else if (!(ads->filterflag & ADS_FILTER_NLA_NOACT) || ANIMDATA_HAS_KEYS(id)) { \ nlaOk \ } \ } \ @@ -1001,22 +1001,39 @@ static short skip_fcurve_with_name(bDopeSheet *ads, FCurve *fcu, ID *owner_id) /* Check if F-Curve has errors and/or is disabled * > returns: (bool) True if F-Curve has errors/is disabled */ -static short fcurve_has_errors(FCurve *fcu) +static bool fcurve_has_errors(FCurve *fcu) { /* F-Curve disabled - path eval error */ if (fcu->flag & FCURVE_DISABLED) { - return 1; + return true; } /* driver? */ if (fcu->driver) { - /* for now, just check if the entire thing got disabled... */ - if (fcu->driver->flag & DRIVER_FLAG_INVALID) - return 1; + ChannelDriver *driver = fcu->driver; + DriverVar *dvar; + + /* error flag on driver usually means that there is an error + * BUT this may not hold with PyDrivers as this flag gets cleared + * if no critical errors prevent the driver from working... + */ + if (driver->flag & DRIVER_FLAG_INVALID) + return true; + + /* check variables for other things that need linting... */ + // TODO: maybe it would be more efficient just to have a quick flag for this? + for (dvar = driver->variables.first; dvar; dvar = dvar->next) { + DRIVER_TARGETS_USED_LOOPER(dvar) + { + if (dtar->flag & DTAR_FLAG_INVALID) + return true; + } + DRIVER_TARGETS_LOOPER_END + } } /* no errors found */ - return 0; + return false; } /* find the next F-Curve that is usable for inclusion */ @@ -1060,7 +1077,7 @@ static FCurve *animfilter_fcurve_next(bDopeSheet *ads, FCurve *first, bActionGro /* error-based filtering... */ if ((ads) && (ads->filterflag & ADS_FILTER_ONLY_ERRORS)) { /* skip if no errors... */ - if (fcurve_has_errors(fcu) == 0) + if (fcurve_has_errors(fcu) == false) continue; } @@ -1297,7 +1314,9 @@ static size_t animfilter_block_data(bAnimContext *ac, ListBase *anim_data, bDope ANIMDATA_FILTER_CASES(iat, { /* AnimData */ /* specifically filter animdata block */ - ANIMCHANNEL_NEW_CHANNEL(adt, ANIMTYPE_ANIMDATA, id); + if (ANIMCHANNEL_SELOK(SEL_ANIMDATA(adt)) ) { + ANIMCHANNEL_NEW_CHANNEL(adt, ANIMTYPE_ANIMDATA, id); + } }, { /* NLA */ items += animfilter_nla(ac, anim_data, ads, adt, filter_mode, id); @@ -1347,7 +1366,9 @@ static size_t animdata_filter_shapekey(bAnimContext *ac, ListBase *anim_data, Ke // TODO: somehow manage to pass dopesheet info down here too? if (key->adt) { if (filter_mode & ANIMFILTER_ANIMDATA) { - ANIMCHANNEL_NEW_CHANNEL(key->adt, ANIMTYPE_ANIMDATA, key); + if (ANIMCHANNEL_SELOK(SEL_ANIMDATA(key->adt)) ) { + ANIMCHANNEL_NEW_CHANNEL(key->adt, ANIMTYPE_ANIMDATA, key); + } } else if (key->adt->action) { items = animfilter_action(ac, anim_data, NULL, key->adt->action, filter_mode, (ID *)key); diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index b6d24e21057..2352cad0cbc 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -42,6 +42,8 @@ #include "BLI_math.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "DNA_anim_types.h" #include "RNA_access.h" @@ -63,9 +65,9 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) return icon; else if (ELEM3(NULL, id, fcu, fcu->rna_path)) { if (fcu == NULL) - strcpy(name, "<invalid>"); + strcpy(name, IFACE_("<invalid>")); else if (fcu->rna_path == NULL) - strcpy(name, "<no path>"); + strcpy(name, IFACE_("<no path>")); else /* id == NULL */ BLI_snprintf(name, 256, "%s[%d]", fcu->rna_path, fcu->array_index); } diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 62725cb6c70..7a3fc3a8d9b 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -28,7 +28,6 @@ * \ingroup edanimation */ - #include <math.h> #include "MEM_guardedalloc.h" @@ -36,10 +35,6 @@ #include "DNA_scene_types.h" #include "DNA_object_types.h" -#include "RNA_access.h" -#include "RNA_define.h" -#include "RNA_enum_types.h" - #include "BLI_blenlib.h" #include "BLI_math_base.h" #include "BLI_utildefines.h" @@ -51,6 +46,10 @@ #include "BKE_scene.h" #include "BKE_screen.h" +#include "RNA_access.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + #include "WM_api.h" #include "WM_types.h" @@ -277,7 +276,9 @@ static void add_marker_to_cfra_elem(ListBase *lb, TimeMarker *marker, short only ce->sel = marker->flag; return; } - else if (ce->cfra > marker->frame) break; + else if (ce->cfra > marker->frame) { + break; + } } cen = MEM_callocN(sizeof(CfraElem), "add_to_cfra_elem"); @@ -513,8 +514,8 @@ static int ed_markers_poll_markers_exist(bContext *C) * that operator would otherwise have used. If NULL, the operator's standard * exec() callback will be called instead in the appropriate places. */ -static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, wmEvent *evt, - int (*invoke_func)(bContext *, wmOperator *, wmEvent *)) +static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, const wmEvent *event, + int (*invoke_func)(bContext *, wmOperator *, const wmEvent *)) { ScrArea *sa = CTX_wm_area(C); int retval = OPERATOR_PASS_THROUGH; @@ -523,7 +524,7 @@ static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, wmEvent /* allow operator to run now */ if (invoke_func) - retval = invoke_func(C, op, evt); + retval = invoke_func(C, op, event); else if (op->type->exec) retval = op->type->exec(C, op); else @@ -544,9 +545,9 @@ static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, wmEvent * though will need to implement their own wrapper which calls the second-tier callback themselves * (passing through the custom invoke function they use) */ -static int ed_markers_opwrap_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_markers_opwrap_invoke(bContext *C, wmOperator *op, const wmEvent *event) { - return ed_markers_opwrap_invoke_custom(C, op, evt, NULL); + return ed_markers_opwrap_invoke_custom(C, op, event, NULL); } /* ************************** add markers *************************** */ @@ -684,14 +685,14 @@ static void ed_marker_move_exit(bContext *C, wmOperator *op) ED_area_headerprint(CTX_wm_area(C), NULL); } -static int ed_marker_move_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_move_invoke(bContext *C, wmOperator *op, const wmEvent *event) { if (ed_marker_move_init(C, op)) { MarkerMove *mm = op->customdata; - mm->evtx = evt->x; - mm->firstx = evt->x; - mm->event_type = evt->type; + mm->evtx = event->x; + mm->firstx = event->x; + mm->event_type = event->type; /* add temp handler */ WM_event_add_modal_handler(C, op); @@ -705,9 +706,9 @@ static int ed_marker_move_invoke(bContext *C, wmOperator *op, wmEvent *evt) return OPERATOR_CANCELLED; } -static int ed_marker_move_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_move_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { - return ed_markers_opwrap_invoke_custom(C, op, evt, ed_marker_move_invoke); + return ed_markers_opwrap_invoke_custom(C, op, event, ed_marker_move_invoke); } /* note, init has to be called succesfully */ @@ -756,7 +757,7 @@ static int ed_marker_move_cancel(bContext *C, wmOperator *op) -static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *event) { Scene *scene = CTX_data_scene(C); MarkerMove *mm = op->customdata; @@ -765,14 +766,14 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) float dx, fac; char str[256]; - switch (evt->type) { + switch (event->type) { case ESCKEY: ed_marker_move_cancel(C, op); return OPERATOR_CANCELLED; case RIGHTMOUSE: /* press = user manually demands transform to be canceled */ - if (evt->val == KM_PRESS) { + if (event->val == KM_PRESS) { ed_marker_move_cancel(C, op); return OPERATOR_CANCELLED; } @@ -782,7 +783,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) case PADENTER: case LEFTMOUSE: case MIDDLEMOUSE: - if (WM_modal_tweak_exit(evt, mm->event_type)) { + if (WM_modal_tweak_exit(event, mm->event_type)) { ed_marker_move_exit(C, op); WM_event_add_notifier(C, NC_SCENE | ND_MARKERS, NULL); WM_event_add_notifier(C, NC_ANIMATION | ND_MARKERS, NULL); @@ -795,17 +796,17 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) dx = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask); - if (evt->x != mm->evtx) { /* XXX maybe init for first time */ + if (event->x != mm->evtx) { /* XXX maybe init for first time */ int a, offs, totmark = 0; - mm->evtx = evt->x; + mm->evtx = event->x; - fac = ((float)(evt->x - mm->firstx) * dx); + fac = ((float)(event->x - mm->firstx) * dx); if (mm->slink->spacetype == SPACE_TIME) - apply_keyb_grid(evt->shift, evt->ctrl, &fac, 0.0, FPS, 0.1 * FPS, 0); + apply_keyb_grid(event->shift, event->ctrl, &fac, 0.0, FPS, 0.1 * FPS, 0); else - apply_keyb_grid(evt->shift, evt->ctrl, &fac, 0.0, 1.0, 0.1, 0 /*was: U.flag & USER_AUTOGRABGRID*/); + apply_keyb_grid(event->shift, event->ctrl, &fac, 0.0, 1.0, 0.1, 0 /*was: U.flag & USER_AUTOGRABGRID*/); offs = (int)fac; RNA_int_set(op->ptr, "frames", offs); @@ -864,8 +865,8 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) } } - if (evt->val == KM_PRESS) { - if (handleNumInput(&mm->num, evt)) { + if (event->val == KM_PRESS) { + if (handleNumInput(&mm->num, event)) { char str_tx[NUM_STR_REP_LEN]; float value = RNA_int_get(op->ptr, "frames"); applyNumInput(&mm->num, &value); @@ -981,15 +982,15 @@ static int ed_marker_duplicate_exec(bContext *C, wmOperator *op) } -static int ed_marker_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_duplicate_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ed_marker_duplicate_apply(C); - return ed_marker_move_invoke(C, op, evt); + return ed_marker_move_invoke(C, op, event); } -static int ed_marker_duplicate_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_duplicate_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { - return ed_markers_opwrap_invoke_custom(C, op, evt, ed_marker_duplicate_invoke); + return ed_markers_opwrap_invoke_custom(C, op, event, ed_marker_duplicate_invoke); } static void MARKER_OT_duplicate(wmOperatorType *ot) @@ -1036,7 +1037,7 @@ static void select_timeline_marker_frame(ListBase *markers, int frame, unsigned } } -static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera) +static int ed_marker_select(bContext *C, const wmEvent *event, int extend, int camera) { ListBase *markers = ED_context_get_markers(C); ARegion *ar = CTX_wm_region(C); @@ -1047,8 +1048,8 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera) if (markers == NULL) return OPERATOR_PASS_THROUGH; - x = evt->x - ar->winrct.xmin; - y = evt->y - ar->winrct.ymin; + x = event->x - ar->winrct.xmin; + y = event->y - ar->winrct.ymin; UI_view2d_region_to_view(v2d, x, y, &viewx, NULL); @@ -1103,19 +1104,19 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera) return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; } -static int ed_marker_select_invoke(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) { short extend = RNA_boolean_get(op->ptr, "extend"); short camera = 0; #ifdef DURIAN_CAMERA_SWITCH camera = RNA_boolean_get(op->ptr, "camera"); #endif - return ed_marker_select(C, evt, extend, camera); + return ed_marker_select(C, event, extend, camera); } -static int ed_marker_select_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_select_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { - return ed_markers_opwrap_invoke_custom(C, op, evt, ed_marker_select_invoke); + return ed_markers_opwrap_invoke_custom(C, op, event, ed_marker_select_invoke); } static void MARKER_OT_select(wmOperatorType *ot) @@ -1200,9 +1201,9 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op) return 1; } -static int ed_marker_select_border_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_select_border_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { - return ed_markers_opwrap_invoke_custom(C, op, evt, WM_border_select_invoke); + return ed_markers_opwrap_invoke_custom(C, op, event, WM_border_select_invoke); } static void MARKER_OT_select_border(wmOperatorType *ot) @@ -1309,10 +1310,10 @@ static int ed_marker_delete_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int ed_marker_delete_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_delete_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { // XXX: must we keep these confirmations? - return ed_markers_opwrap_invoke_custom(C, op, evt, WM_operator_confirm); + return ed_markers_opwrap_invoke_custom(C, op, event, WM_operator_confirm); } static void MARKER_OT_delete(wmOperatorType *ot) @@ -1352,7 +1353,7 @@ static int ed_marker_rename_exec(bContext *C, wmOperator *op) } } -static int ed_marker_rename_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_rename_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { /* must initialize the marker name first if there is a marker selected */ TimeMarker *marker = ED_markers_get_first_selected(ED_context_get_markers(C)); @@ -1360,7 +1361,7 @@ static int ed_marker_rename_invoke_wrapper(bContext *C, wmOperator *op, wmEvent RNA_string_set(op->ptr, "name", marker->name); /* now see if the operator is usable */ - return ed_markers_opwrap_invoke_custom(C, op, evt, WM_operator_props_popup); + return ed_markers_opwrap_invoke_custom(C, op, event, WM_operator_props_popup); } static void MARKER_OT_rename(wmOperatorType *ot) @@ -1414,9 +1415,9 @@ static int ed_marker_make_links_scene_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static int ed_marker_make_links_scene_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *evt) +static int ed_marker_make_links_scene_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { - return ed_markers_opwrap_invoke_custom(C, op, evt, WM_menu_invoke); + return ed_markers_opwrap_invoke_custom(C, op, event, WM_menu_invoke); } static void MARKER_OT_make_links_scene(wmOperatorType *ot) diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 6687cce88cd..b9a3daa4e51 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -115,7 +115,7 @@ static int change_frame_exec(bContext *C, wmOperator *op) /* ---- */ /* Get frame from mouse coordinates */ -static int frame_from_event(bContext *C, wmEvent *event) +static int frame_from_event(bContext *C, const wmEvent *event) { ARegion *region = CTX_wm_region(C); float viewx; @@ -128,7 +128,7 @@ static int frame_from_event(bContext *C, wmEvent *event) } /* Modal Operator init */ -static int change_frame_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event) { /* Change to frame that mouse is over before adding modal handler, * as user could click on a single frame (jump to frame) as well as @@ -145,7 +145,7 @@ static int change_frame_invoke(bContext *C, wmOperator *op, wmEvent *event) } /* Modal event handling of frame changing */ -static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event) +static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event) { /* execute the events */ switch (event->type) { diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 6d1e6eab26b..ed8398b7c8b 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -714,7 +714,6 @@ static float visualkey_get_value(PointerRNA *ptr, PropertyRNA *prop, int array_i else if (ptr->type == &RNA_PoseBone) { Object *ob = (Object *)ptr->id.data; /* we assume that this is always set, and is an object */ bPoseChannel *pchan = (bPoseChannel *)ptr->data; - float tmat[4][4]; /* Although it is not strictly required for this particular space conversion, * arg1 must not be null, as there is a null check for the other conversions to @@ -1298,7 +1297,7 @@ void ANIM_OT_keyframe_insert(wmOperatorType *ot) * then calls the menu if necessary before */ -static int insert_key_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) +static int insert_key_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { Scene *scene = CTX_data_scene(C); @@ -1308,7 +1307,7 @@ static int insert_key_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(e uiLayout *layout; /* call the menu, which will call this operator again, hence the canceled */ - pup = uiPupMenuBegin(C, op->type->name, ICON_NONE); + pup = uiPupMenuBegin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE); layout = uiPupMenuLayout(pup); uiItemsEnumO(layout, "ANIM_OT_keyframe_insert_menu", "type"); uiPupMenuEnd(C, pup); @@ -1624,17 +1623,21 @@ static int insert_key_button_exec(bContext *C, wmOperator *op) success += insert_keyframe_direct(op->reports, ptr, prop, fcu, cfra, 0); } else { - if (G.debug & G_DEBUG) - printf("Button Insert-Key: no path to property\n"); - BKE_report(op->reports, RPT_WARNING, "Failed to resolve path to property, try using a keying set instead"); + BKE_report(op->reports, RPT_WARNING, + "Failed to resolve path to property, try manually specifying this using a Keying Set instead"); } } - else if (G.debug & G_DEBUG) { - printf("ptr.data = %p, prop = %p,", (void *)ptr.data, (void *)prop); - if (prop) - printf("animatable = %d\n", RNA_property_animateable(&ptr, prop)); - else - printf("animatable = NULL\n"); + else { + if (prop && !RNA_property_animateable(&ptr, prop)) { + BKE_reportf(op->reports, RPT_WARNING, + "\"%s\" property cannot be animated", + RNA_property_identifier(prop)); + } + else { + BKE_reportf(op->reports, RPT_WARNING, + "Button doesn't appear to have any property information attached (ptr.data = %p, prop = %p)", + (void *)ptr.data, (void *)prop); + } } if (success) { diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 4e8d7bdafe5..ad09fcb5966 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -468,7 +468,7 @@ void ANIM_OT_keyingset_button_remove(wmOperatorType *ot) /* Change Active KeyingSet Operator ------------------------ */ /* 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, wmEvent *UNUSED(event)) +static int keyingset_active_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { uiPopupMenu *pup; uiLayout *layout; @@ -879,7 +879,7 @@ short ANIM_validate_keyingset(bContext *C, ListBase *dsources, KeyingSet *ks) if (ksi == NULL) return MODIFYKEY_MISSING_TYPEINFO; /* TODO: check for missing callbacks! */ - + /* check if it can be used in the current context */ if (ksi->poll(ksi, C)) { /* if a list of data sources are provided, run a special iterator over them, |