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
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2011-07-15 17:32:02 +0400
committerJanne Karhu <jhkarh@gmail.com>2011-07-15 17:32:02 +0400
commit729498ab2da989d0bfbba02c1b1a6bc9f6964b1c (patch)
treed2d7e6ddcd8709efc6b0f65993d0d980169adacb /source/blender/blenloader/intern/writefile.c
parent7984e338db93c7d5d276f1cb8a6a468ccd4446a7 (diff)
Fix for [#26712] Particle group instance 'Use Count' value gets reset on file-load.
* New object pointers can't be loaded properly for library linked groups, so the weight groups now store an index to the group objects at save time. This index is used at load time to set the objects without relying on the old pointers. * If the library linked group is modified the indices can be wrong, but this can't really be avoided easily as there's no way to relate objects in a linked group between loads.
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r--source/blender/blenloader/intern/writefile.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index ba4395ace9c..bf86527b9d3 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -837,6 +837,7 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase)
{
ParticleSettings *part;
ParticleDupliWeight *dw;
+ GroupObject *go;
int a;
part= idbase->first;
@@ -851,8 +852,16 @@ static void write_particlesettings(WriteData *wd, ListBase *idbase)
writestruct(wd, DATA, "EffectorWeights", 1, part->effector_weights);
dw = part->dupliweights.first;
- for(; dw; dw=dw->next)
+ for(; dw; dw=dw->next) {
+ /* update indices */
+ dw->index = 0;
+ go = part->dup_group->gobject.first;
+ while(go && go->ob != dw->ob) {
+ go=go->next;
+ dw->index++;
+ }
writestruct(wd, DATA, "ParticleDupliWeight", 1, dw);
+ }
if(part->boids && part->phystype == PART_PHYS_BOIDS) {
BoidState *state = part->boids->states.first;