[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26534] trunk/blender/source/blender/ blenloader/intern/readfile.c: Fix part of #19858: texture node outputs don' t work separately, the meaning

Brecht Van Lommel brecht at blender.org
Mon Feb 1 20:35:32 CET 2010


Revision: 26534
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26534
Author:   blendix
Date:     2010-02-01 20:35:32 +0100 (Mon, 01 Feb 2010)

Log Message:
-----------
Fix part of #19858: texture node outputs don't work separately, the meaning
of node output indices was changed without a version patch.

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	2010-02-01 19:28:50 UTC (rev 26533)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2010-02-01 19:35:32 UTC (rev 26534)
@@ -9632,6 +9632,7 @@
 		bSound *sound;
 		Sequence *seq;
 		bActuator *act;
+		int a;
 
 		for(sound = main->sound.first; sound; sound = sound->id.next)
 		{
@@ -9704,6 +9705,15 @@
 		for(ma= main->mat.first; ma; ma= ma->id.next) {
 			if(ma->nodetree && strlen(ma->nodetree->id.name)==0)
 				strcpy(ma->nodetree->id.name, "NTShader Nodetree");
+			
+			/* which_output 0 is now "not specified" */
+			for(a=0; a<MAX_MTEX; a++) {
+				if(ma->mtex[a]) {
+					tx= newlibadr(fd, lib, ma->mtex[a]->tex);
+					if(tx && tx->use_nodes)
+						ma->mtex[a]->which_output++;
+				}
+			}
 		}
 		/* and composit trees */
 		for(sce= main->scene.first; sce; sce= sce->id.next) {
@@ -9726,8 +9736,17 @@
 		}
 		/* and texture trees */
 		for(tx= main->tex.first; tx; tx= tx->id.next) {
-			if(tx->nodetree && strlen(tx->nodetree->id.name)==0)
-				strcpy(tx->nodetree->id.name, "NTTexture Nodetree");
+			bNode *node;
+
+			if(tx->nodetree) {
+				if(strlen(tx->nodetree->id.name)==0)
+					strcpy(tx->nodetree->id.name, "NTTexture Nodetree");
+
+				/* which_output 0 is now "not specified" */
+				for(node=tx->nodetree->nodes.first; node; node=node->next)
+					if(node->type == TEX_NODE_OUTPUT)
+						node->custom1++;
+			}
 		}
 		
 		/* copy standard draw flag to meshes(used to be global, is not available here) */





More information about the Bf-blender-cvs mailing list