[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30586] trunk/blender/source/blender/nodes /intern/CMP_util.c: Fix #22786: displace node doesn' t work with procedural textures.

Brecht Van Lommel brecht at blender.org
Wed Jul 21 16:13:49 CEST 2010


Revision: 30586
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30586
Author:   blendix
Date:     2010-07-21 16:13:48 +0200 (Wed, 21 Jul 2010)

Log Message:
-----------
Fix #22786: displace node doesn't work with procedural textures.

Modified Paths:
--------------
    trunk/blender/source/blender/nodes/intern/CMP_util.c

Modified: trunk/blender/source/blender/nodes/intern/CMP_util.c
===================================================================
--- trunk/blender/source/blender/nodes/intern/CMP_util.c	2010-07-21 14:11:19 UTC (rev 30585)
+++ trunk/blender/source/blender/nodes/intern/CMP_util.c	2010-07-21 14:13:48 UTC (rev 30586)
@@ -1125,7 +1125,19 @@
 // sets fcol to pixelcolor at (x, y)
 void qd_getPixel(CompBuf* src, int x, int y, float* col)
 {
-	if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) {
+	if(src->rect_procedural) {
+		float bc[4];
+		src->rect_procedural(src, bc, (float)x/(float)src->xrad, (float)y/(float)src->yrad);
+
+		switch(src->type){
+			/* these fallthrough to get all the channels */
+			case CB_RGBA: col[3]=bc[3]; 
+			case CB_VEC3: col[2]=bc[2];
+			case CB_VEC2: col[1]=bc[1];
+			case CB_VAL: col[0]=bc[0];
+		}
+	}
+	else if ((x >= 0) && (x < src->x) && (y >= 0) && (y < src->y)) {
 		float* bc = &src->rect[(x + y*src->x)*src->type];
 		switch(src->type){
 			/* these fallthrough to get all the channels */





More information about the Bf-blender-cvs mailing list