diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-10-21 12:00:19 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-10-21 12:00:19 +0400 |
commit | 8977ccafbb750dd5ad26c01ec98169d2a31f5f16 (patch) | |
tree | 4e73deee1d77c6f34bbf13a69a3e4d62738aa541 /source/blender/src | |
parent | 3ac142e65459a0c016397cce53debfca9137c475 (diff) |
Bugfixes:
- Adding constraint using button in panel still didn't update Armature Editing buttons properly.
- Minor code tidying of earlier bugfix for armatures
- 'For Transform' option for Limit constraints is now only taken into account for constraints that are enabled.
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/buttons_object.c | 5 | ||||
-rw-r--r-- | source/blender/src/editarmature.c | 14 | ||||
-rw-r--r-- | source/blender/src/transform.c | 14 |
3 files changed, 23 insertions, 10 deletions
diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index 841a55d7ae1..a8ce9da8780 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -2056,8 +2056,9 @@ void do_constraintbuts(unsigned short event) if(ob->type==OB_ARMATURE) DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA|OB_RECALC_OB); else DAG_object_flush_update(G.scene, ob, OB_RECALC_OB); - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWBUTSOBJECT, 0); + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWBUTSOBJECT, 0); + allqueue(REDRAWBUTSEDIT, 0); } void pointcache_bake(PTCacheID *pid, int startframe) diff --git a/source/blender/src/editarmature.c b/source/blender/src/editarmature.c index 61ca5c09877..18f4bc3f8dd 100644 --- a/source/blender/src/editarmature.c +++ b/source/blender/src/editarmature.c @@ -3277,8 +3277,11 @@ void switch_direction_armature (void) EditBone *ebo, *child=NULL, *parent=NULL; /* loop over bones in chain */ - for (ebo= chain->data; ebo;) { - /* parent is this bone's original parent (to go to next if we swap) */ + for (ebo= chain->data; ebo; ebo= parent) { + /* parent is this bone's original parent + * - we store this, as the next bone that is checked is this one + * but the value of ebo->parent may change here... + */ parent= ebo->parent; /* only if selected and editable */ @@ -3300,10 +3303,8 @@ void switch_direction_armature (void) /* get next bones * - child will become the new parent of next bone - * - next bone to go to will be the original parent */ child= ebo; - ebo= parent; } else { /* not swapping this bone, however, if its 'parent' got swapped, unparent us from it @@ -3315,11 +3316,10 @@ void switch_direction_armature (void) } /* get next bones - * - child will become new parent of next bone (not swapping occurred, so set to NULL to prevent infinite-loop) - * - next bone to go to will be the original parent (no change) + * - child will become new parent of next bone (not swapping occurred, + * so set to NULL to prevent infinite-loop) */ child= NULL; - ebo= parent; } } } diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index e21d543d34e..b9b8a4a21a9 100644 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -1502,6 +1502,10 @@ static void constraintTransLim(TransInfo *t, TransData *td) for (con= td->con; con; con= con->next) { float tmat[4][4]; + /* only consider constraint if enabled */ + if (con->flag & CONSTRAINT_DISABLE) continue; + if (con->enforce == 0.0f) continue; + /* only use it if it's tagged for this purpose (and the right type) */ if (con->type == CONSTRAINT_TYPE_LOCLIMIT) { bLocLimitConstraint *data= con->data; @@ -1585,7 +1589,11 @@ static void constraintRotLim(TransInfo *t, TransData *td) /* Evaluate valid constraints */ for (con= td->con; con; con= con->next) { - /* we're only interested in Limit-Scale constraints */ + /* only consider constraint if enabled */ + if (con->flag & CONSTRAINT_DISABLE) continue; + if (con->enforce == 0.0f) continue; + + /* we're only interested in Limit-Rotation constraints */ if (con->type == CONSTRAINT_TYPE_ROTLIMIT) { bRotLimitConstraint *data= con->data; float tmat[4][4]; @@ -1675,6 +1683,10 @@ static void constraintSizeLim(TransInfo *t, TransData *td) /* Evaluate valid constraints */ for (con= td->con; con; con= con->next) { + /* only consider constraint if enabled */ + if (con->flag & CONSTRAINT_DISABLE) continue; + if (con->enforce == 0.0f) continue; + /* we're only interested in Limit-Scale constraints */ if (con->type == CONSTRAINT_TYPE_SIZELIMIT) { bSizeLimitConstraint *data= con->data; |