From 44c31bb04523799bf918bb4e519c0ebad4c0b9b1 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 17 Jan 2008 23:02:11 +0000 Subject: == Action Editor - Groups for Action Channels (Peach Request) == Now, you can assign Action Channels to named (folder-like) groups, which help to organise the channels (important for more complex rigs). These are collapsible, can be "protected", and show a "summary" of the keyframes in the channels the Group contains. They are drawn as bright-green (active) or a darker shade of green (not active) channels. * Each Action has its own set of Groups. * An Action-Channel can only occur in one Group at a time. It can also not occur in any group. * Action-Channels can be moved between Groups * Groups + grouped-channels always occur BEFORE un-grouped channels Important Hotkeys: * Shift-G : Adds the selected Action-Channels to the Active Group. This will create a new group if need be * Ctrl-Shift-G : Always adds a new group, and adds the selected Action-Channels to it * Alt-G : Removes selected Action-Channels from their groups * Ctrl-Shift-Alt-G : (Note: this will be removed soon) This is a simple debugging-hotkey I added, which just prints a list of the groups, channels, and their addresses... * NKey / Ctrl-LMB: While hovering over the name of a group, this shows a popup like for other channels, which allows the editing of the channel's name, etc. Assorted Notes: * Some tools may not work yet with this (Ctrl Numpad+/- for example) * Fixed some bugs in various places in Action Editor code * Added theme colours for group channels * The nomenclature of these tools may change in future when a better alternative is found * The ability to auto-assign action-channels to groups when they are keyframed will be coming up shortly --- source/blender/blenloader/intern/readfile.c | 14 +++++++++++++- source/blender/blenloader/intern/writefile.c | 5 +++++ 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5712f8f03fc..4a21d1fc6fa 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1859,12 +1859,24 @@ static void direct_link_bones(FileData *fd, Bone* bone) static void direct_link_action(FileData *fd, bAction *act) { bActionChannel *achan; + bActionGroup *agrp; link_list(fd, &act->chanbase); + link_list(fd, &act->groups); link_list(fd, &act->markers); - for (achan = act->chanbase.first; achan; achan=achan->next) + for (achan = act->chanbase.first; achan; achan=achan->next) { + achan->grp= newdataadr(fd, achan->grp); + link_list(fd, &achan->constraintChannels); + } + + for (agrp = act->groups.first; agrp; agrp= agrp->next) { + if (agrp->channels.first) { + agrp->channels.first= newdataadr(fd, agrp->channels.first); + agrp->channels.last= newdataadr(fd, agrp->channels.last); + } + } } static void direct_link_armature(FileData *fd, bArmature *arm) diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index fdea98c7ab2..b5c48716036 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1750,6 +1750,7 @@ static void write_actions(WriteData *wd, ListBase *idbase) { bAction *act; bActionChannel *chan; + bActionGroup *grp; TimeMarker *marker; for(act=idbase->first; act; act= act->id.next) { @@ -1762,6 +1763,10 @@ static void write_actions(WriteData *wd, ListBase *idbase) write_constraint_channels(wd, &chan->constraintChannels); } + for (grp=act->groups.first; grp; grp=grp->next) { + writestruct(wd, DATA, "bActionGroup", 1, grp); + } + for (marker=act->markers.first; marker; marker=marker->next) { writestruct(wd, DATA, "TimeMarker", 1, marker); } -- cgit v1.2.3