[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19006] branches/blender2.5/blender/source /blender: 2.5

Ton Roosendaal ton at blender.org
Tue Feb 17 14:37:08 CET 2009


Revision: 19006
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19006
Author:   ton
Date:     2009-02-17 14:37:06 +0100 (Tue, 17 Feb 2009)

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

Node/Composite tinkering:

- titles in headers and on collapsed nodes back
- backdrop option draws again (no scroll operator yet)
- added preview option in blur, filter and mix nodes. 
  Just for fun while working :) Probably every node
  should get this...

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c
    branches/blender2.5/blender/source/blender/editors/space_node/node_draw.c
    branches/blender2.5/blender/source/blender/editors/space_node/node_intern.h
    branches/blender2.5/blender/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
    branches/blender2.5/blender/source/blender/nodes/intern/CMP_nodes/CMP_filter.c
    branches/blender2.5/blender/source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c

Modified: branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c	2009-02-17 13:11:09 UTC (rev 19005)
+++ branches/blender2.5/blender/source/blender/editors/space_node/drawnode.c	2009-02-17 13:37:06 UTC (rev 19006)
@@ -2443,7 +2443,7 @@
 
 #endif
 
-void draw_nodespace_back_pix(ScrArea *sa, SpaceNode *snode)
+void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode)
 {
 	
 	if((snode->flag & SNODE_BACKDRAW) && snode->treetype==NTREE_COMPOSIT) {
@@ -2453,12 +2453,12 @@
 			float x, y; 
 			/* somehow the offset has to be calculated inverse */
 			
-			//glaDefine2DArea(&sa->winrct);
+			glaDefine2DArea(&ar->winrct);
 			/* ortho at pixel level curarea */
-			//myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
+			wmOrtho2(-0.375, ar->winx-0.375, -0.375, ar->winy-0.375);
 			
-			x = (sa->winx-ibuf->x)/2 + snode->xof;
-			y = (sa->winy-ibuf->y)/2 + snode->yof;
+			x = (ar->winx-ibuf->x)/2 + snode->xof;
+			y = (ar->winy-ibuf->y)/2 + snode->yof;
 			
 			if(ibuf->rect)
 				glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
@@ -2466,9 +2466,8 @@
 				glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_RGBA, GL_FLOAT, ibuf->rect_float);
 			
 			/* sort this out, this should not be needed */
-			//myortho2(snode->v2d.cur.xmin, snode->v2d.cur.xmax, snode->v2d.cur.ymin, snode->v2d.cur.ymax);
-			//bwin_clear_viewmat(sa->win);	/* clear buttons view */
-			// glLoadIdentity();
+			wmOrtho2(ar->v2d.cur.xmin, ar->v2d.cur.xmax, ar->v2d.cur.ymin, ar->v2d.cur.ymax);
+			glLoadIdentity();
 		}
 	}
 }

Modified: branches/blender2.5/blender/source/blender/editors/space_node/node_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_node/node_draw.c	2009-02-17 13:11:09 UTC (rev 19005)
+++ branches/blender2.5/blender/source/blender/editors/space_node/node_draw.c	2009-02-17 13:37:06 UTC (rev 19006)
@@ -94,7 +94,7 @@
 extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
 extern void ui_draw_tria_icon(float x, float y, float aspect, char dir);
 
-#if 0 // XXX
+
 static void snode_drawstring(void *curfont, SpaceNode *snode, char *str, int okwidth)
 {
 	char drawstr[NODE_MAXSTR];
@@ -118,8 +118,8 @@
 	}
 	UI_DrawString(curfont, drawstr, 0);
 }
-#endif
 
