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:
authorCampbell Barton <ideasman42@gmail.com>2011-10-13 07:35:08 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-13 07:35:08 +0400
commit49b1a319c44f0ac3db45652f4cb022d2e1a93d40 (patch)
tree86f296c604f816ce1de6e2946deee126ebbcea67 /source/blender/editors/space_action/action_edit.c
parentfa033e313ea7380746a7bbe42a9a7665c85b43d8 (diff)
fix [#28898] Segmentation fault when Home key during GreasePencil dopesheet pressed
Diffstat (limited to 'source/blender/editors/space_action/action_edit.c')
-rw-r--r--source/blender/editors/space_action/action_edit.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index a05053a2d9d..7bf0f98b471 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -246,20 +246,32 @@ static void get_keyframe_extents (bAnimContext *ac, float *min, float *max, cons
/* go through channels, finding max extents */
for (ale= anim_data.first; ale; ale= ale->next) {
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
- FCurve *fcu= (FCurve *)ale->key_data;
- float tmin, tmax;
-
- /* get range and apply necessary scaling before processing */
- calc_fcurve_range(fcu, &tmin, &tmax, onlySel);
-
- if (adt) {
- tmin= BKE_nla_tweakedit_remap(adt, tmin, NLATIME_CONVERT_MAP);
- tmax= BKE_nla_tweakedit_remap(adt, tmax, NLATIME_CONVERT_MAP);
+ if (ale->datatype == ALE_GPFRAME) {
+ bGPDlayer *gpl= ale->data;
+ bGPDframe *gpf;
+
+ /* find gp-frame which is less than or equal to cframe */
+ for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
+ *min= MIN2(*min, gpf->framenum);
+ *max= MAX2(*max, gpf->framenum);
+ }
+ }
+ else {
+ FCurve *fcu= (FCurve *)ale->key_data;
+ float tmin, tmax;
+
+ /* get range and apply necessary scaling before processing */
+ calc_fcurve_range(fcu, &tmin, &tmax, onlySel);
+
+ if (adt) {
+ tmin= BKE_nla_tweakedit_remap(adt, tmin, NLATIME_CONVERT_MAP);
+ tmax= BKE_nla_tweakedit_remap(adt, tmax, NLATIME_CONVERT_MAP);
+ }
+
+ /* try to set cur using these values, if they're more extreme than previously set values */
+ *min= MIN2(*min, tmin);
+ *max= MAX2(*max, tmax);
}
-
- /* try to set cur using these values, if they're more extreme than previously set values */
- *min= MIN2(*min, tmin);
- *max= MAX2(*max, tmax);
}
/* free memory */