[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43178] trunk/blender/source/blender/nodes /composite/node_composite_util.c: Fix #29801: various compositing nodes not working correct after translate,

Brecht Van Lommel brechtvanlommel at pandora.be
Thu Jan 5 18:50:27 CET 2012


Revision: 43178
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43178
Author:   blendix
Date:     2012-01-05 17:50:25 +0000 (Thu, 05 Jan 2012)
Log Message:
-----------
Fix #29801: various compositing nodes not working correct after translate,
e.g. separate HSVA node.

Modified Paths:
--------------
    trunk/blender/source/blender/nodes/composite/node_composite_util.c

Modified: trunk/blender/source/blender/nodes/composite/node_composite_util.c
===================================================================
--- trunk/blender/source/blender/nodes/composite/node_composite_util.c	2012-01-05 17:50:09 UTC (rev 43177)
+++ trunk/blender/source/blender/nodes/composite/node_composite_util.c	2012-01-05 17:50:25 UTC (rev 43178)
@@ -427,6 +427,18 @@
 
 /* **************************************************** */
 
+static CompBuf *composit_check_compbuf(CompBuf *cbuf, int type, CompBuf *outbuf)
+{
+	/* check type */
+	CompBuf *dbuf= typecheck_compbuf(cbuf, type);
+
+	/* if same as output and translated, duplicate so pixels don't interfere */
+	if(dbuf == outbuf && !dbuf->rect_procedural && (dbuf->xof || dbuf->yof))
+		dbuf= dupalloc_compbuf(dbuf);
+	
+	return dbuf;
+}
+
 /* Pixel-to-Pixel operation, 1 Image in, 1 out */
 void composit1_pixel_processor(bNode *node, CompBuf *out, CompBuf *src_buf, float *src_col,
 									  void (*func)(bNode *, float *, float *), 
@@ -437,7 +449,7 @@
 	float color[4];	/* local color if compbuf is procedural */
 	int xrad, yrad, x, y;
 	
-	src_use= typecheck_compbuf(src_buf, src_type);
+	src_use= composit_check_compbuf(src_buf, src_type, out);
 	
 	xrad= out->xrad;
 	yrad= out->yrad;
@@ -463,8 +475,8 @@
 	float color[4];	/* local color if compbuf is procedural */
 	int xrad, yrad, x, y;
 	
-	src_use= typecheck_compbuf(src_buf, src_type);
-	fac_use= typecheck_compbuf(fac_buf, fac_type);
+	src_use= composit_check_compbuf(src_buf, src_type, out);
+	fac_use= composit_check_compbuf(fac_buf, fac_type, out);
 
 	xrad= out->xrad;
 	yrad= out->yrad;
@@ -493,9 +505,9 @@
 	float color[4];	/* local color if compbuf is procedural */
 	int xrad, yrad, x, y;
 	
-	src1_use= typecheck_compbuf(src1_buf, src1_type);
-	src2_use= typecheck_compbuf(src2_buf, src2_type);
-	fac_use= typecheck_compbuf(fac_buf, fac_type);
+	src1_use= composit_check_compbuf(src1_buf, src1_type, out);
+	src2_use= composit_check_compbuf(src2_buf, src2_type, out);
+	fac_use= composit_check_compbuf(fac_buf, fac_type, out);
 	
 	xrad= out->xrad;
 	yrad= out->yrad;
@@ -529,10 +541,10 @@
 	float color[4];	/* local color if compbuf is procedural */
 	int xrad, yrad, x, y;
 	
-	src1_use= typecheck_compbuf(src1_buf, src1_type);
-	src2_use= typecheck_compbuf(src2_buf, src2_type);
-	fac1_use= typecheck_compbuf(fac1_buf, fac1_type);
-	fac2_use= typecheck_compbuf(fac2_buf, fac2_type);
+	src1_use= composit_check_compbuf(src1_buf, src1_type, out);
+	src2_use= composit_check_compbuf(src2_buf, src2_type, out);
+	fac1_use= composit_check_compbuf(fac1_buf, fac1_type, out);
+	fac2_use= composit_check_compbuf(fac2_buf, fac2_type, out);
 	
 	xrad= out->xrad;
 	yrad= out->yrad;



More information about the Bf-blender-cvs mailing list