diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-06-27 16:59:01 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-06-27 16:59:01 +0300 |
commit | cbce7fef1604fdfd3099fd196b2a44f61b22eb76 (patch) | |
tree | b11963a42641ef95c61c01a7b2b83dddce4cd1a2 /source/blender/editors/gpencil/editaction_gpencil.c | |
parent | c2dc77983dc4d3271858737a15ee058ef48fb833 (diff) | |
parent | e2c7ee773311734450a229051673fbfea61b641a (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/blenkernel/intern/pointcache.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_particle.c
Diffstat (limited to 'source/blender/editors/gpencil/editaction_gpencil.c')
-rw-r--r-- | source/blender/editors/gpencil/editaction_gpencil.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c index a49b3362155..738496a67c6 100644 --- a/source/blender/editors/gpencil/editaction_gpencil.c +++ b/source/blender/editors/gpencil/editaction_gpencil.c @@ -205,6 +205,36 @@ void ED_gplayer_frames_select_border(bGPDlayer *gpl, float min, float max, short } } +/* select the frames in this layer that occur within the lasso/circle region specified */ +void ED_gplayer_frames_select_region(KeyframeEditData *ked, bGPDlayer *gpl, short tool, short select_mode) +{ + bGPDframe *gpf; + + if (gpl == NULL) + return; + + /* only select frames which are within the region */ + for (gpf = gpl->frames.first; gpf; gpf = gpf->next) { + /* construct a dummy point coordinate to do this testing with */ + float pt[2] = {0}; + + pt[0] = gpf->framenum; + pt[1] = ked->channel_y; + + /* check the necessary regions */ + if (tool == BEZT_OK_CHANNEL_LASSO) { + /* Lasso */ + if (keyframe_region_lasso_test(ked->data, pt)) + gpframe_select(gpf, select_mode); + } + else if (tool == BEZT_OK_CHANNEL_CIRCLE) { + /* Circle */ + if (keyframe_region_circle_test(ked->data, pt)) + gpframe_select(gpf, select_mode); + } + } +} + /* ***************************************** */ /* Frame Editing Tools */ |