diff options
author | Joshua Leung <aligorith@gmail.com> | 2007-10-24 14:03:19 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2007-10-24 14:03:19 +0400 |
commit | 2339eacce874d2dd922c5163d7a3898b6d2f325f (patch) | |
tree | 0a052fa6fac39839be789c3a80885f48a6c0c345 /source/blender/blenloader | |
parent | f25629932ae7d42fa007091b18ece260d0366844 (diff) |
PyConstraints Bugfixes (again!):
Files saved with PyConstraints with multiple targets crashed on load, as the targets didn't actually get saved.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 1 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index fc5214572f4..e1d538a54da 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1744,6 +1744,7 @@ static void direct_link_constraints(FileData *fd, ListBase *lb) cons->data = newdataadr(fd, cons->data); if (cons->type == CONSTRAINT_TYPE_PYTHON) { bPythonConstraint *data= cons->data; + link_list(fd, &data->targets); data->prop = newdataadr(fd, data->prop); IDP_DirectLinkProperty(data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd); } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index a059bf2a2c5..45621c5fcd0 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -709,7 +709,12 @@ static void write_constraints(WriteData *wd, ListBase *conlist) switch (con->type) { case CONSTRAINT_TYPE_PYTHON: { - bPythonConstraint *data = (bPythonConstraint*) con->data; + bPythonConstraint *data = (bPythonConstraint *)con->data; + bConstraintTarget *ct; + + /* write targets */ + for (ct= data->targets.first; ct; ct= ct->next) + writestruct(wd, DATA, "bConstraintTarget", 1, ct); /* Write ID Properties -- and copy this comment EXACTLY for easy finding of library blocks that implement this.*/ |