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:
authorTon Roosendaal <ton@blender.org>2005-10-30 16:50:42 +0300
committerTon Roosendaal <ton@blender.org>2005-10-30 16:50:42 +0300
commitea8b08c2cc13c035eb13b72d6443f972e81bd66e (patch)
treea88d69f4893c35ae7b3d35218505e445d82d1f9b /source/blender/src/drawarmature.c
parentb7a465b437fd7d51e30c46290abef60c907821c7 (diff)
Two new IK features.
1) Target-less IK If you add an IK constraint without a target set (no object or bone target), it now can be grabbed and moved with IK, using its own Bone tip or root as target itself. This way you can use IK for posing, without having the IK executed while it animates or while a Pose is being solved for real IK. After grabbing "Target-less IK", it applies the resulted motion in the pose-channels, which then can be used to insert keypositions. The Target-less IK bone can still be rotated without IK, also its chain can be edited as usual. UI: The CTRL+I menu gives this as an option too. In the 3D window it is drawn with orangish color. Note that IK is not resistant to non-uniform scaling yet. 2) Auto-IK When the option "Automatic IK" is set, in Edit Buttons Armature Panel, it creates automatic temporal Target-less IK for the Bone you grab or translate. The rules are: - it only works when a single Bone is selected - if the Bone is a root bone (no parent), it adds IK to the end of the chain(s) - otherwise it adds the IK to the active Bone - the temporal IK chain only consists of connected Bones. This method is still a bit experimental. Maybe it should become a special grabbing option (like SHIFT+G in Pose Mode). It also only works OK for rigs that fit for it well... when a rig already is fully setup with IK it can't do much good. :)
Diffstat (limited to 'source/blender/src/drawarmature.c')
-rw-r--r--source/blender/src/drawarmature.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/src/drawarmature.c b/source/blender/src/drawarmature.c
index e35e45ab626..471eb1e0612 100644
--- a/source/blender/src/drawarmature.c
+++ b/source/blender/src/drawarmature.c
@@ -829,7 +829,8 @@ static void draw_line_bone(int armflag, int boneflag, int constflag, unsigned in
if(armflag & ARM_POSEMODE) {
/* inner part in background color or constraint */
if(constflag) {
- if(constflag & PCHAN_HAS_IK) glColor3ub(255, 255, 0);
+ if(constflag & PCHAN_HAS_TARGET) glColor3ub(255, 150, 0);
+ else if(constflag & PCHAN_HAS_IK) glColor3ub(255, 255, 0);
else if(constflag & PCHAN_HAS_CONST) glColor3ub(0, 255, 120);
else BIF_ThemeColor(TH_BONE_POSE); // PCHAN_HAS_ACTION
}
@@ -969,7 +970,8 @@ static void draw_b_bone(int dt, int armflag, int boneflag, int constflag, unsign
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
- if(constflag & PCHAN_HAS_IK) glColor4ub(255, 255, 0, 80);
+ if(constflag & PCHAN_HAS_TARGET) glColor4ub(255, 150, 0, 80);
+ else if(constflag & PCHAN_HAS_IK) glColor4ub(255, 255, 0, 80);
else if(constflag & PCHAN_HAS_CONST) glColor4ub(0, 255, 120, 80);
else BIF_ThemeColor4(TH_BONE_POSE); // PCHAN_HAS_ACTION
@@ -1036,7 +1038,8 @@ static void draw_bone(int dt, int armflag, int boneflag, int constflag, unsigned
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
- if(constflag & PCHAN_HAS_IK) glColor4ub(255, 255, 0, 80);
+ if(constflag & PCHAN_HAS_TARGET) glColor4ub(255, 150, 0, 80);
+ else if(constflag & PCHAN_HAS_IK) glColor4ub(255, 255, 0, 80);
else if(constflag & PCHAN_HAS_CONST) glColor4ub(0, 255, 120, 80);
else BIF_ThemeColor4(TH_BONE_POSE); // PCHAN_HAS_ACTION
@@ -1397,8 +1400,11 @@ static void draw_pose_channels(Base *base, int dt)
if(arm->flag & ARM_POSEMODE) {
if(pchan->constflag & PCHAN_HAS_IK) {
if(bone->flag & BONE_SELECTED) {
+
+ if(pchan->constflag & PCHAN_HAS_TARGET) glColor3ub(200, 120, 0);
+ else glColor3ub(200, 200, 50); // add theme!
+
glLoadName (index & 0xFFFF);
- glColor3ub(200, 200, 50); // add theme!
pchan_draw_IK_root_lines(pchan);
}
}