diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-07 14:04:16 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-07 14:04:16 +0300 |
commit | 508e34d0bf68c837c3b0ece72faaab809df52506 (patch) | |
tree | aeeafa9c1b853dacd38056bb5bf825c04863b481 /source/blender/editors/animation/keyframing.c | |
parent | 4e014727f6ed1652fd922ba25ec00b0f9df694f9 (diff) | |
parent | b3a7a75a266de6765d8c04953c0dabce3c30c359 (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/editors/animation/anim_deps.c
source/blender/editors/animation/keyframing.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/pose_edit.c
source/blender/editors/armature/pose_transform.c
source/blender/editors/gpencil/gpencil_convert.c
source/blender/editors/include/ED_anim_api.h
source/blender/editors/include/ED_keyframing.h
source/blender/editors/interface/interface_anim.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/transform/transform_conversions.c
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_pose.c
source/blender/python/intern/bpy_rna_anim.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index e6f2f087ede..6f2360767c0 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -53,17 +53,18 @@ #include "DNA_object_types.h" #include "DNA_rigidbody_types.h" -#include "BKE_animsys.h" #include "BKE_action.h" +#include "BKE_animsys.h" #include "BKE_armature.h" +#include "BKE_context.h" #include "BKE_fcurve.h" -#include "BKE_idcode.h" -#include "BKE_nla.h" #include "BKE_global.h" -#include "BKE_context.h" -#include "BKE_report.h" +#include "BKE_idcode.h" #include "BKE_key.h" +#include "BKE_main.h" #include "BKE_material.h" +#include "BKE_nla.h" +#include "BKE_report.h" #include "DEG_depsgraph.h" #include "DEG_depsgraph_build.h" @@ -126,7 +127,7 @@ short ANIM_get_keyframing_flags(Scene *scene, short incl_mode) /* Get (or add relevant data to be able to do so) the Active Action for the given * Animation Data block, given an ID block where the Animation Data should reside. */ -bAction *verify_adt_action(ID *id, short add) +bAction *verify_adt_action(Main *bmain, ID *id, short add) { AnimData *adt; @@ -148,7 +149,7 @@ bAction *verify_adt_action(ID *id, short add) BLI_snprintf(actname, sizeof(actname), "%sAction", id->name + 2); /* create action */ - adt->action = BKE_action_add(G.main, actname); + adt->action = BKE_action_add(bmain, actname); /* set ID-type from ID-block that this is going to be assigned to * so that users can't accidentally break actions by assigning them @@ -158,7 +159,7 @@ bAction *verify_adt_action(ID *id, short add) /* tag depsgraph to be rebuilt to include time dependency */ /* XXX: we probably should have bmain passed down, but that involves altering too many API's */ - DEG_relations_tag_update(G.main); + DEG_relations_tag_update(bmain); } DEG_id_tag_update(&adt->action->id, DEG_TAG_COPY_ON_WRITE); @@ -1021,7 +1022,9 @@ bool insert_keyframe_direct(Depsgraph *depsgraph, ReportList *reports, PointerRN * * index of -1 keys all array indices */ -short insert_keyframe(Depsgraph *depsgraph, ReportList *reports, ID *id, bAction *act, const char group[], const char rna_path[], int array_index, float cfra, eBezTriple_KeyframeType keytype, eInsertKeyFlags flag) +short insert_keyframe( + Main *bmain, Depsgraph *depsgraph, ReportList *reports, ID *id, bAction *act, + const char group[], const char rna_path[], int array_index, float cfra, eBezTriple_KeyframeType keytype, eInsertKeyFlags flag) { PointerRNA id_ptr, ptr; PropertyRNA *prop = NULL; @@ -1047,7 +1050,7 @@ short insert_keyframe(Depsgraph *depsgraph, ReportList *reports, ID *id, bAction /* if no action is provided, keyframe to the default one attached to this ID-block */ if (act == NULL) { /* get action to add F-Curve+keyframe to */ - act = verify_adt_action(id, 1); + act = verify_adt_action(bmain, id, 1); if (act == NULL) { BKE_reportf(reports, RPT_ERROR, @@ -1773,6 +1776,7 @@ void ANIM_OT_keyframe_delete_v3d(wmOperatorType *ot) static int insert_key_button_exec(bContext *C, wmOperator *op) { Depsgraph *depsgraph = CTX_data_depsgraph(C); + Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); ToolSettings *ts = scene->toolsettings; PointerRNA ptr = {{NULL}}; @@ -1856,7 +1860,7 @@ static int insert_key_button_exec(bContext *C, wmOperator *op) index = -1; } - success = insert_keyframe(depsgraph, op->reports, ptr.id.data, NULL, group, path, index, cfra, ts->keyframe_type, flag); + success = insert_keyframe(bmain, depsgraph, op->reports, ptr.id.data, NULL, group, path, index, cfra, ts->keyframe_type, flag); MEM_freeN(path); } |