diff options
Diffstat (limited to 'source/blender/editors/space_action')
-rw-r--r-- | source/blender/editors/space_action/action_data.c | 17 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_edit.c | 21 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_select.c | 35 | ||||
-rw-r--r-- | source/blender/editors/space_action/space_action.c | 10 |
5 files changed, 55 insertions, 34 deletions
diff --git a/source/blender/editors/space_action/action_data.c b/source/blender/editors/space_action/action_data.c index e9670a0048d..da48a7a9fa1 100644 --- a/source/blender/editors/space_action/action_data.c +++ b/source/blender/editors/space_action/action_data.c @@ -170,7 +170,8 @@ static bool action_new_poll(bContext *C) Scene *scene = CTX_data_scene(C); /* Check tweakmode is off (as you don't want to be tampering with the action in that case) */ - /* NOTE: unlike for pushdown, this operator needs to be run when creating an action from nothing... */ + /* NOTE: unlike for pushdown, + * this operator needs to be run when creating an action from nothing... */ if (ED_operator_action_active(C)) { SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C); Object *ob = CTX_data_active_object(C); @@ -242,7 +243,10 @@ static int action_new_exec(bContext *C, wmOperator *UNUSED(op)) } } else { - //printf("WARNING: Failed to stash %s. It may already exist in the NLA stack though\n", oldact->id.name); +#if 0 + printf("WARNING: Failed to stash %s. It may already exist in the NLA stack though\n", + oldact->id.name); +#endif } } @@ -425,7 +429,8 @@ static bool action_stash_create_poll(bContext *C) AnimData *adt = ED_actedit_animdata_from_context(C); /* Check tweakmode is off (as you don't want to be tampering with the action in that case) */ - /* NOTE: unlike for pushdown, this operator needs to be run when creating an action from nothing... */ + /* NOTE: unlike for pushdown, + * this operator needs to be run when creating an action from nothing... */ if (adt) { if (!(adt->flag & ADT_NLA_EDIT_ON)) return true; @@ -472,7 +477,8 @@ static int action_stash_create_exec(bContext *C, wmOperator *op) if (BKE_nla_action_stash(adt)) { bAction *new_action = NULL; - /* create new action not based on the old one (since the "new" operator already does that) */ + /* Create new action not based on the old one + * (since the "new" operator already does that). */ new_action = action_create_new(C, NULL); /* The stash operation will remove the user already, @@ -644,7 +650,8 @@ static int action_unlink_exec(bContext *C, wmOperator *op) static int action_unlink_invoke(bContext *C, wmOperator *op, const wmEvent *evt) { - /* NOTE: this is hardcoded to match the behavior for the unlink button (in interface_templates.c) */ + /* NOTE: this is hardcoded to match the behavior for the unlink button + * (in interface_templates.c). */ RNA_boolean_set(op->ptr, "force_delete", evt->shift != 0); return action_unlink_exec(C, op); } diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 3444d71baff..e504a4ef9c0 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -219,7 +219,8 @@ static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const tmax = BKE_nla_tweakedit_remap(adt, tmax, NLATIME_CONVERT_MAP); } - /* try to set cur using these values, if they're more extreme than previously set values */ + /* Try to set cur using these values, + * if they're more extreme than previously set values. */ *min = min_ff(*min, tmin); *max = max_ff(*max, tmax); found = true; @@ -392,7 +393,8 @@ static int actkeys_viewall(bContext *C, const bool only_sel) /* set vertical range */ if (only_sel == false) { - /* view all -> the summary channel is usually the shows everything, and resides right at the top... */ + /* view all -> the summary channel is usually the shows everything, + * and resides right at the top... */ v2d->cur.ymax = 0.0f; v2d->cur.ymin = (float)-BLI_rcti_size_y(&v2d->mask); } @@ -1297,8 +1299,9 @@ static void setipo_action_keys(bAnimContext *ac, short mode) ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); - /* loop through setting BezTriple interpolation - * Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here... + /* Loop through setting BezTriple interpolation + * Note: we do not supply KeyframeEditData to the looper yet. + * Currently that's not necessary here. */ for (ale = anim_data.first; ale; ale = ale->next) { ANIM_fcurve_keyframes_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve); @@ -1376,8 +1379,9 @@ static void sethandles_action_keys(bAnimContext *ac, short mode) ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); - /* loop through setting flags for handles - * Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here... + /* Loop through setting flags for handles + * Note: we do not supply KeyframeEditData to the looper yet. + * Currently that's not necessary here. */ for (ale = anim_data.first; ale; ale = ale->next) { FCurve *fcu = (FCurve *)ale->key_data; @@ -1457,8 +1461,9 @@ static void setkeytype_action_keys(bAnimContext *ac, short mode) ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS); ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); - /* loop through setting BezTriple interpolation - * Note: we do not supply KeyframeEditData to the looper yet. Currently that's not necessary here... + /* Loop through setting BezTriple interpolation + * Note: we do not supply KeyframeEditData to the looper yet. + * Currently that's not necessary here. */ for (ale = anim_data.first; ale; ale = ale->next) { ANIM_fcurve_keyframes_loop(NULL, ale->key_data, NULL, set_cb, NULL); diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index 4419a4d068e..b91ac3c39a3 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -115,8 +115,10 @@ void action_keymap(wmKeyConfig *keyconf) WM_keymap_ensure(keyconf, "Dopesheet Generic", SPACE_ACTION, 0); /* channels */ - /* Channels are not directly handled by the Action Editor module, but are inherited from the Animation module. - * All the relevant operations, keymaps, drawing, etc. can therefore all be found in that module instead, as these + /* Channels are not directly handled by the Action Editor module, + * but are inherited from the Animation module. + * All the relevant operations, keymaps, drawing, etc. + * can therefore all be found in that module instead, as these * are all used for the Graph-Editor too. */ diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 6b37cd8fe27..8afc9a43f6a 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -203,11 +203,13 @@ void ACTION_OT_select_all(wmOperatorType *ot) } /* ******************** Box Select Operator **************************** */ -/* This operator currently works in one of three ways: - * -> BKEY - 1) all keyframes within region are selected (ACTKEYS_BORDERSEL_ALLKEYS) - * -> ALT-BKEY - depending on which axis of the region was larger... - * -> 2) x-axis, so select all frames within frame range (ACTKEYS_BORDERSEL_FRAMERANGE) - * -> 3) y-axis, so select all frames within channels that region included (ACTKEYS_BORDERSEL_CHANNELS) +/** + * This operator currently works in one of three ways: + * - BKEY - 1) all keyframes within region are selected #ACTKEYS_BORDERSEL_ALLKEYS. + * - ALT-BKEY - depending on which axis of the region was larger... + * - 2) x-axis, so select all frames within frame range #ACTKEYS_BORDERSEL_FRAMERANGE. + * - 3) y-axis, so select all frames within channels that region included + * #ACTKEYS_BORDERSEL_CHANNELS. */ /* defines for box_select mode */ @@ -229,7 +231,8 @@ static void box_select_action(bAnimContext *ac, const rcti rect, short mode, sho rctf rectf; float ymin = 0, ymax = (float)(-ACHANNEL_HEIGHT_HALF(ac)); - /* convert mouse coordinates to frame ranges and channel coordinates corrected for view pan/zoom */ + /* Convert mouse coordinates to frame ranges and channel + * coordinates corrected for view pan/zoom. */ UI_view2d_region_to_view(v2d, rect.xmin, rect.ymin + 2, &rectf.xmin, &rectf.ymin); UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax - 2, &rectf.xmax, &rectf.ymax); @@ -342,10 +345,12 @@ static int actkeys_box_select_exec(bContext *C, wmOperator *op) /* selection 'mode' depends on whether box_select region only matters on one axis */ if (RNA_boolean_get(op->ptr, "axis_range")) { - /* mode depends on which axis of the range is larger to determine which axis to use - * - checking this in region-space is fine, as it's fundamentally still going to be a different rect size - * - the frame-range select option is favored over the channel one (x over y), as frame-range one is often - * used for tweaking timing when "blocking", while channels is not that useful... + /* Mode depends on which axis of the range is larger to determine which axis to use: + * - checking this in region-space is fine, + * as it's fundamentally still going to be a different rect size. + * - the frame-range select option is favored over the channel one (x over y), + * as frame-range one is often used for tweaking timing when "blocking", + * while channels is not that useful... */ if (BLI_rcti_size_x(&rect) >= BLI_rcti_size_y(&rect)) mode = ACTKEYS_BORDERSEL_FRAMERANGE; @@ -409,7 +414,8 @@ static void region_select_action_keys( rctf rectf, scaled_rectf; float ymin = 0, ymax = (float)(-ACHANNEL_HEIGHT_HALF(ac)); - /* convert mouse coordinates to frame ranges and channel coordinates corrected for view pan/zoom */ + /* Convert mouse coordinates to frame ranges and channel + * coordinates corrected for view pan/zoom. */ UI_view2d_region_to_view_rctf(v2d, rectf_view, &rectf); /* filter data */ @@ -1413,8 +1419,8 @@ static void mouse_action_keys( UI_view2d_listview_view_to_cell( v2d, 0, ACHANNEL_STEP(ac), 0, (float)ACHANNEL_HEIGHT_HALF(ac), x, y, NULL, &channel_index); - /* x-range to check is +/- 7px for standard keyframe under standard dpi/y-scale (in screen/region-space), - * on either side of mouse click (size of keyframe icon) + /* x-range to check is +/- 7px for standard keyframe under standard dpi/y-scale + * (in screen/region-space), on either side of mouse click (size of keyframe icon). */ /* standard channel height (to allow for some slop) */ @@ -1509,7 +1515,8 @@ static void mouse_action_keys( akn = ak->left; } - /* remove active channel from list of channels for separate treatment (since it's needed later on) */ + /* Remove active channel from list of channels for separate treatment + * (since it's needed later on). */ BLI_remlink(&anim_data, ale); ale->next = ale->prev = NULL; diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 4c133e6a91e..d9545e51318 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -764,15 +764,15 @@ static void action_refresh(const bContext *C, ScrArea *sa) { SpaceAction *saction = (SpaceAction *)sa->spacedata.first; - /* update the state of the animchannels in response to changes from the data they represent - * NOTE: the temp flag is used to indicate when this needs to be done, and will be cleared once handled - */ + /* Update the state of the animchannels in response to changes from the data they represent + * NOTE: the temp flag is used to indicate when this needs to be done, + * and will be cleared once handled. */ if (saction->runtime.flag & SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC) { ARegion *ar; /* Perform syncing of channel state incl. selection - * Active action setting also occurs here (as part of anim channel filtering in anim_filter.c) - */ + * Active action setting also occurs here + * (as part of anim channel filtering in anim_filter.c). */ ANIM_sync_animchannels_to_data(C); saction->runtime.flag &= ~SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC; |