[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16169] trunk/blender/source/blender/ blenloader/intern/readfile.c:

Brecht Van Lommel brechtvanlommel at pandora.be
Mon Aug 18 13:55:40 CEST 2008


Revision: 16169
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16169
Author:   blendix
Date:     2008-08-18 13:55:40 +0200 (Mon, 18 Aug 2008)

Log Message:
-----------

Fix for bug #17485: inter object sensor/controller/actuator links could
get lost in reading libraries. The pointers were being remapped in the
expand stage, but not all objects were guaranteed to be linked in at that
point, so they got lost. Now it always does this in the lib linking stage
for both regular and library objects.

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2008-08-18 11:09:27 UTC (rev 16168)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2008-08-18 11:55:40 UTC (rev 16169)
@@ -2942,11 +2942,9 @@
 
 			sens= ob->sensors.first;
 			while(sens) {
-				if(ob->id.lib==NULL) {	// done in expand_main
-					for(a=0; a<sens->totlinks; a++) {
-						sens->links[a]= newglobadr(fd, sens->links[a]);
-					}
-				}
+				for(a=0; a<sens->totlinks; a++)
+					sens->links[a]= newglobadr(fd, sens->links[a]);
+
 				if(sens->type==SENS_TOUCH) {
 					bTouchSensor *ts= sens->data;
 					ts->ma= newlibadr(fd, ob->id.lib, ts->ma);
@@ -2961,11 +2959,9 @@
 
 			cont= ob->controllers.first;
 			while(cont) {
-				if(ob->id.lib==NULL) {	// done in expand_main
-					for(a=0; a<cont->totlinks; a++) {
-						cont->links[a]= newglobadr(fd, cont->links[a]);
-					}
-				}
+				for(a=0; a<cont->totlinks; a++)
+					cont->links[a]= newglobadr(fd, cont->links[a]);
+
 				if(cont->type==CONT_PYTHON) {
 					bPythonCont *pc= cont->data;
 					pc->text= newlibadr(fd, ob->id.lib, pc->text);
@@ -8481,9 +8477,6 @@
 
 	sens= ob->sensors.first;
 	while(sens) {
-		for(a=0; a<sens->totlinks; a++) {
-			sens->links[a]= newglobadr(fd, sens->links[a]);
-		}
 		if(sens->type==SENS_TOUCH) {
 			bTouchSensor *ts= sens->data;
 			expand_doit(fd, mainvar, ts->ma);
@@ -8497,9 +8490,6 @@
 
 	cont= ob->controllers.first;
 	while(cont) {
-		for(a=0; a<cont->totlinks; a++) {
-			cont->links[a]= newglobadr(fd, cont->links[a]);
-		}
 		if(cont->type==CONT_PYTHON) {
 			bPythonCont *pc= cont->data;
 			expand_doit(fd, mainvar, pc->text);





More information about the Bf-blender-cvs mailing list