diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-21 17:18:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-21 23:30:04 +0300 |
commit | 0ac990d088d553c27f5360f62e142e99f087890a (patch) | |
tree | ef3637e9f8086bc937b56777ea9b1f36f97790a4 /source/blender/editors/animation | |
parent | f8b2268f4fbe92a1860c525f70fdc293304575ff (diff) |
Cleanup: comments (long lines) in editors
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_channels_defines.c | 60 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 51 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_deps.c | 9 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_draw.c | 6 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 150 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_ipo_utils.c | 28 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 14 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_motion_paths.c | 3 | ||||
-rw-r--r-- | source/blender/editors/animation/drivers.c | 14 | ||||
-rw-r--r-- | source/blender/editors/animation/fmodifier_ui.c | 6 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframes_draw.c | 15 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframes_edit.c | 26 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframes_general.c | 33 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 28 | ||||
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 16 |
15 files changed, 283 insertions, 176 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 225bad1b35b..a17ee820595 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -356,7 +356,8 @@ static short acf_generic_group_offset(bAnimContext *ac, bAnimListElem *ale) else if (ELEM(GS(ale->id->name), ID_MA, ID_PA)) offset += (short)(0.7f * U.widget_unit); - /* if not in Action Editor mode, action-groups (and their children) must carry some offset too... */ + /* If not in Action Editor mode, action-groups (and their children) + * must carry some offset too. */ else if (ac->datatype != ANIMCONT_ACTION) offset += (short)(0.7f * U.widget_unit); @@ -3855,7 +3856,8 @@ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, eAnimChanne return -1; } -/* quick macro for use in ANIM_channel_setting_set - set flag for setting according the mode given */ +/* Quick macro for use in ANIM_channel_setting_set - + * set flag for setting according the mode given. */ #define ACF_SETTING_SET(sval, sflag, smode) \ { \ if (negflag) { \ @@ -4022,8 +4024,8 @@ void ANIM_channel_draw( immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); - /* F-Curve channels need to have a special 'color code' box drawn, which is colored with whatever - * color the curve has stored + /* F-Curve channels need to have a special 'color code' box drawn, + * which is colored with whatever color the curve has stored. */ immUniformColor3fv(fcu->color); @@ -4143,26 +4145,29 @@ void ANIM_channel_draw( if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PINNED)) offset += ICON_WIDTH; - /* NOTE: technically, NLA Action "pushdown" should be here too, but there are no sliders there */ + /* NOTE: technically, NLA Action "pushdown" should be here too, + * but there are no sliders there. */ /* NLA action channels have slightly different spacing requirements... */ if (ale->type == ANIMTYPE_NLAACTION) ymin_ofs = NLACHANNEL_SKIP; } - /* draw slider - * - even if we can draw sliders for this view, we must also check that the channel-type supports them - * (only only F-Curves really can support them for now) - * - slider should start before the toggles (if they're visible) to keep a clean line down the side + /* Draw slider: + * - Even if we can draw sliders for this view, + * we must also check that the channel-type supports them + * (only only F-Curves really can support them for now). + * - Slider should start before the toggles (if they're visible) + * to keep a clean line down the side. */ if ((draw_sliders) && ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE, ANIMTYPE_SHAPEKEY)) { /* adjust offset */ offset += SLIDER_WIDTH; } - /* finally draw a backdrop rect behind these - * - starts from the point where the first toggle/slider starts, - * - ends past the space that might be reserved for a scroller + /* Finally draw a backdrop rect behind these: + * - Starts from the point where the first toggle/slider starts. + * - Ends past the space that might be reserved for a scroller. */ immRectf(pos, v2d->cur.xmax - (float)offset, @@ -4402,7 +4407,8 @@ static void achannel_setting_slider_nla_curve_cb(bContext *C, /* get flags for keyframing */ flag = ANIM_get_keyframing_flags(scene, 1); - /* get pointer and property from the slider - this should all match up with the NlaStrip required... */ + /* Get pointer and property from the slider - + * this should all match up with the NlaStrip required. */ UI_context_active_but_prop_get(C, &ptr, &prop, &index); if (fcu && prop) { @@ -4853,7 +4859,8 @@ void ANIM_channel_draw_widgets(const bContext *C, draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_MUTE); } if (ale->type == ANIMTYPE_GPLAYER) { - /* Not technically "mute" (in terms of anim channels, but this sets layer visibility instead) */ + /* Not technically "mute" + * (in terms of anim channels, but this sets layer visibility instead). */ offset -= ICON_WIDTH; draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_VISIBLE); } @@ -4900,17 +4907,20 @@ void ANIM_channel_draw_widgets(const bContext *C, } } - /* draw slider - * - even if we can draw sliders for this view, we must also check that the channel-type supports them - * (only only F-Curves really can support them for now) - * - to make things easier, we use RNA-autobuts for this so that changes are reflected immediately, - * wherever they occurred. BUT, we don't use the layout engine, otherwise we'd get wrong alignment, - * and wouldn't be able to auto-keyframe... - * - slider should start before the toggles (if they're visible) to keep a clean line down the side + /* Draw slider: + * - Even if we can draw sliders for this view, we must also check that the channel-type + * supports them (only only F-Curves really can support them for now). + * - To make things easier, we use RNA-autobuts for this so that changes are + * reflected immediately, wherever they occurred. + * BUT, we don't use the layout engine, otherwise we'd get wrong alignment, + * and wouldn't be able to auto-keyframe. + * - Slider should start before the toggles (if they're visible) + * to keep a clean line down the side. */ if ((draw_sliders) && ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE, ANIMTYPE_SHAPEKEY)) { /* adjust offset */ - // TODO: make slider width dynamic, so that they can be easier to use when the view is wide enough + /* TODO: make slider width dynamic, + * so that they can be easier to use when the view is wide enough. */ offset -= SLIDER_WIDTH; /* need backdrop behind sliders... */ @@ -4931,7 +4941,8 @@ void ANIM_channel_draw_widgets(const bContext *C, if (prop) { uiBut *but; - /* create the slider button, and assign relevant callback to ensure keyframes are inserted... */ + /* Create the slider button, + * and assign relevant callback to ensure keyframes are inserted. */ but = uiDefAutoButR(block, &ptr, prop, @@ -4977,7 +4988,8 @@ void ANIM_channel_draw_widgets(const bContext *C, if (RNA_path_resolve_property(&id_ptr, rna_path, &ptr, &prop)) { uiBut *but; - /* create the slider button, and assign relevant callback to ensure keyframes are inserted... */ + /* Create the slider button, + * and assign relevant callback to ensure keyframes are inserted. */ but = uiDefAutoButR(block, &ptr, prop, diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 67ec5a95913..d85457bbc4f 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -501,7 +501,8 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, */ if (((setting == ACHANNEL_SETTING_VISIBLE) && (mode != ACHANNEL_SETFLAG_CLEAR)) || ((setting != ACHANNEL_SETTING_VISIBLE) && (mode == ACHANNEL_SETFLAG_CLEAR))) { - /* go backwards in the list, until the highest-ranking element (by indention has been covered) */ + /* Go backwards in the list, until the highest-ranking element + * (by indention has been covered). */ for (ale = match->prev; ale; ale = ale->prev) { const bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale); int level; @@ -517,8 +518,8 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, /* if the level is 'less than' (i.e. more important) the level we're matching * but also 'less than' the level just tried (i.e. only the 1st group above grouped F-Curves, - * when toggling visibility of F-Curves, gets flushed, which should happen if we don't let prevLevel - * get updated below once the first 1st group is found)... + * when toggling visibility of F-Curves, gets flushed, which should happen if we don't let + * prevLevel get updated below once the first 1st group is found). */ if (level < prevLevel) { /* flush the new status... */ @@ -907,7 +908,8 @@ static void rearrange_animchannel_add_to_islands(ListBase *islands, (island == NULL) || /* 2) unselected islands have single channels only - to allow up/down movement */ ((island->flag & REORDER_ISLAND_SELECTED) == 0) || - /* 3) if channel is unselected, stop existing island (it was either wrong sel status, or full already) */ + /* 3) if channel is unselected, stop existing island + * (it was either wrong sel status, or full already) */ (is_sel == 0) || /* 4) hidden status changes */ ((island->flag & REORDER_ISLAND_HIDDEN) != is_hidden)) { @@ -997,9 +999,12 @@ static bool rearrange_animchannel_islands(ListBase *list, rearrange_animchannel_add_to_islands(&islands, list, channel, type, is_hidden); } - /* perform moving of selected islands now, but only if there is more than one of 'em so that something will happen - * - scanning of the list is performed in the opposite direction to the direction we're moving things, so that we - * shouldn't need to encounter items we've moved already + /* Perform moving of selected islands now, but only if there is more than one of them + * so that something will happen: + * + * - Scanning of the list is performed in the opposite direction + * to the direction we're moving things, + * so that we shouldn't need to encounter items we've moved already. */ if (islands.first != islands.last) { tReorderChannelIsland *first = (mode > 0) ? islands.last : islands.first; @@ -2632,10 +2637,11 @@ static int animchannels_channel_get(bAnimContext *ac, const int mval[2]) ar = ac->ar; v2d = &ar->v2d; - /* figure out which channel user clicked in - * Note: although channels technically start at (y = ACHANNEL_FIRST), we need to adjust by half a channel's height - * so that the tops of channels get caught ok. Since ACHANNEL_FIRST is really ACHANNEL_HEIGHT, we simply use - * ACHANNEL_HEIGHT_HALF. + /* Figure out which channel user clicked in. + * + * Note: although channels technically start at (y = ACHANNEL_FIRST), + * we need to adjust by half a channel's height 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); @@ -2724,7 +2730,8 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, return 0; } - /* selectmode -1 is a special case for ActionGroups only, which selects all of the channels underneath it only... */ + /* selectmode -1 is a special case for ActionGroups only, + * which selects all of the channels underneath it only. */ /* TODO: should this feature be extended to work with other channel types too? */ if ((selectmode == -1) && (ale->type != ANIMTYPE_GROUP)) { /* normal channels should not behave normally in this case */ @@ -2800,7 +2807,8 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, if ((adt) && (adt->flag & ADT_UI_SELECTED)) adt->flag |= ADT_UI_ACTIVE; - /* ensure we exit editmode on whatever object was active before to avoid getting stuck there - T48747 */ + /* Ensure we exit editmode on whatever object was active before + * to avoid getting stuck there - T48747. */ if (ob != CTX_data_edit_object(C)) { ED_object_editmode_exit(C, EM_FREEDATA); } @@ -2965,9 +2973,10 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, case ANIMTYPE_NLACONTROLS: { AnimData *adt = (AnimData *)ale->data; - /* toggle expand - * - Although the triangle widget already allows this, since there's nothing else that can be done here now, - * let's just use it for easier expand/collapse for now + /* Toggle expand: + * - Although the triangle widget already allows this, + * since there's nothing else that can be done here now, + * let's just use it for easier expand/collapse for now. */ adt->flag ^= ADT_NLA_SKEYS_COLLAPSED; @@ -2977,8 +2986,9 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, case ANIMTYPE_GPDATABLOCK: { bGPdata *gpd = (bGPdata *)ale->data; - /* toggle expand - * - although the triangle widget already allows this, the whole channel can also be used for this purpose + /* Toggle expand: + * - Although the triangle widget already allows this, + * the whole channel can also be used for this purpose. */ gpd->flag ^= GP_DATA_EXPAND; @@ -3015,8 +3025,9 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, case ANIMTYPE_MASKDATABLOCK: { Mask *mask = (Mask *)ale->data; - /* toggle expand - * - although the triangle widget already allows this, the whole channel can also be used for this purpose + /* Toggle expand + * - Although the triangle widget already allows this, + * the whole channel can also be used for this purpose. */ mask->flag ^= MASK_ANIMF_EXPAND; diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index df73c78aa18..5d25d732fe8 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -149,7 +149,8 @@ static void animchan_sync_group(bAnimContext *ac, bAnimListElem *ale, bActionGro Object *ob = (Object *)owner_id; /* check if there are bones, and whether the name matches any - * NOTE: this feature will only really work if groups by default contain the F-Curves for a single bone + * NOTE: this feature will only really work if groups by default contain the F-Curves + * for a single bone. */ if (ob->pose) { bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, agrp->name); @@ -314,8 +315,10 @@ void ANIM_sync_animchannels_to_data(const bContext *C) return; /* filter data */ - /* NOTE: we want all channels, since we want to be able to set selection status on some of them even when collapsed - * However, don't include duplicates so that selection statuses don't override each other + + /* NOTE: we want all channels, since we want to be able to set selection status on some of them + * even when collapsed... however, + * don't include duplicates so that selection statuses don't override each other. */ filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_NODUPLIS; ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 11c768a8efd..bf6dfe3938b 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -255,7 +255,8 @@ AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale) ANIMCONT_CHANNEL)) { /* handling depends on the type of animation-context we've got */ if (ale) { - /* NLA Control Curves occur on NLA strips, and shouldn't be subjected to this kind of mapping */ + /* NLA Control Curves occur on NLA strips, + * and shouldn't be subjected to this kind of mapping. */ if (ale->type != ANIMTYPE_NLACURVE) return ale->adt; } @@ -267,7 +268,8 @@ AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale) /* ------------------- */ -/* helper function for ANIM_nla_mapping_apply_fcurve() -> "restore", i.e. mapping points back to action-time */ +/* Helper function for ANIM_nla_mapping_apply_fcurve() -> "restore", + * i.e. mapping points back to action-time. */ static short bezt_nlamapping_restore(KeyframeEditData *ked, BezTriple *bezt) { /* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */ diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index bb0db9cf8a1..41d23eb31ba 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -239,11 +239,12 @@ static bool actedit_get_context(bAnimContext *ac, SpaceAction *saction) saction->ads.source = (ID *)ac->scene; /* sync scene's "selected keys only" flag with our "only selected" flag + * * XXX: This is a workaround for T55525. We shouldn't really be syncing the flags like this, - * but it's a simpler fix for now than also figuring out how the next/prev keyframe tools - * should work in the 3D View if we allowed full access to the timeline's dopesheet filters - * (i.e. we'd have to figure out where to host those settings, to be on a scene level like - * this flag currently is, along with several other unknowns) + * but it's a simpler fix for now than also figuring out how the next/prev keyframe + * tools should work in the 3D View if we allowed full access to the timeline's + * dopesheet filters (i.e. we'd have to figure out where to host those settings, + * to be on a scene level like this flag currently is, along with several other unknowns). */ if (ac->scene->flag & SCE_KEYS_NO_SELONLY) saction->ads.filterflag &= ~ADS_FILTER_ONLYSEL; @@ -339,7 +340,8 @@ static bool nlaedit_get_context(bAnimContext *ac, SpaceNla *snla) /* ----------- Public API --------------- */ -/* Obtain current anim-data context, given that context info from Blender context has already been set +/* Obtain current anim-data context, + * given that context info from Blender context has already been set: * - AnimContext to write to is provided as pointer to var on stack so that we don't have * allocation/freeing costs (which are not that avoidable with channels). */ @@ -467,20 +469,24 @@ bool ANIM_animdata_get_context(const bContext *C, bAnimContext *ac) /* quick macro to test if AnimData is usable for NLA */ #define ANIMDATA_HAS_NLA(id) ((id)->adt && (id)->adt->nla_tracks.first) -/* Quick macro to test for all three above usability tests, performing the appropriate provided +/** + * Quick macro to test for all three above usability tests, performing the appropriate provided * action for each when the AnimData context is appropriate. * * Priority order for this goes (most important, to least): AnimData blocks, NLA, Drivers, Keyframes. * - * For this to work correctly, a standard set of data needs to be available within the scope that this - * gets called in: + * For this to work correctly, + * a standard set of data needs to be available within the scope that this + * + * Gets called in: * - ListBase anim_data; * - bDopeSheet *ads; * - bAnimListElem *ale; * - size_t items; * * - id: ID block which should have an AnimData pointer following it immediately, to use - * - adtOk: line or block of code to execute for AnimData-blocks case (usually ANIMDATA_ADD_ANIMDATA) + * - adtOk: line or block of code to execute for AnimData-blocks case + * (usually #ANIMDATA_ADD_ANIMDATA). * - nlaOk: line or block of code to execute for NLA tracks+strips case * - driversOk: line or block of code to execute for Drivers case * - nlaKeysOk: line or block of code for NLA Strip Keyframes case @@ -991,7 +997,8 @@ static bool skip_fcurve_selected_data(bDopeSheet *ads, FCurve *fcu, ID *owner_id /* check whether to continue or skip */ if ((pchan) && (pchan->bone)) { - /* if only visible channels, skip if bone not visible unless user wants channels from hidden data too */ + /* If only visible channels, + * skip if bone not visible unless user wants channels from hidden data too. */ if (skip_hidden) { bArmature *arm = (bArmature *)ob->data; @@ -1173,8 +1180,10 @@ static FCurve *animfilter_fcurve_next(bDopeSheet *ads, bActionGroup *grp = (channel_type == ANIMTYPE_FCURVE) ? owner : NULL; FCurve *fcu = NULL; - /* loop over F-Curves - assume that the caller of this has already checked that these should be included - * NOTE: we need to check if the F-Curves belong to the same group, as this gets called for groups too... + /* Loop over F-Curves - assume that the caller of this has already checked + * that these should be included. + * NOTE: we need to check if the F-Curves belong to the same group, + * as this gets called for groups too... */ for (fcu = first; ((fcu) && (fcu->grp == grp)); fcu = fcu->next) { /* special exception for Pose-Channel/Sequence-Strip/Node Based F-Curves: @@ -1199,7 +1208,8 @@ static FCurve *animfilter_fcurve_next(bDopeSheet *ads, if (!(filter_mode & ANIMFILTER_CURVE_VISIBLE) || (fcu->flag & FCURVE_VISIBLE)) { /* only work with this channel and its subchannels if it is editable */ if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_FCU(fcu)) { - /* only include this curve if selected in a way consistent with the filtering requirements */ + /* Only include this curve if selected in a way consistent + * with the filtering requirements. */ if (ANIMCHANNEL_SELOK(SEL_FCU(fcu)) && ANIMCHANNEL_SELEDITOK(SEL_FCU(fcu))) { /* only include if this curve is active */ if (!(filter_mode & ANIMFILTER_ACTIVE) || (fcu->flag & FCURVE_ACTIVE)) { @@ -1240,14 +1250,17 @@ static size_t animfilter_fcurves(ListBase *anim_data, FCurve *fcu; size_t items = 0; - /* loop over every F-Curve able to be included - * - this for-loop works like this: - * 1) the starting F-Curve is assigned to the fcu pointer so that we have a starting point to search from - * 2) the first valid F-Curve to start from (which may include the one given as 'first') in the remaining - * list of F-Curves is found, and verified to be non-null - * 3) the F-Curve referenced by fcu pointer is added to the list - * 4) the fcu pointer is set to the F-Curve after the one we just added, so that we can keep going through - * the rest of the F-Curve list without an eternal loop. Back to step 2 :) + /* Loop over every F-Curve able to be included. + * + * This for-loop works like this: + * 1) The starting F-Curve is assigned to the fcu pointer + * so that we have a starting point to search from. + * 2) The first valid F-Curve to start from (which may include the one given as 'first') + * in the remaining list of F-Curves is found, and verified to be non-null. + * 3) The F-Curve referenced by fcu pointer is added to the list + * 4) The fcu pointer is set to the F-Curve after the one we just added, + * so that we can keep going through the rest of the F-Curve list without an eternal loop. + * Back to step 2 :) */ for (fcu = first; ((fcu = animfilter_fcurve_next(ads, fcu, fcurve_type, filter_mode, owner, owner_id))); @@ -1290,21 +1303,23 @@ static size_t animfilter_act_group(bAnimContext *ac, * - Hierarchy ignored: cases like [#21276] won't work properly, unless we skip this hack */ if ( - /* care about hierarchy but group isn't expanded */ + /* Care about hierarchy but group isn't expanded. */ ((filter_mode & ANIMFILTER_LIST_VISIBLE) && EXPANDED_AGRP(ac, agrp) == 0) && - /* care about selection status */ + /* Care about selection status. */ (filter_mode & (ANIMFILTER_SEL | ANIMFILTER_UNSEL))) { - /* if the group itself isn't selected appropriately, we shouldn't consider it's children either */ + /* If the group itself isn't selected appropriately, + * we shouldn't consider it's children either. */ if (ANIMCHANNEL_SELOK(SEL_AGRP(agrp)) == 0) return 0; - /* if we're still here, then the selection status of the curves within this group should not matter, - * since this creates too much overhead for animators (i.e. making a slow workflow) + /* if we're still here, + * then the selection status of the curves within this group should not matter, + * since this creates too much overhead for animators (i.e. making a slow workflow). * * Tools affected by this at time of coding (2010 Feb 09): - * - inserting keyframes on selected channels only - * - pasting keyframes - * - creating ghost curves in Graph Editor + * - Inserting keyframes on selected channels only. + * - Pasting keyframes. + * - Creating ghost curves in Graph Editor. */ filter_mode &= ~(ANIMFILTER_SEL | ANIMFILTER_UNSEL | ANIMFILTER_LIST_VISIBLE); } @@ -1397,12 +1412,13 @@ static size_t animfilter_action(bAnimContext *ac, } /* Include NLA-Data for NLA-Editor: - * - when ANIMFILTER_LIST_CHANNELS is used, that means we should be filtering the list for display - * Although the evaluation order is from the first track to the last and then apply the Action on top, - * we present this in the UI as the Active Action followed by the last track to the first so that we - * get the evaluation order presented as per a stack. - * - for normal filtering (i.e. for editing), we only need the NLA-tracks but they can be in 'normal' evaluation - * order, i.e. first to last. Otherwise, some tools may get screwed up. + * - When ANIMFILTER_LIST_CHANNELS is used, that means we should be filtering the list for display + * Although the evaluation order is from the first track to the last and then apply the + * Action on top, we present this in the UI as the Active Action followed by the last track + * to the first so that we get the evaluation order presented as per a stack. + * - For normal filtering (i.e. for editing), + * we only need the NLA-tracks but they can be in 'normal' evaluation order, i.e. first to last. + * Otherwise, some tools may get screwed up. */ static size_t animfilter_nla(bAnimContext *UNUSED(ac), ListBase *anim_data, @@ -1423,9 +1439,10 @@ static size_t animfilter_nla(bAnimContext *UNUSED(ac), if (!(ads->filterflag & ADS_FILTER_NLA_NOACT) || (adt->action)) { /* there isn't really anything editable here, so skip if need editable */ if ((filter_mode & ANIMFILTER_FOREDIT) == 0) { - /* just add the action track now (this MUST appear for drawing) - * - as AnimData may not have an action, we pass a dummy pointer just to get the list elem created, then - * overwrite this with the real value - REVIEW THIS... + /* Just add the action track now (this MUST appear for drawing): + * - As AnimData may not have an action, + * we pass a dummy pointer just to get the list elem created, + * then overwrite this with the real value - REVIEW THIS. */ ANIMCHANNEL_NEW_CHANNEL_FULL((void *)(&adt->action), ANIMTYPE_NLAACTION, owner_id, NULL, { ale->data = adt->action ? adt->action : NULL; @@ -1441,7 +1458,8 @@ static size_t animfilter_nla(bAnimContext *UNUSED(ac), first = adt->nla_tracks.first; } - /* loop over NLA Tracks - assume that the caller of this has already checked that these should be included */ + /* loop over NLA Tracks - + * assume that the caller of this has already checked that these should be included */ for (nlt = first; nlt; nlt = next) { /* 'next' NLA-Track to use depends on whether we're filtering for drawing or not */ if (filter_mode & ANIMFILTER_LIST_CHANNELS) @@ -1452,7 +1470,8 @@ static size_t animfilter_nla(bAnimContext *UNUSED(ac), /* if we're in NLA-tweakmode, don't show this track if it was disabled (due to tweaking) for now * - active track should still get shown though (even though it has disabled flag set) */ - // FIXME: the channels after should still get drawn, just 'differently', and after an active-action channel + // FIXME: the channels after should still get drawn, just 'differently', + // and after an active-action channel. if ((adt->flag & ADT_NLA_EDIT_ON) && (nlt->flag & NLATRACK_DISABLED) && (adt->act_track != nlt)) continue; @@ -1516,7 +1535,8 @@ static size_t animfilter_nla_controls( /* for now, we only go one level deep - so controls on grouped FCurves are not handled */ for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) { for (strip = nlt->strips.first; strip; strip = strip->next) { - /* pass strip as the "owner", so that the name lookups (used while filtering) will resolve */ + /* pass strip as the "owner", + * so that the name lookups (used while filtering) will resolve */ /* NLA tracks are coming from AnimData, so owner of f-curves * is the same as owner of animation data. */ tmp_items += animfilter_fcurves(&tmp_data, @@ -1563,8 +1583,9 @@ static size_t animfilter_block_data( if (adt) { IdAdtTemplate *iat = (IdAdtTemplate *)id; - /* NOTE: this macro is used instead of inlining the logic here, since this sort of filtering is still needed - * in a few places in the rest of the code still - notably for the few cases where special mode-based + /* NOTE: this macro is used instead of inlining the logic here, + * since this sort of filtering is still needed in a few places in the rest of the code still - + * notably for the few cases where special mode-based * different types of data expanders are required. */ ANIMDATA_FILTER_CASES( @@ -1613,7 +1634,8 @@ static size_t animdata_filter_shapekey(bAnimContext *ac, /* only work with this channel and its subchannels if it is editable */ if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_SHAPEKEY(kb)) { - /* only include this track if selected in a way consistent with the filtering requirements */ + /* Only include this track if selected in a way consistent + * with the filtering requirements. */ if (ANIMCHANNEL_SELOK(SEL_SHAPEKEY(kb))) { // TODO: consider 'active' too? @@ -1950,7 +1972,8 @@ static size_t animdata_filter_mask(Main *bmain, return items; } -/* NOTE: owner_id is scene, material, or texture block, which is the direct owner of the node tree in question */ +/* NOTE: owner_id is scene, material, or texture block, + * which is the direct owner of the node tree in question. */ static size_t animdata_filter_ds_nodetree_group(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, @@ -2100,9 +2123,10 @@ static size_t animdata_filter_ds_texture(bAnimContext *ac, /* nodes */ if ((tex->nodetree) && !(ads->filterflag & ADS_FILTER_NONTREE)) { - /* owner_id as id instead of texture, since it'll otherwise be impossible to track the depth */ - // FIXME: perhaps as a result, textures should NOT be included under materials, but under their own section instead - // so that free-floating textures can also be animated + /* owner_id as id instead of texture, + * since it'll otherwise be impossible to track the depth. */ + // FIXME: perhaps as a result, textures should NOT be included under materials, + // but under their own section instead so that free-floating textures can also be animated. tmp_items += animdata_filter_ds_nodetree( ac, &tmp_data, ads, (ID *)tex, tex->nodetree, filter_mode); } @@ -2219,7 +2243,7 @@ static size_t animdata_filter_ds_materials( size_t items = 0; int a = 0; - /* first pass: take the materials referenced via the Material slots of the object */ + /* First pass: take the materials referenced via the Material slots of the object. */ for (a = 1; a <= ob->totcol; a++) { Material *ma = give_current_material(ob, a); @@ -2235,10 +2259,12 @@ static size_t animdata_filter_ds_materials( } } - /* second pass: go through a second time looking for "nested" materials (material.material references) + /* Second pass: go through a second time looking for "nested" materials + * (material.material references). * - * NOTE: here we ignore the expanded status of the parent, as it could be too confusing as to why these are - * disappearing/not available, since the relationships between these is not that clear + * NOTE: here we ignore the expanded status of the parent, as it could be too confusing as to + * why these are disappearing/not available, + * since the relationships between these is not that clear. */ if (has_nested) { for (a = 1; a <= ob->totcol; a++) { @@ -2681,7 +2707,8 @@ static size_t animdata_filter_dopesheet_ob( /* firstly add object expander if required */ if (filter_mode & ANIMFILTER_LIST_CHANNELS) { /* check if filtering by selection */ - // XXX: double-check on this - most of the time, a lot of tools need to filter out these channels! + /* XXX: double-check on this - + * most of the time, a lot of tools need to filter out these channels! */ if (ANIMCHANNEL_SELOK((base->flag & BASE_SELECTED))) { /* check if filtering by active status */ if (ANIMCHANNEL_ACTIVEOK(ob)) { @@ -3013,7 +3040,9 @@ static Base **animdata_filter_ds_sorted_bases(bDopeSheet *ads, return sorted_bases; } -// TODO: implement pinning... (if and when pinning is done, what we need to do is to provide freeing mechanisms - to protect against data that was deleted) +// TODO: implement pinning... +// (if and when pinning is done, what we need to do is to provide freeing mechanisms - +// to protect against data that was deleted). static size_t animdata_filter_dopesheet(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, @@ -3052,7 +3081,8 @@ static size_t animdata_filter_dopesheet(bAnimContext *ac, /* movie clip's animation */ items += animdata_filter_dopesheet_movieclips(ac, anim_data, ads, filter_mode); - /* scene-linked animation - e.g. world, compositing nodes, scene anim (including sequencer currently) */ + /* Scene-linked animation - e.g. world, compositing nodes, scene anim + * (including sequencer currently). */ items += animdata_filter_dopesheet_scene(ac, anim_data, ads, scene, filter_mode); /* If filtering for channel drawing, we want the objects in alphabetical order, @@ -3133,8 +3163,8 @@ static short animdata_filter_dopesheet_summary(bAnimContext *ac, (*items)++; } - /* if summary is collapsed, don't show other channels beneath this - * - this check is put inside the summary check so that it doesn't interfere with normal operation + /* If summary is collapsed, don't show other channels beneath this - this check is put inside + * the summary check so that it doesn't interfere with normal operation. */ if (ads->flag & ADS_FLAG_SUMMARY_COLLAPSED) return 0; @@ -3281,7 +3311,8 @@ size_t ANIM_animdata_filter(bAnimContext *ac, } } else { - /* the check for the DopeSheet summary is included here since the summary works here too */ + /* The check for the DopeSheet summary is included here + * since the summary works here too. */ if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items)) items += animfilter_action(ac, anim_data, ads, data, filter_mode, (ID *)obact); } @@ -3300,7 +3331,8 @@ size_t ANIM_animdata_filter(bAnimContext *ac, } } else { - /* the check for the DopeSheet summary is included here since the summary works here too */ + /* The check for the DopeSheet summary is included here + * since the summary works here too. */ if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items)) items = animdata_filter_shapekey(ac, anim_data, key, filter_mode); } diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index fd22fa16fe8..e34d12bc8fa 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -43,9 +43,13 @@ /* ----------------------- Getter functions ----------------------- */ -/* Write into "name" buffer, the name of the property (retrieved using RNA from the curve's settings), +/** + * Write into "name" buffer, the name of the property + * (retrieved using RNA from the curve's settings), * and return the icon used for the struct that this property refers to - * WARNING: name buffer we're writing to cannot exceed 256 chars (check anim_channels_defines.c for details) + * + * \warning name buffer we're writing to cannot exceed 256 chars + * (check anim_channels_defines.c for details). */ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) { @@ -83,17 +87,19 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) * 2) <array-index> <property-name> (<struct name>) * i.e. X Location (Bone1), or X Location (Object) * - * Currently, option 2 is in use, to try and make it easier to quickly identify F-Curves (it does have - * problems with looking rather odd though). Option 1 is better in terms of revealing a consistent sense of - * hierarchy though, which isn't so clear with option 2. + * Currently, option 2 is in use, to try and make it easier to quickly identify F-Curves + * (it does have problems with looking rather odd though). + * Option 1 is better in terms of revealing a consistent sense of hierarchy though, + * which isn't so clear with option 2. */ - /* for structname - * - as base, we use a custom name from the structs if one is available - * - however, if we're showing subdata of bones (probably there will be other exceptions later) - * need to include that info too since it gets confusing otherwise - * - if a pointer just refers to the ID-block, then don't repeat this info - * since this just introduces clutter + /* For structname: + * - As base, we use a custom name from the structs if one is available + * - However, if we're showing subdata of bones + * (probably there will be other exceptions later). + * need to include that info too since it gets confusing otherwise. + * - If a pointer just refers to the ID-block, then don't repeat this info + * since this just introduces clutter. */ if (strstr(fcu->rna_path, "bones") && strstr(fcu->rna_path, "constraints")) { /* perform string 'chopping' to get "Bone Name : Constraint Name" */ diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index beffa47b2c5..8bffb943824 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -118,7 +118,8 @@ ListBase *ED_animcontext_get_markers(const bAnimContext *ac) /** * Apply some transformation to markers after the fact * - * \param markers: List of markers to affect - this may or may not be the scene markers list, so don't assume anything + * \param markers: List of markers to affect - this may or may not be the scene markers list, + * so don't assume anything. * \param scene: Current scene (for getting current frame) * \param mode: (TfmMode) transform mode that this transform is for * \param value: From the transform code, this is ``t->vec[0]`` @@ -326,7 +327,8 @@ TimeMarker *ED_markers_get_first_selected(ListBase *markers) /* --------------------------------- */ /* Print debugging prints of list of markers - * BSI's: do NOT make static or put in if-defs as "unused code". That's too much trouble when we need to use for quick debugging! + * BSI's: do NOT make static or put in if-defs as "unused code". + * That's too much trouble when we need to use for quick debugging! */ void debug_markers_print_list(ListBase *markers) { @@ -1504,7 +1506,13 @@ static void MARKER_OT_rename(wmOperatorType *ot) sizeof(((TimeMarker *)NULL)->name), "Name", "New name for marker"); - //RNA_def_boolean(ot->srna, "ensure_unique", 0, "Ensure Unique", "Ensure that new name is unique within collection of markers"); +#if 0 + RNA_def_boolean(ot->srna, + "ensure_unique", + 0, + "Ensure Unique", + "Ensure that new name is unique within collection of markers"); +#endif } /* **************** make links to scene ***************** */ diff --git a/source/blender/editors/animation/anim_motion_paths.c b/source/blender/editors/animation/anim_motion_paths.c index b1183167945..5ea36627e7a 100644 --- a/source/blender/editors/animation/anim_motion_paths.c +++ b/source/blender/editors/animation/anim_motion_paths.c @@ -249,7 +249,8 @@ void animviz_calc_motionpaths(Depsgraph *depsgraph, /* get copies of objects/bones to get the calculated results from * (for copy-on-write evaluation), so that we actually get some results */ - // TODO: Create a copy of background depsgraph that only contain these entities, and only evaluates them.. + // TODO: Create a copy of background depsgraph that only contain these entities, + // and only evaluates them. for (MPathTarget *mpt = targets->first; mpt; mpt = mpt->next) { mpt->ob_eval = DEG_get_evaluated_object(depsgraph, mpt->ob); diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 92c292f67e8..3f930aae47f 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -102,7 +102,8 @@ FCurve *verify_driver_fcurve(ID *id, const char rna_path[], const int array_inde fcu->rna_path = BLI_strdup(rna_path); fcu->array_index = array_index; - /* if add is negative, don't init this data yet, since it will be filled in by the pasted driver */ + /* If add is negative, don't init this data yet, + * since it will be filled in by the pasted driver. */ if (add > 0) { BezTriple *bezt; size_t i; @@ -629,8 +630,9 @@ bool ANIM_copy_driver( /* copy this to the copy/paste buf if it exists */ if (fcu && fcu->driver) { - /* make copies of some info such as the rna_path, then clear this info from the F-Curve temporarily - * so that we don't end up wasting memory storing the path which won't get used ever... + /* Make copies of some info such as the rna_path, then clear this info from the + * F-Curve temporarily so that we don't end up wasting memory storing the path + * which won't get used ever. */ char *tmp_path = fcu->rna_path; fcu->rna_path = NULL; @@ -916,7 +918,8 @@ static bool add_driver_button_poll(bContext *C) return (fcu == NULL || fcu->driver); } -/* Wrapper for creating a driver without knowing what the targets will be yet (i.e. "manual/add later") */ +/* Wrapper for creating a driver without knowing what the targets will be yet + * (i.e. "manual/add later"). */ static int add_driver_button_none(bContext *C, wmOperator *op, short mapping_type) { PointerRNA ptr = {{NULL}}; @@ -963,7 +966,8 @@ static int add_driver_button_menu_exec(bContext *C, wmOperator *op) /* Create Driver using Eyedropper */ wmOperatorType *ot = WM_operatortype_find("UI_OT_eyedropper_driver", true); - /* XXX: We assume that it's fine to use the same set of properties, since they're actually the same... */ + /* XXX: We assume that it's fine to use the same set of properties, + * since they're actually the same. */ WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, op->ptr); return OPERATOR_FINISHED; diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 919090cdee9..9e96023b272 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -63,7 +63,8 @@ /* UI STUFF */ // XXX! -------------------------------- -/* temporary definition for limits of float number buttons (FLT_MAX tends to infinity with old system) */ +/* Temporary definition for limits of float number buttons + * (FLT_MAX tends to infinity with old system). */ #define UI_FLT_MAX 10000.0f #define B_REDR 1 @@ -97,7 +98,8 @@ static void delete_fmodifier_cb(bContext *C, void *ctx_v, void *fcm_v) ED_undo_push(C, "Delete F-Curve Modifier"); /* send notifiers */ - // XXX for now, this is the only way to get updates in all the right places... but would be nice to have a special one in this case + /* XXX for now, this is the only way to get updates in all the right places... + * but would be nice to have a special one in this case. */ WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); DEG_id_tag_update(ctx->fcurve_owner_id, ID_RECALC_ANIMATION); } diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index de8e6bb1362..86b438846c9 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -211,7 +211,8 @@ static void nupdate_ak_bezt(void *node, void *data) /* count keyframes in this column */ ak->totkey++; - /* for keyframe type, 'proper' keyframes have priority over breakdowns (and other types for now) */ + /* For keyframe type, 'proper' keyframes have priority over breakdowns + * (and other types for now). */ if (BEZKEYTYPE(bezt) == BEZT_KEYTYPE_KEYFRAME) ak->key_type = BEZT_KEYTYPE_KEYFRAME; @@ -273,7 +274,8 @@ static void nupdate_ak_gpframe(void *node, void *data) /* count keyframes in this column */ ak->totkey++; - /* for keyframe type, 'proper' keyframes have priority over breakdowns (and other types for now) */ + /* for keyframe type, 'proper' keyframes have priority over breakdowns + * (and other types for now). */ if (gpf->key_type == BEZT_KEYTYPE_KEYFRAME) ak->key_type = BEZT_KEYTYPE_KEYFRAME; } @@ -777,8 +779,10 @@ static void draw_keylist(View2D *v2d, /* count keys */ uint key_len = 0; for (ActKeyColumn *ak = keys->first; ak; ak = ak->next) { - /* optimization: if keyframe doesn't appear within 5 units (screenspace) in visible area, don't draw - * - this might give some improvements, since we current have to flip between view/region matrices + /* Optimization: if keyframe doesn't appear within 5 units (screenspace) + * in visible area, don't draw. + * This might give some improvements, + * since we current have to flip between view/region matrices. */ if (IN_RANGE_INCL(ak->cfra, v2d->cur.xmin, v2d->cur.xmax)) key_len++; @@ -1216,7 +1220,8 @@ void gpl_to_keylist(bDopeSheet *UNUSED(ads), bGPDlayer *gpl, DLRBT_Tree *keys) bGPDframe *gpf; if (gpl && keys) { - /* although the frames should already be in an ordered list, they are not suitable for displaying yet */ + /* Although the frames should already be in an ordered list, + * they are not suitable for displaying yet. */ for (gpf = gpl->frames.first; gpf; gpf = gpf->next) add_gpframe_to_keycolumns_list(keys, gpf); diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index bb0ab112af4..e0df1942495 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -43,7 +43,8 @@ #include "ED_keyframes_edit.h" #include "ED_markers.h" -/* This file defines an API and set of callback-operators for non-destructive editing of keyframe data. +/* This file defines an API and set of callback-operators for + * non-destructive editing of keyframe data. * * Two API functions are defined for actually performing the operations on the data: * ANIM_fcurve_keyframes_loop() @@ -146,7 +147,7 @@ short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, return 0; } -/* -------------------------------- Further Abstracted (Not Exposed Directly) ----------------------------- */ +/* --------------------- Further Abstracted (Not Exposed Directly) ----------------------------- */ /* This function is used to loop over the keyframe data in an Action Group */ static short agrp_keyframes_loop(KeyframeEditData *ked, @@ -467,9 +468,11 @@ void ANIM_editkeyframes_refresh(bAnimContext *ac) /* ------------------------ */ /* Some macros to make this easier... */ -/* run the given check on the 3 handles - * - check should be a macro, which takes the handle index as its single arg, which it substitutes later - * - requires that a var, of type short, is named 'ok', and has been initialized to 0 +/* run the given check on the 3 handles: + * - Check should be a macro, which takes the handle index as its single arg, + * which it substitutes later. + * - Requires that a var, of type short, is named 'ok', + * and has been initialized to 0. */ #define KEYFRAME_OK_CHECKS(check) \ { \ @@ -529,9 +532,10 @@ static short ok_bezier_value(KeyframeEditData *ked, BezTriple *bezt) { short ok = 0; - /* value is stored in f1 property - * - this float accuracy check may need to be dropped? - * - should value be stored in f2 instead so that we won't have conflicts when using f1 for frames too? + /* Value is stored in f1 property: + * - This float accuracy check may need to be dropped? + * - Should value be stored in f2 instead + * so that we won't have conflicts when using f1 for frames too? */ #define KEY_CHECK_OK(_index) IS_EQF(bezt->vec[_index][1], ked->f1) KEYFRAME_OK_CHECKS(KEY_CHECK_OK); @@ -998,8 +1002,10 @@ KeyframeEditFunc ANIM_editkeyframes_mirror(short type) /* ******************************************* */ /* Settings */ -/* standard validation step for a few of these (implemented as macro for inlining without fn-call overhead): - * "if the handles are not of the same type, set them to type free" +/** + * Standard validation step for a few of these + * (implemented as macro for inlining without fn-call overhead): + * "if the handles are not of the same type, set them to type free". */ #define ENSURE_HANDLES_MATCH(bezt) \ if (bezt->h1 != bezt->h2) { \ diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 945327ed78b..3109ae6c553 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -173,8 +173,9 @@ void duplicate_fcurve_keys(FCurve *fcu) /* **************************************************** */ /* Various Tools */ -/* Basic F-Curve 'cleanup' function that removes 'double points' and unnecessary keyframes on linear-segments only - * optionally clears up curve if one keyframe with default value remains +/** + * Basic F-Curve 'cleanup' function that removes 'double points' and unnecessary keyframes on + * linear-segments only optionally clears up curve if one keyframe with default value remains. */ void clean_fcurve(struct bAnimContext *ac, bAnimListElem *ale, float thresh, bool cleardefault) { @@ -373,7 +374,8 @@ void smooth_fcurve(FCurve *fcu) /* round 1: calculate smoothing deltas and new values */ tsb = tarray; for (i = 0; i < totSel; i++, tsb++) { - /* don't touch end points (otherwise, curves slowly explode, as we don't have enough data there) */ + /* Don't touch end points (otherwise, curves slowly explode, + * as we don't have enough data there). */ if (ELEM(i, 0, (totSel - 1)) == 0) { const tSmooth_Bezt *tP1 = tsb - 1; const tSmooth_Bezt *tP2 = (i - 2 > 0) ? (tsb - 2) : (NULL); @@ -500,11 +502,12 @@ void sample_fcurve(FCurve *fcu) } /* **************************************************** */ -/* Copy/Paste Tools */ -/* - The copy/paste buffer currently stores a set of temporary F-Curves containing only the keyframes - * that were selected in each of the original F-Curves - * - All pasted frames are offset by the same amount. This is calculated as the difference in the times of - * the current frame and the 'first keyframe' (i.e. the earliest one in all channels). +/* Copy/Paste Tools: + * - The copy/paste buffer currently stores a set of temporary F-Curves containing only the + * keyframes that were selected in each of the original F-Curves. + * - All pasted frames are offset by the same amount. + * This is calculated as the difference in the times of the current frame and the + * 'first keyframe' (i.e. the earliest one in all channels). * - The earliest frame is calculated per copy operation. */ @@ -591,8 +594,9 @@ short copy_animedit_keys(bAnimContext *ac, ListBase *anim_data) aci->rna_path = MEM_dupallocN(fcu->rna_path); aci->array_index = fcu->array_index; - /* detect if this is a bone. We do that here rather than during pasting because ID pointers will get invalidated if we undo. - * storing the relevant information here helps avoiding crashes if we undo-repaste */ + /* Detect if this is a bone. We do that here rather than during pasting because ID pointers + * will get invalidated if we undo. + * Storing the relevant information here helps avoiding crashes if we undo-repaste. */ if ((aci->id_type == ID_OB) && (((Object *)aci->id)->type == OB_ARMATURE) && aci->rna_path) { Object *ob = (Object *)aci->id; bPoseChannel *pchan; @@ -1005,10 +1009,11 @@ short paste_animedit_keys(bAnimContext *ac, unsigned int totmatch = 0; for (ale = anim_data->first; ale; ale = ale->next) { - /* find buffer item to paste from - * - if names don't matter (i.e. only 1 channel in buffer), don't check id/group - * - if names do matter, only check if id-type is ok for now (group check is not that important) - * - most importantly, rna-paths should match (array indices are unimportant for now) + /* Find buffer item to paste from: + * - If names don't matter (i.e. only 1 channel in buffer), don't check id/group + * - If names do matter, only check if id-type is ok for now + * (group check is not that important). + * - Most importantly, rna-paths should match (array indices are unimportant for now) */ AnimData *adt = ANIM_nla_mapping_get(ac, ale); FCurve *fcu = (FCurve *)ale->data; /* destination F-Curve */ diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index cc8dbbca439..56c52665613 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -398,7 +398,8 @@ int insert_bezt_fcurve(FCurve *fcu, const BezTriple *bezt, eInsertKeyFlags flag) } if (flag & INSERTKEY_CYCLE_AWARE) { - /* If replacing an end point of a cyclic curve without offset, modify the other end too. */ + /* If replacing an end point of a cyclic curve without offset, + * modify the other end too. */ if ((i == 0 || i == fcu->totvert - 1) && BKE_fcurve_get_cycle_type(fcu) == FCU_CYCLE_PERFECT) { replace_bezt_keyframe_ypos(&fcu->bezt[i == 0 ? fcu->totvert - 1 : 0], bezt); @@ -411,7 +412,8 @@ int insert_bezt_fcurve(FCurve *fcu, const BezTriple *bezt, eInsertKeyFlags flag) /* insert new - if we're not restricted to replacing keyframes only */ BezTriple *newb = MEM_callocN((fcu->totvert + 1) * sizeof(BezTriple), "beztriple"); - /* add the beztriples that should occur before the beztriple to be pasted (originally in fcu) */ + /* Add the beztriples that should occur before the beztriple to be pasted + * (originally in fcu). */ if (i > 0) memcpy(newb, fcu->bezt, i * sizeof(BezTriple)); @@ -545,9 +547,10 @@ int insert_vert_fcurve( if ((fcu->totvert > 2) && (flag & INSERTKEY_REPLACE) == 0) { BezTriple *bezt = (fcu->bezt + a); - /* set interpolation from previous (if available), but only if we didn't just replace some keyframe - * - replacement is indicated by no-change in number of verts - * - when replacing, the user may have specified some interpolation that should be kept + /* Set interpolation from previous (if available), + * but only if we didn't just replace some keyframe: + * - Replacement is indicated by no-change in number of verts. + * - When replacing, the user may have specified some interpolation that should be kept. */ if (fcu->totvert > oldTot) { if (a > 0) @@ -1146,8 +1149,9 @@ static bool insert_keyframe_value(ReportList *reports, } /* Secondary Keyframing API call: - * Use this when validation of necessary animation data is not necessary, since an RNA-pointer to the necessary - * data being keyframed, and a pointer to the F-Curve to use have both been provided. + * Use this when validation of necessary animation data is not necessary, + * since an RNA-pointer to the necessary data being keyframed, + * and a pointer to the F-Curve to use have both been provided. * * This function can't keyframe quaternion channels on some NLA strip types. * @@ -2205,8 +2209,9 @@ static int delete_key_v3d_exec(bContext *C, wmOperator *op) continue; } - /* special exception for bones, as this makes this operator more convenient to use - * NOTE: This is only done in pose mode. In object mode, we're dealing with the entire object. + /* Special exception for bones, as this makes this operator more convenient to use + * NOTE: This is only done in pose mode. + * In object mode, we're dealing with the entire object. */ if ((ob->mode & OB_MODE_POSE) && strstr(fcu->rna_path, "pose.bones[\"")) { bPoseChannel *pchan; @@ -2355,8 +2360,9 @@ static int insert_key_button_exec(bContext *C, wmOperator *op) const char *group = NULL; /* Special exception for keyframing transforms: - * Set "group" for this manually, instead of having them appearing at the bottom (ungrouped) - * part of the channels list. Leaving these ungrouped is not a nice user behavior in this case. + * Set "group" for this manually, instead of having them appearing at the bottom + * (ungrouped) part of the channels list. + * Leaving these ungrouped is not a nice user behavior in this case. * * TODO: Perhaps we can extend this behavior in future for other properties... */ diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 93bae636571..90651a55a42 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -461,7 +461,8 @@ 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 */ +/* 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)) { @@ -526,7 +527,7 @@ ListBase builtin_keyingsets = {NULL, NULL}; /* --------------- */ -/* Find KeyingSet type info given a name */ +/* Find KeyingSet type info given a name. */ KeyingSetInfo *ANIM_keyingset_info_find_name(const char name[]) { /* sanity checks */ @@ -537,7 +538,7 @@ KeyingSetInfo *ANIM_keyingset_info_find_name(const char name[]) return BLI_findstring(&keyingset_type_infos, name, offsetof(KeyingSetInfo, idname)); } -/* Find builtin KeyingSet by name */ +/* Find builtin KeyingSet by name. */ KeyingSet *ANIM_builtin_keyingset_get_named(KeyingSet *prevKS, const char name[]) { KeyingSet *ks, *first = NULL; @@ -569,7 +570,8 @@ KeyingSet *ANIM_builtin_keyingset_get_named(KeyingSet *prevKS, const char name[] /* --------------- */ -/* Add the given KeyingSetInfo to the list of type infos, and create an appropriate builtin set too */ +/* Add the given KeyingSetInfo to the list of type infos, + * and create an appropriate builtin set too. */ void ANIM_keyingset_info_register(KeyingSetInfo *ksi) { KeyingSet *ks; @@ -589,7 +591,8 @@ void ANIM_keyingset_info_register(KeyingSetInfo *ksi) BLI_addtail(&keyingset_type_infos, ksi); } -/* Remove the given KeyingSetInfo from the list of type infos, and also remove the builtin set if appropriate */ +/* Remove the given KeyingSetInfo from the list of type infos, + * and also remove the builtin set if appropriate. */ void ANIM_keyingset_info_unregister(Main *bmain, KeyingSetInfo *ksi) { KeyingSet *ks, *ksn; @@ -1037,7 +1040,8 @@ int ANIM_apply_keyingset( continue; } - /* since keying settings can be defined on the paths too, apply the settings for this path first */ + /* Since keying settings can be defined on the paths too, + * apply the settings for this path first. */ kflag2 = keyingset_apply_keying_flags(kflag, ksp->keyingoverride, ksp->keyingflag); /* get pointer to name of group to add channels to */ |