diff options
author | Joshua Leung <aligorith@gmail.com> | 2006-12-27 08:00:43 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2006-12-27 08:00:43 +0300 |
commit | ed2f161c72722b90a1c4e15f998ca678b79e94b0 (patch) | |
tree | 4007a5724d95b1b012e288db92e9f520715f721e /source/blender/blenloader | |
parent | 76b6a6611c930655d88962b9f3134018e9d8117c (diff) |
== Copy Rotation Constraint - Bugfix #5519 ==
Now, when only one axis toggle is on and click on it, all of the other
toggles will not be turned on.
For this to work, I've moved the version patches in the drawing/evaluation
code for this constraint to the file-reading code.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 68 |
1 files changed, 46 insertions, 22 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 8b15623e8cd..30b319794df 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6166,13 +6166,25 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if (list){ bConstraint *curcon; for (curcon = list->first; curcon; curcon=curcon->next){ - if (curcon->type == CONSTRAINT_TYPE_MINMAX){ - bMinMaxConstraint *data = curcon->data; - if (data->sticky==1) { - data->flag|=MINMAX_STICKY; - } else { - data->flag&=~MINMAX_STICKY; + switch (curcon->type) { + case CONSTRAINT_TYPE_MINMAX: + { + bMinMaxConstraint *data = curcon->data; + if (data->sticky==1) + data->flag |= MINMAX_STICKY; + else + data->flag &= ~MINMAX_STICKY; } + break; + case CONSTRAINT_TYPE_ROTLIKE: + { + bRotateLikeConstraint *data = curcon->data; + + /* version patch from buttons_object.c */ + if(data->flag==0) + data->flag = ROTLIKE_X|ROTLIKE_Y|ROTLIKE_Z; + } + break; } } } @@ -6181,24 +6193,36 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if (ob->pose){ bConstraint *curcon; bPoseChannel *pchan; - for (pchan = ob->pose->chanbase.first; - pchan; pchan=pchan->next){ - for (curcon = pchan->constraints.first; - curcon; curcon=curcon->next){ - if (curcon->type == CONSTRAINT_TYPE_MINMAX){ - bMinMaxConstraint *data = curcon->data; - if (data->sticky==1) { - data->flag|=MINMAX_STICKY; - } else { - data->flag&=~MINMAX_STICKY; + for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next){ + for (curcon = pchan->constraints.first; curcon; curcon=curcon->next){ + switch (curcon->type) { + case CONSTRAINT_TYPE_MINMAX: + { + bMinMaxConstraint *data = curcon->data; + if (data->sticky==1) + data->flag |= MINMAX_STICKY; + else + data->flag &= ~MINMAX_STICKY; } - } - else if (curcon->type == CONSTRAINT_TYPE_KINEMATIC){ - bKinematicConstraint *data = curcon->data; - if (!(data->flag & CONSTRAINT_IK_POS)) { - data->flag |= CONSTRAINT_IK_POS; - data->flag |= CONSTRAINT_IK_STRETCH; + break; + case CONSTRAINT_TYPE_KINEMATIC: + { + bKinematicConstraint *data = curcon->data; + if (!(data->flag & CONSTRAINT_IK_POS)) { + data->flag |= CONSTRAINT_IK_POS; + data->flag |= CONSTRAINT_IK_STRETCH; + } + } + break; + case CONSTRAINT_TYPE_ROTLIKE: + { + bRotateLikeConstraint *data = curcon->data; + + /* version patch from buttons_object.c */ + if(data->flag==0) + data->flag = ROTLIKE_X|ROTLIKE_Y|ROTLIKE_Z; } + break; } } } |