diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-01-11 01:10:28 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-01-11 01:10:28 +0300 |
commit | cf25b10eb5bb61662ce0db6b3ef54a3e3e73a328 (patch) | |
tree | 0d7ffcdd0735d1788bfb3e679b6f7489605c1aab /source/blender/editors/animation/anim_channels_edit.c | |
parent | d841a206314922eec0a0fed0b87e3078b68487c9 (diff) |
Todo #22395: Restoring Grease Pencil Editing Mode in DopeSheet Editor
This commit restores some basic functionality for retiming Grease
Pencil sketches. Some of the functionality that existed before still
hasn't been restored (namely snap/mirror tools as well as copy+paste),
though it should be possible to use this for basic retiming and
sketch-frame management again.
- There's still a lot of work required to get this up to the standard
of the rest of the animation editor code, as some of this code was
originally just hacked in based on the old-style code.
- Work is already required to not have to directly access the main db
global to get the list of Grease Pencil datablocks to show, but that
can come along with pending cleanups of the filtering code.
Diffstat (limited to 'source/blender/editors/animation/anim_channels_edit.c')
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 319f80404b4..6701729f34f 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -245,6 +245,11 @@ void ANIM_deselect_anim_channels (bAnimContext *ac, void *data, short datatype, sel= ACHANNEL_SETFLAG_CLEAR; } break; + + case ANIMTYPE_GPLAYER: + if (ale->flag & GP_LAYER_SELECT) + sel= ACHANNEL_SETFLAG_CLEAR; + break; } } } @@ -332,6 +337,14 @@ void ANIM_deselect_anim_channels (bAnimContext *ac, void *data, short datatype, } } break; + + case ANIMTYPE_GPLAYER: + { + bGPDlayer *gpl = (bGPDlayer *)ale->data; + + ACHANNEL_SET_FLAG(gpl, sel, GP_LAYER_SELECT); + } + break; } } @@ -1000,10 +1013,10 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op) rearrange_driver_channels(&ac, adt, mode); break; -#if 0 case ANIMCONT_GPENCIL: /* Grease Pencil channels */ + // FIXME: this case probably needs to get moved out of here or treated specially... + printf("grease pencil not supported for moving yet\n"); break; -#endif case ANIMCONT_SHAPEKEY: // DOUBLE CHECK ME... @@ -2047,7 +2060,9 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i { bGPdata *gpd= (bGPdata *)ale->data; - /* toggle expand */ + /* toggle expand + * - although the triangle widget already allows this, the whole channel can also be used for this purpose + */ gpd->flag ^= GP_DATA_EXPAND; notifierFlags |= (ND_ANIMCHAN|NA_EDITED); @@ -2055,29 +2070,20 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i break; case ANIMTYPE_GPLAYER: { -#if 0 // XXX future of this is unclear - bGPdata *gpd= (bGPdata *)ale->owner; // xxx depreceated bGPDlayer *gpl= (bGPDlayer *)ale->data; - if (x >= (ACHANNEL_NAMEWIDTH-16)) { - /* toggle lock */ - gpl->flag ^= GP_LAYER_LOCKED; - } - else if (x >= (ACHANNEL_NAMEWIDTH-32)) { - /* toggle hide */ - gpl->flag ^= GP_LAYER_HIDE; + /* select/deselect */ + if (selectmode == SELECT_INVERT) { + /* invert selection status of this layer only */ + gpl->flag ^= GP_LAYER_SELECT; } - else { - /* select/deselect */ - //if (G.qual & LR_SHIFTKEY) { - //select_gplayer_channel(gpd, gpl, SELECT_INVERT); - //} - //else { - //deselect_gpencil_layers(data, 0); - //select_gplayer_channel(gpd, gpl, SELECT_INVERT); - //} + else { + /* select layer by itself */ + ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR); + gpl->flag |= GP_LAYER_SELECT; } -#endif // XXX future of this is unclear + + notifierFlags |= (ND_ANIMCHAN|NA_EDITED); } break; default: |