[Bf-blender-cvs] [1fc49878f5f] active-fcurve-keyframe: Changes from Julian
Hans Goudey
noreply at git.blender.org
Thu Jul 16 20:16:22 CEST 2020
Commit: 1fc49878f5f3c5e4c4483e8c0bb041bb31f8fdd4
Author: Hans Goudey
Date: Wed Jun 3 13:48:48 2020 -0400
Branches: active-fcurve-keyframe
https://developer.blender.org/rB1fc49878f5f3c5e4c4483e8c0bb041bb31f8fdd4
Changes from Julian
===================================================================
M source/blender/editors/space_graph/graph_buttons.c
M source/blender/editors/space_graph/graph_select.c
M source/blender/makesdna/DNA_anim_types.h
===================================================================
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index fdd97d3dca4..0cb81c530c8 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -235,10 +235,12 @@ static void graph_panel_properties(const bContext *C, Panel *panel)
/* ******************* active Keyframe ************** */
/* get 'active' keyframe for panel editing */
-static bool get_active_fcurve_keyframe_edit(FCurve *fcu, BezTriple **bezt, BezTriple **prevbezt)
+static bool get_active_fcurve_keyframe_edit(FCurve *fcu,
+ BezTriple **r_bezt,
+ BezTriple **r_prevbezt)
{
/* zero the pointers */
- *bezt = *prevbezt = NULL;
+ *r_bezt = *r_prevbezt = NULL;
int active_key = fcu->active_key;
@@ -249,9 +251,9 @@ static bool get_active_fcurve_keyframe_edit(FCurve *fcu, BezTriple **bezt, BezTr
}
if (BEZT_ISSEL_ANY(&fcu->bezt[active_key])) {
- *bezt = &fcu->bezt[active_key];
+ *r_bezt = &fcu->bezt[active_key];
/* Previous is either one before the active, or the point itself if it's the first. */
- *prevbezt = &fcu->bezt[(active_key > 0) ? active_key - 1 : active_key];
+ *r_prevbezt = &fcu->bezt[(active_key > 0) ? active_key - 1 : active_key];
return true;
}
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index 2caf6313c03..7298c4e58b8 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -1515,7 +1515,8 @@ static int mouse_graph_keys(bAnimContext *ac,
/* Set the curve's active keyframe. */
if (BEZT_ISSEL_ANY(bezt) && (select_mode == SELECT_ADD || !already_selected)) {
BLI_assert(nvi->fcu != NULL);
- nvi->fcu->active_key = (int)(bezt - nvi->fcu->bezt);
+ BLI_assert((bezt - nvi->fcu->bezt) >= 0);
+ nvi->fcu->active_key = bezt - nvi->fcu->bezt;
}
}
else if (nvi->fpt) {
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h
index 0dadff90198..a1d8463dd3a 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -589,7 +589,7 @@ typedef struct FCurve {
unsigned int totvert;
/** Active keyframe for numerical editing in the interface. */
- int active_key;
+ unsigned int active_key;
char _pad1[4];
/* value cache + settings */
More information about the Bf-blender-cvs
mailing list