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>2016-05-17 18:19:06 +0300
committerJoshua Leung <aligorith@gmail.com>2016-05-17 18:19:06 +0300
commit49aeee5a3dfa9fc0ae29e99f7c5c0cc0124e560e (patch)
tree49ace019e0509cd188f24d11c8f799ab676f6bbd /source/blender/blenloader
parent29a17d54da1f4b85a59487e032165bb44dc1b065 (diff)
Bendy Bones: Advanced B-Bones for Easier + Simple Rigging
This commit/patch/branch brings a bunch of powerful new options for B-Bones and for working with B-Bones, making it easier for animators to create their own rigs, using fewer bones (which also means hopefully lighter + faster rigs ;) This functionality was first demoed by Daniel at BConf15 Some highlights from this patch include: * You can now directly control the shape of B-Bones using a series of properties instead of being restricted to trying to indirectly control them through the neighbouring bones. See the "Bendy Bones" panel... * B-Bones can be shaped in EditMode to define a "curved rest pose" for the bone. This is useful for things like eyebrows and mouths/eyelids * You can now make B-Bones use custom bones as their reference bone handles, instead of only using the parent/child bones. To do so, enable the "Use Custom Reference Handles" toggle. If none are specified, then the BBone will only use the Bendy Bone properties. * Constraints Head/Tail option can now slide along the B-Bone shape, instead of just linearly interpolating between the endpoints of the bone. For more details, see: * http://aligorith.blogspot.co.nz/2016/05/bendy-bones-dev-update.html * http://aligorith.blogspot.co.nz/2016/05/an-in-depth-look-at-how-b-bones-work.html -- Credits -- Original Idea: Daniel M Lara (pepeland) Original Patch/Research: Jose Molina Additional Development + Polish: Joshua Leung (aligorith) Testing/Feedback: Daniel M Lara (pepeland), Juan Pablo Bouza (jpbouza)
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c3
-rw-r--r--source/blender/blenloader/intern/versioning_270.c39
2 files changed, 42 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 678fd84de94..d6e2f237be9 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4926,6 +4926,9 @@ static void direct_link_pose(FileData *fd, bPose *pose)
pchan->child = newdataadr(fd, pchan->child);
pchan->custom_tx = newdataadr(fd, pchan->custom_tx);
+ pchan->bbone_prev = newdataadr(fd, pchan->bbone_prev);
+ pchan->bbone_next = newdataadr(fd, pchan->bbone_next);
+
direct_link_constraints(fd, &pchan->constraints);
pchan->prop = newdataadr(fd, pchan->prop);
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index efd167d49d5..58542d05879 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -34,6 +34,7 @@
/* allow readfile to use deprecated functionality */
#define DNA_DEPRECATED_ALLOW
+#include "DNA_armature_types.h"
#include "DNA_brush_types.h"
#include "DNA_camera_types.h"
#include "DNA_cloth_types.h"
@@ -161,6 +162,16 @@ static void do_version_action_editor_properties_region(ListBase *regionbase)
}
}
+static void do_version_bones_super_bbone(ListBase *lb)
+{
+ for (Bone *bone = lb->first; bone; bone = bone->next) {
+ bone->scaleIn = 1.0f;
+ bone->scaleOut = 1.0f;
+
+ do_version_bones_super_bbone(&bone->childbase);
+ }
+}
+
void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
{
if (!MAIN_VERSION_ATLEAST(main, 270, 0)) {
@@ -1151,4 +1162,32 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
}
+
+ if (!MAIN_VERSION_ATLEAST(main, 277, 2)) {
+ if (!DNA_struct_elem_find(fd->filesdna, "Bone", "float", "scaleIn")) {
+ for (bArmature *arm = main->armature.first; arm; arm = arm->id.next) {
+ do_version_bones_super_bbone(&arm->bonebase);
+ }
+ }
+ if (!DNA_struct_elem_find(fd->filesdna, "bPoseChannel", "float", "scaleIn")) {
+ for (Object *ob = main->object.first; ob; ob = ob->id.next) {
+ if (ob->pose) {
+ for (bPoseChannel *pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ /* see do_version_bones_super_bbone()... */
+ pchan->scaleIn = 1.0f;
+ pchan->scaleOut = 1.0f;
+
+ /* also make sure some legacy (unused for over a decade) flags are unset,
+ * so that we can reuse them for stuff that matters now...
+ * (i.e. POSE_IK_MAT, (unknown/unused x 4), POSE_HAS_IK)
+ *
+ * These seem to have been runtime flags used by the IK solver, but that stuff
+ * should be able to be recalculated automatically anyway, so it should be fine.
+ */
+ pchan->flag &= ~((1 << 3) | (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7) | (1 << 8));
+ }
+ }
+ }
+ }
+ }
}