[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24125] trunk/blender/source/blender: 2. 5 Nodes:

Thomas Dinges dingto at gmx.de
Tue Oct 27 22:54:29 CET 2009


Revision: 24125
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24125
Author:   dingto
Date:     2009-10-27 22:54:29 +0100 (Tue, 27 Oct 2009)

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

*Wrapped File Output Node. 
Note: Crashs on execution while rendering. 

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_node/drawnode.c
    trunk/blender/source/blender/makesrna/intern/rna_nodetree.c

Modified: trunk/blender/source/blender/editors/space_node/drawnode.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/drawnode.c	2009-10-27 19:53:34 UTC (rev 24124)
+++ trunk/blender/source/blender/editors/space_node/drawnode.c	2009-10-27 21:54:29 UTC (rev 24125)
@@ -1457,6 +1457,7 @@
 }
 
 /* allocate sufficient! */
+/*
 static void node_imagetype_string(char *str)
 {
 	str += sprintf(str, "Save Image as: %%t|");
@@ -1471,67 +1472,37 @@
 	str += sprintf(str, "DPX %%x%d|", R_DPX);
 	str += sprintf(str, "OpenEXR %%x%d", R_OPENEXR);
 }
+*/
 
-static void node_set_image_cb(bContext *C, void *ntree_v, void *node_v)
+/*static void node_set_image_cb(bContext *C, void *ntree_v, void *node_v)
 {
 	bNodeTree *ntree= ntree_v;
 	bNode *node= node_v;
 	
 	nodeSetActive(ntree, node);
 }
+*/
 
 static void node_composit_buts_file_output(uiLayout *layout, PointerRNA *ptr)
 {
-	uiBlock *block= uiLayoutAbsoluteBlock(layout);
-	bNode *node= ptr->data;
-	bNodeTree *ntree= ptr->id.data;
-	rctf *butr= &node->butr;
-	NodeImageFile *nif= node->storage;
-	uiBut *bt;
-	short x= (short)butr->xmin;
-	short y= (short)butr->ymin;
-	short w= (short)butr->xmax-butr->xmin;
-	char str[320];
-	
-	node_imagetype_string(str);
-	
-	uiBlockBeginAlign(block);
-	
-	bt = uiDefIconBut(block, BUT, B_NODE_SETIMAGE, ICON_FILESEL,
-			  x, y+60, 20, 20,
-			  0, 0, 0, 0, 0, "Open Fileselect to get Backbuf image");
-	uiButSetFunc(bt, node_set_image_cb, ntree, node);
-	
-	uiDefBut(block, TEX, B_NOP, "",
-			  20+x, y+60, w-20, 20, 
-			  nif->name, 0.0f, 240.0f, 0, 0, "");
-	
-	uiDefButS(block, MENU, B_NOP, str,
-			  x, y+40, w, 20, 
-			  &nif->imtype, 0.0f, 1.0f, 0, 0, "");
-	
-	if(nif->imtype==R_OPENEXR) {
-		uiDefButBitS(block, TOG, R_OPENEXR_HALF, B_REDR, "Half",	
-					x, y+20, w/2, 20, 
-					&nif->subimtype, 0, 0, 0, 0, "");
+	uiLayout *col, *row;
 
-		uiDefButS(block, MENU,B_NOP, "Codec %t|None %x0|Pxr24 (lossy) %x1|ZIP (lossless) %x2|PIZ (lossless) %x3|RLE (lossless) %x4",  
-					x+w/2, y+20, w/2, 20, 
-					&nif->codec, 0, 0, 0, 0, "");
+	col= uiLayoutColumn(layout, 0);
+	uiItemR(col, "", 0, ptr, "filename", 0);
+	uiItemR(col, "", 0, ptr, "image_type", 0);
+	
+	row= uiLayoutRow(layout, 0);
+	if (RNA_enum_get(ptr, "image_type")== R_OPENEXR) {
+		uiItemR(row, NULL, 0, ptr, "exr_half", 0);
+		uiItemR(row, "", 0, ptr, "exr_codec", 0);
 	}
 	else {
-		uiDefButS(block, NUM, B_NOP, "Quality: ",
-			  x, y+20, w, 20, 
-			  &nif->quality, 10.0f, 100.0f, 10, 0, "");
+		uiItemR(row, NULL, 0, ptr, "quality", 0);
 	}
 	
-	/* start frame, end frame */
-	uiDefButI(block, NUM, B_NODE_EXEC, "SFra: ", 
-			  x, y, w/2, 20, 
-			  &nif->sfra, 1, MAXFRAMEF, 10, 0, "");
-	uiDefButI(block, NUM, B_NODE_EXEC, "EFra: ", 
-			  x+w/2, y, w/2, 20, 
-			  &nif->efra, 1, MAXFRAMEF, 10, 0, "");
+	row= uiLayoutRow(layout, 1);
+	uiItemR(row, "Start", 0, ptr, "start_frame", 0);
+	uiItemR(row, "End", 0, ptr, "end_frame", 0);
 }
 
 static void node_scale_cb(bContext *C, void *node_v, void *unused_v)

Modified: trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c	2009-10-27 19:53:34 UTC (rev 24124)
+++ trunk/blender/source/blender/makesrna/intern/rna_nodetree.c	2009-10-27 21:54:29 UTC (rev 24125)
@@ -882,8 +882,7 @@
 		{R_CINEON,  "CINEON",       0, "Cineon",       ""},
 		{R_DPX,     "DPX",          0, "DPX",          ""},
 		{R_OPENEXR, "OPENEXR",      0, "OpenEXR",      ""},
-		{0, NULL, 0, NULL, NULL}
-	};
+		{0, NULL, 0, NULL, NULL}};
 	
 	static EnumPropertyItem openexr_codec_items[] = {
 		{0, "NONE",  0, "None",           ""},
@@ -891,12 +890,11 @@
 		{2, "ZIP",   0, "ZIP (lossless)", ""},
 		{3, "PIZ",   0, "PIX (lossless)", ""},
 		{4, "RLE",   0, "RLE (lossless)", ""},
-		{0, NULL, 0, NULL, NULL}
-	};
+		{0, NULL, 0, NULL, NULL}};
 	
 	RNA_def_struct_sdna_from(srna, "NodeImageFile", "storage");
 	
