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>2011-01-14 02:53:14 +0300
committerJoshua Leung <aligorith@gmail.com>2011-01-14 02:53:14 +0300
commit619c2878518e99535e65b374e0335287d8af7dfb (patch)
treeb7f39c1f2bb03e63057869eb1a90e5a5d254a4f6 /source/blender/editors/transform/transform_conversions.c
parent7c7b31cf84c7987370c80aee26fcab2ccac8dda7 (diff)
Reverting r33930 and r34202, which were related to bugs #21825 and
#25554. As found by Daniel Lara (Pepeland) in #25554, the original problems in #21825 all stemmed from the ChildOf constraint there having an incorrect inverse set, which was altering the final results. Now Auto-IK works nicely for old rigs again (i.e. FK arms on BBB rigs)
Diffstat (limited to 'source/blender/editors/transform/transform_conversions.c')
-rw-r--r--source/blender/editors/transform/transform_conversions.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 8725e0ba5b9..196b6af84fe 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -711,9 +711,8 @@ int count_set_pose_transflags(int *out_mode, short around, Object *ob)
for(pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
bone = pchan->bone;
if(bone->flag & BONE_TRANSFORM) {
-
total++;
-
+
if(mode == TFM_TRANSLATION) {
if( has_targetless_ik(pchan)==NULL ) {
if(pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) {
@@ -754,7 +753,7 @@ static void pchan_autoik_adjust (bPoseChannel *pchan, short chainlen)
for (con= pchan->constraints.first; con; con= con->next) {
if (con->type == CONSTRAINT_TYPE_KINEMATIC && (con->enforce!=0.0)) {
bKinematicConstraint *data= con->data;
-
+
/* only accept if a temporary one (for auto-ik) */
if (data->flag & CONSTRAINT_IK_TEMP) {
/* chainlen is new chainlen, but is limited by maximum chainlen */
@@ -803,8 +802,9 @@ static void pose_grab_with_ik_clear(Object *ob)
for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
/* clear all temporary lock flags */
pchan->ikflag &= ~(BONE_IK_NO_XDOF_TEMP|BONE_IK_NO_YDOF_TEMP|BONE_IK_NO_ZDOF_TEMP);
-
+
pchan->constflag &= ~(PCHAN_HAS_IK|PCHAN_HAS_TARGET);
+
/* remove all temporary IK-constraints added */
for (con= pchan->constraints.first; con; con= next) {
next= con->next;
@@ -879,19 +879,6 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan)
pchan = pchan->parent;
else
pchan = NULL;
-
- /* but, constrainted bones can't get auto-ik transform applied, exclude these */
- if(pchan && pchan->constraints.first) {
- /* if constraint is disabled or has no influence, OK then we allow :) */
- for (con= pchan->constraints.first; con; con= con->next) {
- if ((con->enforce==0.0f) || (con->flag & (CONSTRAINT_DISABLE|CONSTRAINT_OFF)));
- else break;
- }
- if(con) {
- data->rootbone--;
- pchan= NULL;
- }
- }
}
/* make a copy of maximum chain-length */
@@ -3585,13 +3572,13 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
/* ------------------------ */
-/* struct for use in re-sorting BezTriples during IPO transform */
+/* struct for use in re-sorting BezTriples during Graph Editor transform */
typedef struct BeztMap {
BezTriple *bezt;
- int oldIndex; /* index of bezt in icu->bezt array before sorting */
- int newIndex; /* index of bezt in icu->bezt array after sorting */
- short swapHs; /* swap order of handles (-1=clear; 0=not checked, 1=swap) */
- char pipo, cipo; /* interpolation of current and next segments */
+ unsigned int oldIndex; /* index of bezt in fcu->bezt array before sorting */
+ unsigned int newIndex; /* index of bezt in fcu->bezt array after sorting */
+ short swapHs; /* swap order of handles (-1=clear; 0=not checked, 1=swap) */
+ char pipo, cipo; /* interpolation of current and next segments */
} BeztMap;
@@ -3722,11 +3709,11 @@ static void beztmap_to_data (TransInfo *t, FCurve *fcu, BeztMap *bezms, int totv
if (bezm->bezt->f2 & SELECT) {
if (td->loc2d == bezm->bezt->vec[1]) {
td->loc2d= (bezts + bezm->newIndex)->vec[1];
-
+
/* if only control point is selected, the handle pointers need to be updated as well */
td->h1= (bezts + bezm->newIndex)->vec[0];
td->h2= (bezts + bezm->newIndex)->vec[2];
-
+
adjusted[j] = 1;
}
}
@@ -3809,7 +3796,7 @@ void flushTransGraphData(TransInfo *t)
break;
}
}
-
+
/* we need to unapply the nla-mapping from the time in some situations */
if (adt)
td2d->loc2d[0]= BKE_nla_tweakedit_remap(adt, td2d->loc[0], NLATIME_CONVERT_UNMAP);
@@ -3821,12 +3808,12 @@ void flushTransGraphData(TransInfo *t)
td2d->loc2d[1]= (float)((int)td2d->loc[1]);
else
td2d->loc2d[1]= td2d->loc[1];
-
+
if ((td->flag & TD_MOVEHANDLE1) && td2d->h1) {
td2d->h1[0] = td2d->ih1[0] + td->loc[0] - td->iloc[0];
td2d->h1[1] = td2d->ih1[1] + td->loc[1] - td->iloc[1];
}
-
+
if ((td->flag & TD_MOVEHANDLE2) && td2d->h2) {
td2d->h2[0] = td2d->ih2[0] + td->loc[0] - td->iloc[0];
td2d->h2[1] = td2d->ih2[1] + td->loc[1] - td->iloc[1];