Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/keyframing.c
| Show First 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | if ((adt->action == NULL) && (add)) { | ||||
| * to the wrong places | * to the wrong places | ||||
| */ | */ | ||||
| adt->action->idroot = GS(id->name); | adt->action->idroot = GS(id->name); | ||||
| /* Tag depsgraph to be rebuilt to include time dependency. */ | /* Tag depsgraph to be rebuilt to include time dependency. */ | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| } | } | ||||
| DEG_id_tag_update(&adt->action->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&adt->action->id, ID_RECALC_ANIMATION_NO_FLUSH); | ||||
| /* return the action */ | /* return the action */ | ||||
| return adt->action; | return adt->action; | ||||
| } | } | ||||
| /* Get (or add relevant data to be able to do so) F-Curve from the Active Action, | /* Get (or add relevant data to be able to do so) F-Curve from the Active Action, | ||||
| * for the given Animation Data block. This assumes that all the destinations are valid. | * for the given Animation Data block. This assumes that all the destinations are valid. | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 1,143 Lines • ▼ Show 20 Lines | short insert_keyframe( | ||||
| if (values != value_buffer) { | if (values != value_buffer) { | ||||
| MEM_freeN(values); | MEM_freeN(values); | ||||
| } | } | ||||
| BKE_animsys_free_nla_keyframing_context_cache(&tmp_nla_cache); | BKE_animsys_free_nla_keyframing_context_cache(&tmp_nla_cache); | ||||
| if (ret) { | if (ret) { | ||||
| if (act != NULL) { | if (act != NULL) { | ||||
| DEG_id_tag_update(&act->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&act->id, ID_RECALC_ANIMATION_NO_FLUSH); | ||||
| } | } | ||||
| if (adt != NULL && adt->action != NULL && adt->action != act) { | if (adt != NULL && adt->action != NULL && adt->action != act) { | ||||
| DEG_id_tag_update(&adt->action->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update(&adt->action->id, ID_RECALC_ANIMATION_NO_FLUSH); | ||||
| } | } | ||||
| } | } | ||||
| return ret; | return ret; | ||||
| } | } | ||||
| /* ************************************************** */ | /* ************************************************** */ | ||||
| /* KEYFRAME DELETION */ | /* KEYFRAME DELETION */ | ||||
| Show All 34 Lines | |||||
| } | } | ||||
| static void deg_tag_after_keyframe_delete(Main *bmain, ID *id, AnimData *adt) | static void deg_tag_after_keyframe_delete(Main *bmain, ID *id, AnimData *adt) | ||||
| { | { | ||||
| if (adt->action == NULL) { | if (adt->action == NULL) { | ||||
| /* In the case last f-curve wes removed need to inform dependency graph | /* In the case last f-curve wes removed need to inform dependency graph | ||||
| * about relations update, since it needs to get rid of animation operation | * about relations update, since it needs to get rid of animation operation | ||||
| * for this datablock. */ | * for this datablock. */ | ||||
| DEG_id_tag_update_ex(bmain, id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update_ex(bmain, id, ID_RECALC_ANIMATION_NO_FLUSH); | ||||
| DEG_relations_tag_update(bmain); | DEG_relations_tag_update(bmain); | ||||
| } | } | ||||
| else { | else { | ||||
| DEG_id_tag_update_ex(bmain, &adt->action->id, ID_RECALC_COPY_ON_WRITE); | DEG_id_tag_update_ex(bmain, &adt->action->id, ID_RECALC_ANIMATION_NO_FLUSH); | ||||
| } | } | ||||
| } | } | ||||
| short delete_keyframe(Main *bmain, ReportList *reports, ID *id, bAction *act, | short delete_keyframe(Main *bmain, ReportList *reports, ID *id, bAction *act, | ||||
| const char group[], const char rna_path[], int array_index, float cfra, | const char group[], const char rna_path[], int array_index, float cfra, | ||||
| eInsertKeyFlags UNUSED(flag)) | eInsertKeyFlags UNUSED(flag)) | ||||
| { | { | ||||
| AnimData *adt = BKE_animdata_from_id(id); | AnimData *adt = BKE_animdata_from_id(id); | ||||
| ▲ Show 20 Lines • Show All 1,205 Lines • Show Last 20 Lines | |||||