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-26 14:17:26 +0300
committerJoshua Leung <aligorith@gmail.com>2007-12-26 14:17:26 +0300
commit10b8237eab7e41ef7563cedbf6a2e4e5dda13456 (patch)
tree38e69047fcea8ce20b4a2c97a9cabc318b8c2f5b /source/blender/blenloader/intern
parentf81bc543e7f274aa88ca0d0c00dc86b4d6381416 (diff)
== PoseLib - Pose-Library Tool for Blender ==
"A slightly late Christmas present for the Animators out there :-)" This tool allows animators to store frequently used poses in an action, and be able to label those poses to help them retrieve them later. In a way, it acts as a glorified clipboard for poses. One of the cool features with this is the ability to select which stored pose to use interactively in the 3d-view. Once a few poses have been stored in the PoseLib, simply use the "Ctrl L" hotkey to start previewing. Use the Mousewheel or the Page Up/Down keys to change poses, and confirm/cancel the preview in the same way as you do for transforms. Usage Notes: * Each Armature may get its own PoseLib. PoseLibs are simply actions with extra data, so they can get relinked. * Manually editing actions used as PoseLibs is not a good idea, as some data may not be able to be found. Tools to automagically find poses in an action could be investigated... * PoseLib will only apply/retrieve poses to/from selected bones * A basic UI for this can be found in the "Links and Materials" panel. Most of the PoseLib tools are presented there. Useful Hotkeys (also found in Pose->PoseLib menu): * Ctrl L - interactively preview poses * Shift L - add a new pose or replace an existing pose in the PoseLib with the current pose * Ctrl Shift L - rename an existing pose in the PoseLib * Alt L - remove a pose from the poselib.c
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r--source/blender/blenloader/intern/readfile.c15
-rw-r--r--source/blender/blenloader/intern/writefile.c12
2 files changed, 22 insertions, 5 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d30f0da95d6..f8f0395300c 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1785,6 +1785,9 @@ 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;
@@ -1814,12 +1817,12 @@ static void lib_link_action(FileData *fd, Main *main)
while(act) {
if(act->id.flag & LIB_NEEDLINK) {
act->id.flag -= LIB_NEEDLINK;
-
+
for (chan=act->chanbase.first; chan; chan=chan->next) {
chan->ipo= newlibadr_us(fd, act->id.lib, chan->ipo);
lib_link_constraint_channels(fd, &act->id, &chan->constraintChannels);
}
-
+
}
act= act->id.next;
}
@@ -1847,7 +1850,10 @@ static void direct_link_action(FileData *fd, bAction *act)
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)
@@ -2942,7 +2948,6 @@ static void direct_link_pose(FileData *fd, bPose *pose) {
pchan->iktree.first= pchan->iktree.last= NULL;
pchan->path= NULL;
}
-
}
static void direct_link_modifiers(FileData *fd, ListBase *lb)
@@ -7799,6 +7804,8 @@ 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)
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 2e14fe55383..90f48868911 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1743,11 +1743,21 @@ static void write_actions(WriteData *wd, ListBase *idbase)
if (act->id.us>0 || wd->current) {
writestruct(wd, ID_AC, "bAction", 1, act);
if (act->id.properties) IDP_WriteProperty(act->id.properties, wd);
-
+
for (chan=act->chanbase.first; chan; chan=chan->next) {
writestruct(wd, DATA, "bActionChannel", 1, chan);
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);
+ }
}
}
}