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:
@@ -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! */
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user