This commit adds backwards compatability for the new floor constraint

feature. Old files that had "sticky" set would not show "sticky" under
the new system. Not that anyone ever actually used "sticky".

Also, these commits only add support for rotated external target objects,
not target bones inside the same armature.
This commit is contained in:
Roland Hess
2006-09-22 16:42:39 +00:00
parent 4725ca6c02
commit 3c8fe64910
2 changed files with 49 additions and 0 deletions

View File

@@ -5587,11 +5587,59 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
if(main->versionfile <= 242) {
Scene *sce;
Object *ob;
for(sce= main->scene.first; sce; sce= sce->id.next) {
if (sce->toolsettings->select_thresh == 0.0f)
sce->toolsettings->select_thresh= 0.01f;
}
ob = main->object.first;
while (ob) {
ListBase *list;
list = &ob->constraints;
/* check for already existing MinMax (floor) constraint
and update the sticky flagging */
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;
}
}
}
}
if (ob->type == OB_ARMATURE) {
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;
}
}
}
}
}
}
ob = ob->id.next;
}
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */

View File

@@ -100,6 +100,7 @@ typedef struct bMinMaxConstraint{
int minmaxflag;
float offset;
int flag;
short sticky, stuck, pad1, pad2; /* for backward compatability */
float cache[3];
char subtarget[32];
} bMinMaxConstraint;