Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorRoland Hess <me@harkyman.com>2006-09-22 20:42:39 +0400
committerRoland Hess <me@harkyman.com>2006-09-22 20:42:39 +0400
commit3c8fe649103c944faec6cc0c64787a0aeee71fed (patch)
treea6aeb003861498b57a23729a07402145a9a90d53 /source
parent4725ca6c021d4234ca069ab789e962f97008ccf9 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/readfile.c48
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h1
2 files changed, 49 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 6ece27c2e46..0a149ce5b06 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -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! */
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index dcc4b88680d..8b8f8ae0f72 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -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;