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.
This commit is contained in:
Joshua Leung 2008-10-21 08:00:19 +00:00
parent 3ac142e654
commit 8977ccafbb
3 changed files with 23 additions and 10 deletions

@ -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)

@ -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;
}
}
}

@ -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;