diff options
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/CMakeLists.txt | 7 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 9 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 4 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 17 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_ops.c | 14 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframes_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 1 | ||||
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 5 |
8 files changed, 33 insertions, 28 deletions
diff --git a/source/blender/editors/animation/CMakeLists.txt b/source/blender/editors/animation/CMakeLists.txt index 8fc1ec429cc..83fe91d6f76 100644 --- a/source/blender/editors/animation/CMakeLists.txt +++ b/source/blender/editors/animation/CMakeLists.txt @@ -22,12 +22,15 @@ set(INC ../include ../../blenkernel - ../../blenloader ../../blenlib + ../../blenloader ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc +) + +set(INC_SYS ${GLEW_INCLUDE_PATH} ) @@ -51,4 +54,4 @@ set(SRC anim_intern.h ) -blender_add_lib(bf_editor_animation "${SRC}" "${INC}") +blender_add_lib(bf_editor_animation "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 4edcca46935..9145cc2b79d 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -1881,6 +1881,7 @@ static void ANIM_OT_channels_select_border(wmOperatorType *ot) ot->invoke= WM_border_select_invoke; ot->exec= animchannels_borderselect_exec; ot->modal= WM_border_select_modal; + ot->cancel= WM_border_select_cancel; ot->poll= animedit_poll_channels_nla_tweakmode_off; @@ -2148,7 +2149,7 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent * bAnimContext ac; ARegion *ar; View2D *v2d; - int mval[2], channel_index; + int channel_index; int notifierFlags = 0; short selectmode; float x, y; @@ -2162,10 +2163,6 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent * ar= ac.ar; v2d= &ar->v2d; - /* get mouse coordinates (in region coordinates) */ - mval[0]= (event->x - ar->winrct.xmin); - mval[1]= (event->y - ar->winrct.ymin); - /* select mode is either replace (deselect all, then add) or add/extend */ if (RNA_boolean_get(op->ptr, "extend")) selectmode= SELECT_INVERT; @@ -2179,7 +2176,7 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent * * 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, mval[0], mval[1], &x, &y); + UI_view2d_region_to_view(v2d, event->mval[0], event->mval[1], &x, &y); UI_view2d_listview_view_to_cell(v2d, ACHANNEL_NAMEWIDTH, ACHANNEL_STEP, 0, (float)ACHANNEL_HEIGHT_HALF, x, y, NULL, &channel_index); /* handle mouse-click in the relevant channel then */ diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 71893cee89a..967002131c2 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1645,10 +1645,6 @@ static int animdata_filter_dopesheet_obdata (bAnimContext *ac, ListBase *anim_da break; } - /* special exception for drivers instead of action */ - if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) - expanded= EXPANDED_DRVD(adt); - /* include data-expand widget? */ if ((filter_mode & ANIMFILTER_CURVESONLY) == 0) { /* check if filtering by active status */ diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index c802ba621f1..b3338396598 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -50,6 +50,7 @@ #include "BKE_main.h" #include "BKE_report.h" #include "BKE_scene.h" +#include "BKE_screen.h" #include "WM_api.h" #include "WM_types.h" @@ -717,7 +718,7 @@ static void ed_marker_move_apply(wmOperator *op) } /* only for modal */ -static void ed_marker_move_cancel(bContext *C, wmOperator *op) +static int ed_marker_move_cancel(bContext *C, wmOperator *op) { RNA_int_set(op->ptr, "frames", 0); ed_marker_move_apply(op); @@ -725,6 +726,8 @@ static void ed_marker_move_cancel(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL); WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL); + + return OPERATOR_CANCELLED; } @@ -886,6 +889,7 @@ static void MARKER_OT_move(wmOperatorType *ot) ot->invoke= ed_marker_move_invoke_wrapper; ot->modal= ed_marker_move_modal; ot->poll= ed_markers_poll_selected_markers; + ot->cancel= ed_marker_move_cancel; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER; @@ -980,6 +984,7 @@ static void MARKER_OT_duplicate(wmOperatorType *ot) ot->invoke= ed_marker_duplicate_invoke_wrapper; ot->modal= ed_marker_move_modal; ot->poll= ed_markers_poll_selected_markers; + ot->cancel= ed_marker_move_cancel; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1185,6 +1190,7 @@ static void MARKER_OT_select_border(wmOperatorType *ot) ot->exec= ed_marker_border_select_exec; ot->invoke= ed_marker_select_border_invoke_wrapper; ot->modal= WM_border_select_modal; + ot->cancel= WM_border_select_cancel; ot->poll= ed_markers_poll_markers_exist; @@ -1411,7 +1417,9 @@ static void MARKER_OT_make_links_scene(wmOperatorType *ot) static int ed_marker_camera_bind_exec(bContext *C, wmOperator *UNUSED(op)) { + bScreen *sc= CTX_wm_screen(C); Scene *scene= CTX_data_scene(C); + Object *ob = CTX_data_active_object(C); ListBase *markers= ED_context_get_markers(C); TimeMarker *marker; @@ -1419,10 +1427,15 @@ static int ed_marker_camera_bind_exec(bContext *C, wmOperator *UNUSED(op)) if(marker == NULL) return OPERATOR_CANCELLED; - marker->camera= scene->camera; + marker->camera= ob; + + /* camera may have changes */ + scene_camera_switch_update(scene); + BKE_screen_view3d_scene_sync(sc); WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL); WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL); + WM_event_add_notifier(C, NC_SCENE|NA_EDITED, scene); /* so we get view3d redraws */ return OPERATOR_FINISHED; } diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index ff9521f1ebd..7a94a21d41e 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -107,14 +107,9 @@ static int frame_from_event(bContext *C, wmEvent *event) { ARegion *region= CTX_wm_region(C); float viewx; - int x, y; - - /* convert screen coordinates to region coordinates */ - x= event->x - region->winrct.xmin; - y= event->y - region->winrct.ymin; - + /* convert from region coordinates to View2D 'tot' space */ - UI_view2d_region_to_view(®ion->v2d, x, y, &viewx, NULL); + UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &viewx, NULL); /* round result to nearest int (frames are ints!) */ return (int)floor(viewx+0.5f); @@ -204,8 +199,8 @@ static int previewrange_define_exec(bContext *C, wmOperator *op) * - must clamp within allowable limits * - end must not be before start (though this won't occur most of the time) */ - if (sfra < 1) sfra = 1.0f; - if (efra < 1) efra = 1.0f; + FRAMENUMBER_MIN_CLAMP(sfra); + FRAMENUMBER_MIN_CLAMP(efra); if (efra < sfra) efra= sfra; scene->r.flag |= SCER_PRV_RANGE; @@ -229,6 +224,7 @@ static void ANIM_OT_previewrange_set(wmOperatorType *ot) ot->invoke= WM_border_select_invoke; ot->exec= previewrange_define_exec; ot->modal= WM_border_select_modal; + ot->cancel= WM_border_select_cancel; ot->poll= ED_operator_animview_active; diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index c4108e0ce33..00e11d8b1a4 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -372,7 +372,7 @@ static void add_bezt_to_keyblocks_list(DLRBT_Tree *blocks, DLRBT_Tree *beztTree, blocks->root= (DLRBT_Node *)new_ab; } else { - ActKeyBlock *ab, *abp=NULL, *abn=NULL; + ActKeyBlock *ab, *abn=NULL; /* try to find a keyblock that starts on the previous beztriple, and add a new one if none start there * Note: we can't search from end to try to optimise this as it causes errors there's @@ -382,7 +382,7 @@ static void add_bezt_to_keyblocks_list(DLRBT_Tree *blocks, DLRBT_Tree *beztTree, // A|--------------|A ______________ B|--------------|B // A|------------------------------------------------|A // A|----|A|---|A|-----------------------------------|A - for (ab= blocks->root; ab; abp= ab, ab= abn) { + for (ab= blocks->root; ab; ab= abn) { /* check if this is a match, or whether we go left or right */ if (ab->start == prev->vec[1][0]) { /* set selection status and 'touched' status */ diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index cb93d2bf70b..1ba695209b2 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1360,6 +1360,7 @@ void ANIM_OT_keyframe_delete_v3d (wmOperatorType *ot) { /* identifiers */ ot->name= "Delete Keyframe"; + ot->description= "Remove keyframes on current frame for selected object"; ot->idname= "ANIM_OT_keyframe_delete_v3d"; /* callbacks */ diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 04565b4c236..c525c9af626 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -578,9 +578,8 @@ void ANIM_keyingset_info_register (KeyingSetInfo *ksi) } /* Remove the given KeyingSetInfo from the list of type infos, and also remove the builtin set if appropriate */ -void ANIM_keyingset_info_unregister (const bContext *C, KeyingSetInfo *ksi) +void ANIM_keyingset_info_unregister (Main *bmain, KeyingSetInfo *ksi) { - Main *bmain= CTX_data_main(C); KeyingSet *ks, *ksn; /* find relevant builtin KeyingSets which use this, and remove them */ @@ -697,7 +696,7 @@ KeyingSet *ANIM_get_keyingset_for_autokeying(Scene *scene, const char *tranformK /* Menu of All Keying Sets ----------------------------- */ /* Dynamically populate an enum of Keying Sets */ -EnumPropertyItem *ANIM_keying_sets_enum_itemf (bContext *C, PointerRNA *UNUSED(ptr), int *free) +EnumPropertyItem *ANIM_keying_sets_enum_itemf (bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) { Scene *scene = CTX_data_scene(C); KeyingSet *ks; |