Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_convert.c
| Show First 20 Lines • Show All 1,020 Lines • ▼ Show 20 Lines | if (BLI_listbase_is_empty(&retained_keys)) { | ||||
| /* This may happen if none of the points were selected... */ | /* This may happen if none of the points were selected... */ | ||||
| if (G.debug & G_DEBUG) { | if (G.debug & G_DEBUG) { | ||||
| printf("%s: nothing to do for FCurve %p (rna_path = '%s')\n", __func__, fcu, fcu->rna_path); | printf("%s: nothing to do for FCurve %p (rna_path = '%s')\n", __func__, fcu, fcu->rna_path); | ||||
| } | } | ||||
| return; | return; | ||||
| } | } | ||||
| else { | else { | ||||
| /* Compute the average values for each retained keyframe */ | /* Compute the average values for each retained keyframe */ | ||||
| for (tRetainedKeyframe *rk = retained_keys.first; rk; rk = rk->next) { | LISTBASE_FOREACH (tRetainedKeyframe *, rk, &retained_keys) { | ||||
| rk->val = rk->val / (float)rk->tot_count; | rk->val = rk->val / (float)rk->tot_count; | ||||
| } | } | ||||
| } | } | ||||
| /* 2) Delete all keyframes duplicating the "retained keys" found above | /* 2) Delete all keyframes duplicating the "retained keys" found above | ||||
| * - Most of these will be unselected keyframes | * - Most of these will be unselected keyframes | ||||
| * - Some will be selected keyframes though. For those, we only keep the last one | * - Some will be selected keyframes though. For those, we only keep the last one | ||||
| * (or else everything is gone), and replace its value with the averaged value. | * (or else everything is gone), and replace its value with the averaged value. | ||||
| ▲ Show 20 Lines • Show All 711 Lines • ▼ Show 20 Lines | |||||
| static void special_aftertrans_update__movieclip(bContext *C, TransInfo *t) | static void special_aftertrans_update__movieclip(bContext *C, TransInfo *t) | ||||
| { | { | ||||
| SpaceClip *sc = t->area->spacedata.first; | SpaceClip *sc = t->area->spacedata.first; | ||||
| MovieClip *clip = ED_space_clip_get_clip(sc); | MovieClip *clip = ED_space_clip_get_clip(sc); | ||||
| ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(&clip->tracking); | ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(&clip->tracking); | ||||
| const int framenr = ED_space_clip_get_clip_frame_number(sc); | const int framenr = ED_space_clip_get_clip_frame_number(sc); | ||||
| /* Update coordinates of modified plane tracks. */ | /* Update coordinates of modified plane tracks. */ | ||||
| for (MovieTrackingPlaneTrack *plane_track = plane_tracks_base->first; plane_track; | LISTBASE_FOREACH (MovieTrackingPlaneTrack *, plane_track, plane_tracks_base) { | ||||
| plane_track = plane_track->next) { | |||||
| bool do_update = false; | bool do_update = false; | ||||
| if (plane_track->flag & PLANE_TRACK_HIDDEN) { | if (plane_track->flag & PLANE_TRACK_HIDDEN) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| do_update |= PLANE_TRACK_VIEW_SELECTED(plane_track) != 0; | do_update |= PLANE_TRACK_VIEW_SELECTED(plane_track) != 0; | ||||
| if (do_update == false) { | if (do_update == false) { | ||||
| if ((plane_track->flag & PLANE_TRACK_AUTOKEY) == 0) { | if ((plane_track->flag & PLANE_TRACK_AUTOKEY) == 0) { | ||||
| int i; | int i; | ||||
| ▲ Show 20 Lines • Show All 306 Lines • ▼ Show 20 Lines | else if (ac.datatype == ANIMCONT_GPENCIL) { | ||||
| * 3) canceled + duplicate -> user canceled the transform, | * 3) canceled + duplicate -> user canceled the transform, | ||||
| * but we made duplicates, so get rid of these | * but we made duplicates, so get rid of these | ||||
| */ | */ | ||||
| if ((saction->flag & SACTION_NOTRANSKEYCULL) == 0 && ((canceled == 0) || (duplicate))) { | if ((saction->flag & SACTION_NOTRANSKEYCULL) == 0 && ((canceled == 0) || (duplicate))) { | ||||
| ListBase anim_data = {NULL, NULL}; | ListBase anim_data = {NULL, NULL}; | ||||
| const int filter = ANIMFILTER_DATA_VISIBLE; | const int filter = ANIMFILTER_DATA_VISIBLE; | ||||
| ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); | ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); | ||||
| for (bAnimListElem *ale = anim_data.first; ale; ale = ale->next) { | LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) { | ||||
| if (ale->datatype == ALE_GPFRAME) { | if (ale->datatype == ALE_GPFRAME) { | ||||
| ale->id->tag |= LIB_TAG_DOIT; | ale->id->tag |= LIB_TAG_DOIT; | ||||
| } | } | ||||
| } | } | ||||
| for (bAnimListElem *ale = anim_data.first; ale; ale = ale->next) { | LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) { | ||||
| if (ale->datatype == ALE_GPFRAME) { | if (ale->datatype == ALE_GPFRAME) { | ||||
| if (ale->id->tag & LIB_TAG_DOIT) { | if (ale->id->tag & LIB_TAG_DOIT) { | ||||
| ale->id->tag &= ~LIB_TAG_DOIT; | ale->id->tag &= ~LIB_TAG_DOIT; | ||||
| posttrans_gpd_clean((bGPdata *)ale->id); | posttrans_gpd_clean((bGPdata *)ale->id); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| Show All 9 Lines | else if (ac.datatype == ANIMCONT_MASK) { | ||||
| * 3) Canceled + duplicate: | * 3) Canceled + duplicate: | ||||
| * User canceled the transform, but we made duplicates, so get rid of these. | * User canceled the transform, but we made duplicates, so get rid of these. | ||||
| */ | */ | ||||
| if ((saction->flag & SACTION_NOTRANSKEYCULL) == 0 && ((canceled == 0) || (duplicate))) { | if ((saction->flag & SACTION_NOTRANSKEYCULL) == 0 && ((canceled == 0) || (duplicate))) { | ||||
| ListBase anim_data = {NULL, NULL}; | ListBase anim_data = {NULL, NULL}; | ||||
| const int filter = ANIMFILTER_DATA_VISIBLE; | const int filter = ANIMFILTER_DATA_VISIBLE; | ||||
| ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); | ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); | ||||
| for (bAnimListElem *ale = anim_data.first; ale; ale = ale->next) { | LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) { | ||||
| if (ale->datatype == ALE_MASKLAY) { | if (ale->datatype == ALE_MASKLAY) { | ||||
| ale->id->tag |= LIB_TAG_DOIT; | ale->id->tag |= LIB_TAG_DOIT; | ||||
| } | } | ||||
| } | } | ||||
| for (bAnimListElem *ale = anim_data.first; ale; ale = ale->next) { | LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) { | ||||
| if (ale->datatype == ALE_MASKLAY) { | if (ale->datatype == ALE_MASKLAY) { | ||||
| if (ale->id->tag & LIB_TAG_DOIT) { | if (ale->id->tag & LIB_TAG_DOIT) { | ||||
| ale->id->tag &= ~LIB_TAG_DOIT; | ale->id->tag &= ~LIB_TAG_DOIT; | ||||
| posttrans_mask_clean((Mask *)ale->id); | posttrans_mask_clean((Mask *)ale->id); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| ▲ Show 20 Lines • Show All 713 Lines • Show Last 20 Lines | |||||