-	prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_NONE);
+	prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_DIRPATH);
 	RNA_def_property_string_sdna(prop, NULL, "name");
 	RNA_def_property_ui_text(prop, "Filename", "");
 	
@@ -905,32 +903,26 @@
 	RNA_def_property_enum_items(prop, type_items);
 	RNA_def_property_ui_text(prop, "Image Type", "");
 	
-	/* TODO: openexr only { */
-	
-	prop = RNA_def_property(srna, "half", PROP_BOOLEAN, PROP_NONE);
+	prop = RNA_def_property(srna, "exr_half", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_HALF);
 	RNA_def_property_ui_text(prop, "Half", "");
 	
-	prop = RNA_def_property(srna, "codec", PROP_ENUM, PROP_NONE);
+	prop = RNA_def_property(srna, "exr_codec", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "codec");
 	RNA_def_property_enum_items(prop, openexr_codec_items);
 	RNA_def_property_ui_text(prop, "Codec", "");
 	
-	/* } else { */
-	
 	prop = RNA_def_property(srna, "quality", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "quality");
 	RNA_def_property_ui_text(prop, "Quality", "");
 	
-	/* } */
-	
-	prop = RNA_def_property(srna, "start", PROP_INT, PROP_NONE);
+	prop = RNA_def_property(srna, "start_frame", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "sfra");
 	RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF);
 	RNA_def_property_ui_text(prop, "Start Frame", "");
 	RNA_def_property_update(prop, 0, "rna_Node_update");
 	
-	prop = RNA_def_property(srna, "end", PROP_INT, PROP_NONE);
+	prop = RNA_def_property(srna, "end_frame", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "efra");
 	RNA_def_property_range(prop, MINFRAMEF, MAXFRAMEF);
 	RNA_def_property_ui_text(prop, "End Frame", "");





More information about the Bf-blender-cvs mailing list