[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31561] trunk/blender/source/blender: Applied patch #23379.

Robert Holcomb bob_holcomb at hotmail.com
Wed Aug 25 04:18:40 CEST 2010


Revision: 31561
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31561
Author:   scourage
Date:     2010-08-25 04:18:37 +0200 (Wed, 25 Aug 2010)

Log Message:
-----------
Applied patch #23379.  Does not change existing .blend files and looks
good.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_node/drawnode.c
    trunk/blender/source/blender/makesdna/DNA_node_types.h
    trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
    trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_crop.c

Modified: trunk/blender/source/blender/editors/space_node/drawnode.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/drawnode.c	2010-08-25 02:00:55 UTC (rev 31560)
+++ trunk/blender/source/blender/editors/space_node/drawnode.c	2010-08-25 02:18:37 UTC (rev 31561)
@@ -707,12 +707,20 @@
 	uiLayout *col;
 	
 	uiItemR(layout, ptr, "use_crop_size", 0, NULL, 0);
-	
+   uiItemR(layout, ptr, "relative", 0, NULL, 0);
+
 	col= uiLayoutColumn(layout, 1);
-	uiItemR(col, ptr, "min_x", 0, "Left", 0);
-	uiItemR(col, ptr, "max_x", 0, "Right", 0);
-	uiItemR(col, ptr, "min_y", 0, "Up", 0);
-	uiItemR(col, ptr, "max_y", 0, "Down", 0);
+   if (RNA_boolean_get(ptr, "relative")){
+      uiItemR(col, ptr, "rel_min_x", 0, "Left", 0);
+      uiItemR(col, ptr, "rel_max_x", 0, "Right", 0);
+      uiItemR(col, ptr, "rel_min_y", 0, "Up", 0);
+      uiItemR(col, ptr, "rel_max_y", 0, "Down", 0);
+   } else {
+      uiItemR(col, ptr, "min_x", 0, "Left", 0);
+      uiItemR(col, ptr, "max_x", 0, "Right", 0);
+      uiItemR(col, ptr, "min_y", 0, "Up", 0);
+      uiItemR(col, ptr, "max_y", 0, "Down", 0);
+   }
 }
 
 static void node_composit_buts_splitviewer(uiLayout *layout, bContext *C, PointerRNA *ptr)

Modified: trunk/blender/source/blender/makesdna/DNA_node_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_node_types.h	2010-08-25 02:00:55 UTC (rev 31560)
+++ trunk/blender/source/blender/makesdna/DNA_node_types.h	2010-08-25 02:18:37 UTC (rev 31561)
@@ -255,6 +255,7 @@
 
 typedef struct NodeTwoXYs {
 	short x1, x2, y1, y2;
+   float fac_x1, fac_x2, fac_y1, fac_y2;
 } NodeTwoXYs;
 
 typedef struct NodeTwoFloats {

Modified: trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c	2010-08-25 02:00:55 UTC (rev 31560)
+++ trunk/blender/source/blender/makesrna/intern/rna_nodetree.c	2010-08-25 02:18:37 UTC (rev 31561)
@@ -1637,7 +1637,12 @@
 	RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1);
 	RNA_def_property_ui_text(prop, "Crop Image Size", "Whether to crop the size of the input image");
 	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
-	
+
+   prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
+   RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1);
+   RNA_def_property_ui_text(prop, "Relative", "Use relative values to crop image");
+   RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
 	RNA_def_struct_sdna_from(srna, "NodeTwoXYs", "storage");
 
 	prop = RNA_def_property(srna, "min_x", PROP_INT, PROP_NONE);
@@ -1663,6 +1668,30 @@
 	RNA_def_property_range(prop, 0, 10000);
 	RNA_def_property_ui_text(prop, "Y2", "");
 	RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
+   prop = RNA_def_property(srna, "rel_min_x", PROP_FLOAT, PROP_NONE);
+   RNA_def_property_float_sdna(prop, NULL, "fac_x1");
+   RNA_def_property_range(prop, 0.0, 1.0);
+   RNA_def_property_ui_text(prop, "X1", "");
+   RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
+   prop = RNA_def_property(srna, "rel_max_x", PROP_FLOAT, PROP_NONE);
+   RNA_def_property_float_sdna(prop, NULL, "fac_x2");
+   RNA_def_property_range(prop, 0.0, 1.0);
+   RNA_def_property_ui_text(prop, "X2", "");
+   RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
+   prop = RNA_def_property(srna, "rel_min_y", PROP_FLOAT, PROP_NONE);
+   RNA_def_property_float_sdna(prop, NULL, "fac_y1");
+   RNA_def_property_range(prop, 0.0, 1.0);
+   RNA_def_property_ui_text(prop, "Y1", "");
+   RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+
+   prop = RNA_def_property(srna, "rel_max_y", PROP_FLOAT, PROP_NONE);
+   RNA_def_property_float_sdna(prop, NULL, "fac_y2");
+   RNA_def_property_range(prop, 0.0, 1.0);
+   RNA_def_property_ui_text(prop, "Y2", "");
+   RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
 }
 
 static void def_cmp_dblur(StructRNA *srna)

Modified: trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_crop.c
===================================================================
--- trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_crop.c	2010-08-25 02:00:55 UTC (rev 31560)
+++ trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_crop.c	2010-08-25 02:18:37 UTC (rev 31561)
@@ -48,8 +48,15 @@
 		CompBuf *stackbuf;
 		int x, y;
 		float *srcfp, *outfp;
-		rcti outputrect;
+      rcti outputrect;
 
+      if(node->custom2) {
+         ntxy->x1= cbuf->x* ntxy->fac_x1;
+         ntxy->x2= cbuf->x* ntxy->fac_x2;
+         ntxy->y1= cbuf->y* ntxy->fac_y1;
+         ntxy->y2= cbuf->y* ntxy->fac_y2;
+      }
+
 		/* check input image size */
 		if(cbuf->x <= ntxy->x1 + 1)
 			ntxy->x1= cbuf->x - 1;





More information about the Bf-blender-cvs mailing list