[Bf-blender-cvs] [8e00406] master: Fix a bunch of missing expand calls in object/particle physics area, was breaking linking of those.

Bastien Montagne noreply at git.blender.org
Fri Jul 29 18:47:58 CEST 2016


Commit: 8e004062612e50789f081c795e7f39bf51ca3ae7
Author: Bastien Montagne
Date:   Fri Jul 29 17:35:31 2016 +0200
Branches: master
https://developer.blender.org/rB8e004062612e50789f081c795e7f39bf51ca3ae7

Fix a bunch of missing expand calls in object/particle physics area, was breaking linking of those.

Initial report/patch by Alexander Gavrilov (@angavrilov), found more on the road.

Nice demo of why we should use libquery ID looper in read code too - but that's for another day
(also because read code needs to take care of some deprecated pointers sometimes)...

===================================================================

M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d007eed..22e1507 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -8850,6 +8850,37 @@ static void expand_particlesettings(FileData *fd, Main *mainvar, ParticleSetting
 			expand_doit(fd, mainvar, part->mtex[a]->object);
 		}
 	}
+
+	if (part->effector_weights) {
+		expand_doit(fd, mainvar, part->effector_weights->group);
+	}
+
+	if (part->pd) {
+		expand_doit(fd, mainvar, part->pd->tex);
+		expand_doit(fd, mainvar, part->pd->f_source);
+	}
+	if (part->pd2) {
+		expand_doit(fd, mainvar, part->pd2->tex);
+		expand_doit(fd, mainvar, part->pd2->f_source);
+	}
+
+	if (part->boids) {
+		BoidState *state;
+		BoidRule *rule;
+
+		for (state = part->boids->states.first; state; state = state->next) {
+			for (rule = state->rules.first; rule; rule = rule->next) {
+				if (rule->type == eBoidRuleType_Avoid) {
+					BoidRuleGoalAvoid *gabr = (BoidRuleGoalAvoid *)rule;
+					expand_doit(fd, mainvar, gabr->ob);
+				}
+				else if (rule->type == eBoidRuleType_FollowLeader) {
+					BoidRuleFollowLeader *flbr = (BoidRuleFollowLeader *)rule;
+					expand_doit(fd, mainvar, flbr->ob);
+				}
+			}
+		}
+	}
 }
 
 static void expand_group(FileData *fd, Main *mainvar, Group *group)
@@ -9213,7 +9244,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
 	
 	for (psys = ob->particlesystem.first; psys; psys = psys->next)
 		expand_doit(fd, mainvar, psys->part);
-	
+
 	for (sens = ob->sensors.first; sens; sens = sens->next) {
 		if (sens->type == SENS_MESSAGE) {
 			bMessageSensor *ms = sens->data;
@@ -9292,8 +9323,16 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
 		}
 	}
 	
-	if (ob->pd && ob->pd->tex)
+	if (ob->pd) {
 		expand_doit(fd, mainvar, ob->pd->tex);
+		expand_doit(fd, mainvar, ob->pd->f_source);
+	}
+
+	if (ob->soft) {
+        if (ob->soft->effector_weights) {
+                expand_doit(fd, mainvar, ob->soft->effector_weights->group);
+        }
+	}
 
 	if (ob->rigidbody_constraint) {
 		expand_doit(fd, mainvar, ob->rigidbody_constraint->ob1);




More information about the Bf-blender-cvs mailing list