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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2007-12-01 23:08:31 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2007-12-01 23:08:31 +0300
commit475cf46d61a6502263bc62d7400f170708cc15e6 (patch)
treee49b8a365bdddf164455fd1ee1274f4b4c57684d /source/blender/blenkernel
parenteff09ae3966575b139402607387f75b0120fad51 (diff)
Bugfix:
Duplicating or separating objects with a particle system could crash.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/object.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 30b5a2a43ca..3c815e86116 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1006,12 +1006,26 @@ SoftBody *copy_softbody(SoftBody *sb)
ParticleSystem *copy_particlesystem(ParticleSystem *psys)
{
ParticleSystem *psysn;
+ ParticleData *pa;
+ int a;
psysn= MEM_dupallocN(psys);
psysn->particles= MEM_dupallocN(psys->particles);
-
psysn->child= MEM_dupallocN(psys->child);
+ for(a=0, pa=psysn->particles; a<psysn->totpart; a++, pa++) {
+ if(pa->hair)
+ pa->hair= MEM_dupallocN(pa->hair);
+ if(pa->keys)
+ pa->keys= MEM_dupallocN(pa->keys);
+ }
+
+ if(psys->soft)
+ psysn->soft= copy_softbody(psys->soft);
+
+ psysn->pathcache= NULL;
+ psysn->childcache= NULL;
+ psysn->edit= NULL;
psysn->effectors.first= psysn->effectors.last= 0;
id_us_plus((ID *)psysn->part);