+
 static void node_scaling_widget(int color_id, float aspect, float xmin, float ymin, float xmax, float ymax)
 {
 	float dx;
@@ -730,7 +730,7 @@
 	else
 		UI_ThemeColor(TH_TEXT);
 	
-	// ui_rasterpos_safe(rct->xmin+19.0f, rct->ymax-NODE_DY+5.0f, snode->aspect);
+	ui_rasterpos_safe(rct->xmin+19.0f, rct->ymax-NODE_DY+5.0f, snode->aspect);
 	
 	if(node->flag & NODE_MUTED)
 		sprintf(showname, "[%s]", node->name);
@@ -739,11 +739,7 @@
 	else
 		BLI_strncpy(showname, node->name, 128);
 	
-	block= uiBeginBlock(C, ar, "snode_drawstring_hack", UI_EMBOSSN, UI_HELV);
-	// snode_drawstring(block->curfont, snode, showname, (int)(iconofs - rct->xmin-18.0f));
-	bt= uiDefBut(block, LABEL, 0, showname, (int)rct->xmin+19, (int)rct->ymax-NODE_DY+5, 100, 20, NULL, 0, 0, 0, 0, "");
-	uiEndBlock(C, block);
-	block= NULL;
+	snode_drawstring(snode->curfont, snode, showname, (int)(iconofs - rct->xmin-18.0f));
 
 	/* body */
 	UI_ThemeColor4(TH_NODE);
@@ -871,7 +867,6 @@
 
 static void node_draw_hidden(View2D *v2d, SpaceNode *snode, bNode *node)
 {
-//	uiBlock *block; // XXX HACK
 	bNodeSocket *sock;
 	rctf *rct= &node->totr;
 	float dx, centy= 0.5f*(rct->ymax+rct->ymin);
@@ -923,13 +918,7 @@
 		else
 			BLI_strncpy(showname, node->name, 128);
 
-		/* XXX 
-		block= uiBeginBlock(C, ar, "snode_drawstring_hack", UI_EMBOSSN, UI_HELV);
-		// snode_drawstring(block->curfont, snode, showname, (int)(iconofs - rct->xmin-18.0f));
-		bt= uiDefBut(block, LABEL, 0, showname, rct->xmin+21, centy-4, 100, 20, NULL, 0, 0, 0, 0, "");
-		uiEndBlock(C, block);
-		*/
-		
+		snode_drawstring(snode->curfont, snode, showname, (int)(rct->xmax - rct->xmin-18.0f -12.0f));
 	}	
 
 	/* scale widget thing */
@@ -1092,7 +1081,6 @@
 	float col[3];
 	View2DScrollers *scrollers;
 	SpaceNode *snode= (SpaceNode*)CTX_wm_space_data(C);
-	ScrArea *sa= CTX_wm_area(C);
 	
 	UI_GetThemeColor3fv(TH_BACK, col);
 	glClearColor(col[0], col[1], col[2], 0);
@@ -1112,7 +1100,7 @@
 
 	UI_view2d_constant_grid_draw(C, v2d);
 	/* backdrop */
-	draw_nodespace_back_pix(sa, snode);
+	draw_nodespace_back_pix(ar, snode);
 	
 	/* nodes */
 	snode_set_context(snode, CTX_data_scene(C));

Modified: branches/blender2.5/blender/source/blender/editors/space_node/node_intern.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_node/node_intern.h	2009-02-17 13:11:09 UTC (rev 19005)
+++ branches/blender2.5/blender/source/blender/editors/space_node/node_intern.h	2009-02-17 13:37:06 UTC (rev 19006)
@@ -64,7 +64,7 @@
 void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link);
 void node_draw_link_bezier(View2D *v2d, SpaceNode *snode, bNodeLink *link, int th_col1, int th_col2, int do_shaded);
 int node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, float coord_array[][2], int resol);
-void draw_nodespace_back_pix(ScrArea *sa, SpaceNode *snode);
+void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode);
 
 /* node_edit.c */
 void snode_handle_recalc(bContext *C, SpaceNode *snode);

Modified: branches/blender2.5/blender/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
===================================================================
--- branches/blender2.5/blender/source/blender/nodes/intern/CMP_nodes/CMP_blur.c	2009-02-17 13:11:09 UTC (rev 19005)
+++ branches/blender2.5/blender/source/blender/nodes/intern/CMP_nodes/CMP_blur.c	2009-02-17 13:37:06 UTC (rev 19006)
@@ -665,6 +665,8 @@
 		if(img!=in[0]->data)
 			free_compbuf(img);
 	}
+
+	generate_preview(node, out[0]->data);
 }
 
 static void node_composit_init_blur(bNode* node)
@@ -677,7 +679,7 @@
 	/* type code   */	CMP_NODE_BLUR,
 	/* name        */	"Blur",
 	/* width+range */	120, 80, 200,
-	/* class+opts  */	NODE_CLASS_OP_FILTER, NODE_OPTIONS,
+	/* class+opts  */	NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS,
 	/* input sock  */	cmp_node_blur_in,
 	/* output sock */	cmp_node_blur_out,
 	/* storage     */	"NodeBlurData",

Modified: branches/blender2.5/blender/source/blender/nodes/intern/CMP_nodes/CMP_filter.c
===================================================================
--- branches/blender2.5/blender/source/blender/nodes/intern/CMP_nodes/CMP_filter.c	2009-02-17 13:11:09 UTC (rev 19005)
+++ branches/blender2.5/blender/source/blender/nodes/intern/CMP_nodes/CMP_filter.c	2009-02-17 13:37:06 UTC (rev 19006)
@@ -211,6 +211,8 @@
 		}
 			
 		out[0]->data= stackbuf;
+		
+		generate_preview(node, out[0]->data);
 	}
 }
 
@@ -220,7 +222,7 @@
 	/* type code   */	CMP_NODE_FILTER,
 	/* name        */	"Filter",
 	/* width+range */	80, 40, 120,
-	/* class+opts  */	NODE_CLASS_OP_FILTER, NODE_OPTIONS,
+	/* class+opts  */	NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS,
 	/* input sock  */	cmp_node_filter_in,
 	/* output sock */	cmp_node_filter_out,
 	/* storage     */	"", 

Modified: branches/blender2.5/blender/source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c
===================================================================
--- branches/blender2.5/blender/source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c	2009-02-17 13:11:09 UTC (rev 19005)
+++ branches/blender2.5/blender/source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c	2009-02-17 13:37:06 UTC (rev 19006)
@@ -73,6 +73,8 @@
 		composit3_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, in[0]->data, fac, do_mix_rgb, CB_RGBA, CB_RGBA, CB_VAL);
 		
 		out[0]->data= stackbuf;
+		
+		generate_preview(node, out[0]->data);
 	}
 }
 
@@ -82,7 +84,7 @@
 	/* type code   */	CMP_NODE_MIX_RGB,
 	/* name        */	"Mix",
 	/* width+range */	110, 60, 120,
-	/* class+opts  */	NODE_CLASS_OP_COLOR, NODE_OPTIONS,
+	/* class+opts  */	NODE_CLASS_OP_COLOR, NODE_PREVIEW|NODE_OPTIONS,
 	/* input sock  */	cmp_node_mix_rgb_in,
 	/* output sock */	cmp_node_mix_rgb_out,
 	/* storage     */	"", 





More information about the Bf-blender-cvs mailing list