Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/editors/animation/keyframing.c15
-rw-r--r--source/blender/makesdna/DNA_anim_types.h3
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c2
-rw-r--r--source/blender/python/intern/bpy_rna_anim.c9
4 files changed, 21 insertions, 8 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 9008d330c21..8a02aed15bc 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -396,11 +396,18 @@ int insert_vert_fcurve(FCurve *fcu, float x, float y, short flag)
beztr.vec[2][0] = x + 1.0f;
beztr.vec[2][1] = y;
beztr.f1 = beztr.f2 = beztr.f3 = SELECT;
- beztr.h1 = beztr.h2 = U.keyhandles_new; /* use default handle type here */
- //BEZKEYTYPE(&beztr)= scene->keytype; /* default keyframe type */
- /* use default interpolation mode, with exceptions for int/discrete values */
- beztr.ipo = U.ipo_new;
+ if (flag & INSERTKEY_NO_USERPREF) {
+ beztr.h1 = beztr.h2 = HD_AUTO_ANIM;
+ beztr.ipo = BEZT_IPO_BEZ;
+ }
+ else {
+ beztr.h1 = beztr.h2 = U.keyhandles_new; /* use default handle type here */
+ //BEZKEYTYPE(&beztr)= scene->keytype; /* default keyframe type */
+
+ /* use default interpolation mode, with exceptions for int/discrete values */
+ beztr.ipo = U.ipo_new;
+ }
if (fcu->flag & FCURVE_DISCRETE_VALUES)
beztr.ipo = BEZT_IPO_CONST;
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h
index 8c04c41650d..390233a433d 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -791,7 +791,8 @@ typedef enum eInsertKeyFlags {
INSERTKEY_FAST = (1<<2), /* don't recalculate handles,etc. after adding key */
INSERTKEY_FASTR = (1<<3), /* don't realloc mem (or increase count, as array has already been set out) */
INSERTKEY_REPLACE = (1<<4), /* only replace an existing keyframe (this overrides INSERTKEY_NEEDED) */
- INSERTKEY_XYZ2RGB = (1<<5) /* transform F-Curves should have XYZ->RGB color mode */
+ INSERTKEY_XYZ2RGB = (1<<5), /* transform F-Curves should have XYZ->RGB color mode */
+ INSERTKEY_NO_USERPREF = (1 << 6), /* ignore user-prefs (needed for predictable API use) */
} eInsertKeyFlags;
/* ************************************************ */
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index bf07aaef5ef..00caa3ba711 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -738,7 +738,7 @@ static void rna_FModifierStepped_end_frame_range(PointerRNA *ptr, float *min, fl
static BezTriple *rna_FKeyframe_points_insert(FCurve *fcu, float frame, float value, int flag)
{
- int index = insert_vert_fcurve(fcu, frame, value, flag);
+ int index = insert_vert_fcurve(fcu, frame, value, flag | INSERTKEY_NO_USERPREF);
return ((fcu->bezt) && (index >= 0)) ? (fcu->bezt + index) : NULL;
}
diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c
index 3320043aeb5..ed51ba5bd1f 100644
--- a/source/blender/python/intern/bpy_rna_anim.c
+++ b/source/blender/python/intern/bpy_rna_anim.c
@@ -168,8 +168,13 @@ static int pyrna_struct_keyframe_parse(
*cfra = CTX_data_scene(BPy_GetContext())->r.cfra;
/* flag may be null (no option currently for remove keyframes e.g.). */
- if (pyoptions && options && (pyrna_set_to_enum_bitfield(keying_flag_items, pyoptions, options, error_prefix) == -1))
- return -1;
+ if (options) {
+ if (pyoptions && (pyrna_set_to_enum_bitfield(keying_flag_items, pyoptions, options, error_prefix) == -1)) {
+ return -1;
+ }
+
+ *options |= INSERTKEY_NO_USERPREF;
+ }
return 0; /* success */
}