diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2007-11-16 17:41:07 +0300 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2007-11-16 17:41:07 +0300 |
commit | 04e304682439c04ddc9eedb6e8429a1c65250e6d (patch) | |
tree | 9ff619d1c264633ec9ad32d276adde59a27e8598 /source/blender/blenloader/intern | |
parent | 057060967e07b052c70010b4c6d7d38dd03f6925 (diff) | |
parent | fd3764f9a4cf197d220f5ec993178f2a4ff29326 (diff) |
svn merge -r 12496:12607 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 49 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 8 |
2 files changed, 44 insertions, 13 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index afe342d8665..5861ba39da2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2917,14 +2917,22 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) mmd->bindweights= newdataadr(fd, mmd->bindweights); mmd->bindcos= newdataadr(fd, mmd->bindcos); + mmd->dyngrid= newdataadr(fd, mmd->dyngrid); + mmd->dyninfluences= newdataadr(fd, mmd->dyninfluences); + mmd->dynverts= newdataadr(fd, mmd->dynverts); if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) { int a; - for(a=0; a<mmd->totcagevert*mmd->totvert; a++) - SWITCH_INT(mmd->bindweights[a]) - for(a=0; a<mmd->totcagevert*3; a++) - SWITCH_INT(mmd->bindcos[a]) + if(mmd->bindweights) + for(a=0; a<mmd->totcagevert*mmd->totvert; a++) + SWITCH_INT(mmd->bindweights[a]) + if(mmd->bindcos) + for(a=0; a<mmd->totcagevert*3; a++) + SWITCH_INT(mmd->bindcos[a]) + if(mmd->dynverts) + for(a=0; a<mmd->totvert; a++) + SWITCH_INT(mmd->dynverts[a]) } } } @@ -6844,11 +6852,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main) bConstraint *con; bConstraintTarget *ct; - for(ob = main->object.first; ob; ob= ob->id.next) { - if(ob->pose) { - for(pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) { - for(con=pchan->constraints.first; con; con=con->next) { - if(con->type==CONSTRAINT_TYPE_PYTHON) { + for (ob = main->object.first; ob; ob= ob->id.next) { + if (ob->pose) { + for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) { + for (con=pchan->constraints.first; con; con=con->next) { + if (con->type == CONSTRAINT_TYPE_PYTHON) { bPythonConstraint *data= (bPythonConstraint *)con->data; if (data->tar) { /* version patching needs to be done */ @@ -6866,12 +6874,19 @@ static void do_versions(FileData *fd, Library *lib, Main *main) strcpy(data->subtarget, ""); } } + else if (con->type == CONSTRAINT_TYPE_LOCLIKE) { + bLocateLikeConstraint *data= (bLocateLikeConstraint *)con->data; + + /* new headtail functionality makes Bone-Tip function obsolete */ + if (data->flag & LOCLIKE_TIP) + con->headtail = 1.0f; + } } } } - for(con=ob->constraints.first; con; con=con->next) { - if(con->type==CONSTRAINT_TYPE_PYTHON) { + for (con=ob->constraints.first; con; con=con->next) { + if (con->type==CONSTRAINT_TYPE_PYTHON) { bPythonConstraint *data= (bPythonConstraint *)con->data; if (data->tar) { /* version patching needs to be done */ @@ -6889,6 +6904,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main) strcpy(data->subtarget, ""); } } + else if (con->type == CONSTRAINT_TYPE_LOCLIKE) { + bLocateLikeConstraint *data= (bLocateLikeConstraint *)con->data; + + /* new headtail functionality makes Bone-Tip function obsolete */ + if (data->flag & LOCLIKE_TIP) + con->headtail = 1.0f; + } } } } @@ -7459,6 +7481,11 @@ static void expand_modifier(FileData *fd, Main *mainvar, ModifierData *md) expand_doit(fd, mainvar, amd->curve_ob); expand_doit(fd, mainvar, amd->offset_ob); } + else if (md->type==eModifierType_Mirror) { + MirrorModifierData *mmd = (MirrorModifierData*) md; + + expand_doit(fd, mainvar, mmd->mirror_ob); + } } static void expand_scriptlink(FileData *fd, Main *mainvar, ScriptLink *slink) diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 64849affdbf..271ab64da00 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -794,11 +794,15 @@ static void write_modifiers(WriteData *wd, ListBase *modbase) } else if (md->type==eModifierType_MeshDeform) { MeshDeformModifierData *mmd = (MeshDeformModifierData*) md; - + int size = mmd->dyngridsize; + writedata(wd, DATA, sizeof(float)*mmd->totvert*mmd->totcagevert, mmd->bindweights); writedata(wd, DATA, sizeof(float)*3*mmd->totcagevert, mmd->bindcos); + writestruct(wd, DATA, "MDefCell", size*size*size, mmd->dyngrid); + writestruct(wd, DATA, "MDefInfluence", mmd->totinfluence, mmd->dyninfluences); + writedata(wd, DATA, sizeof(int)*mmd->totvert, mmd->dynverts); } } } @@ -1760,7 +1764,7 @@ static void write_sounds(WriteData *wd, ListBase *idbase) // set all samples to unsaved status - sample = samples->first; + sample = samples->first; // samples is a global defined in sound.c while (sample) { sample->flags |= SAMPLE_NEEDS_SAVE; sample = sample->id.next; |