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:
authorJoshua Leung <aligorith@gmail.com>2007-12-30 15:08:28 +0300
committerJoshua Leung <aligorith@gmail.com>2007-12-30 15:08:28 +0300
commit5be2e5aa9821a1da9cf16d7dd848a17487f68685 (patch)
treee8e605e003d4f440ffb354bf8bdf29ca423035c9 /source/blender/blenloader/intern
parent96935a6c5d35974e08604a9c338b8dcd06a7b9f8 (diff)
== PoseLib - Overhauled Implementation ==
Based on feedback from Ton, I've recoded the way "PoseLibs" are implemented/exposed. Therefore, quite a bit of code has been changed to fit this in better. Now, ANY ACTION can be a "PoseLib". A set of Markers which belong to the Action (it's taken a year, but they're finally back), are used to tag "poses" in the Action. These markers are shown using diamond-shaped blue icons (designed by Matt Ebb) in three shades - unselected/normal, selected, active. Notes: * Each Armature Object has an Action which acts as a PoseLib. * Improved UI presented in buttons panel for this -- added proper buttons for action assigning -- renamed "Validate PoseLib" to "Auto-Sync PoseLib" (this option auto-tags poses based on keyframes found) Like in the 3d-view, use the hotkeys: * Shift-L to add a local marker * Ctrl-Shift-L to rename a local marker * Alt-L to delete selected local markers Note: transforms, etc. are not currently available with these markers == PoseLib Preview == Added a few features here: * Left/Right-Arrow keys now change the poses too (previous and next respectively) * Up/Down-Arrow keys also change the poses, but "jump" to a pose 5 steps away in their respective directions
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r--source/blender/blenloader/intern/readfile.c12
-rw-r--r--source/blender/blenloader/intern/writefile.c11
2 files changed, 6 insertions, 17 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index a886c0d195b..6381aec7872 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1802,9 +1802,6 @@ static void lib_link_pose(FileData *fd, Object *ob, bPose *pose)
}
}
- // ob->id.lib???
- pose->poselib = newlibadr_us(fd, ob->id.lib, pose->poselib);
-
if(rebuild) {
ob->recalc= OB_RECALC;
pose->flag |= POSE_RECALC;
@@ -1864,13 +1861,10 @@ static void direct_link_action(FileData *fd, bAction *act)
bActionChannel *achan;
link_list(fd, &act->chanbase);
+ link_list(fd, &act->markers);
for (achan = act->chanbase.first; achan; achan=achan->next)
link_list(fd, &achan->constraintChannels);
-
- act->poselib= newdataadr(fd, act->poselib);
- if (act->poselib)
- link_list(fd, &act->poselib->poses);
}
static void direct_link_armature(FileData *fd, bArmature *arm)
@@ -2790,6 +2784,7 @@ static void lib_link_object(FileData *fd, Main *main)
ob->track= newlibadr(fd, ob->id.lib, ob->track);
ob->ipo= newlibadr_us(fd, ob->id.lib, ob->ipo);
ob->action = newlibadr_us(fd, ob->id.lib, ob->action);
+ ob->poselib= newlibadr_us(fd, ob->id.lib, ob->poselib);
ob->dup_group= newlibadr_us(fd, ob->id.lib, ob->dup_group);
ob->proxy= newlibadr_us(fd, ob->id.lib, ob->proxy);
@@ -7821,8 +7816,6 @@ static void expand_pose(FileData *fd, Main *mainvar, bPose *pose)
expand_constraints(fd, mainvar, &chan->constraints);
expand_doit(fd, mainvar, chan->custom);
}
-
- expand_doit(fd, mainvar, pose->poselib);
}
static void expand_armature(FileData *fd, Main *mainvar, bArmature *arm)
@@ -7900,6 +7893,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
expand_doit(fd, mainvar, ob->data);
expand_doit(fd, mainvar, ob->ipo);
expand_doit(fd, mainvar, ob->action);
+ expand_doit(fd, mainvar, ob->poselib);
for (md=ob->modifiers.first; md; md=md->next) {
expand_modifier(fd, mainvar, md);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index f1fe64eb820..87462ad78f6 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1738,6 +1738,7 @@ static void write_actions(WriteData *wd, ListBase *idbase)
{
bAction *act;
bActionChannel *chan;
+ TimeMarker *marker;
for(act=idbase->first; act; act= act->id.next) {
if (act->id.us>0 || wd->current) {
@@ -1749,14 +1750,8 @@ static void write_actions(WriteData *wd, ListBase *idbase)
write_constraint_channels(wd, &chan->constraintChannels);
}
- if (act->poselib) {
- bPoseLib *pl= act->poselib;
- bPoseLibRef *plr;
-
- writestruct(wd, DATA, "bPoseLib", 1, pl);
-
- for (plr= pl->poses.first; plr; plr= plr->next)
- writestruct(wd, DATA, "bPoseLibRef", 1, plr);
+ for (marker=act->markers.first; marker; marker=marker->next) {
+ writestruct(wd, DATA, "TimeMarker", 1, marker);
}
}
}