[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23291] trunk/blender/source/blender: *Changed image field order property to enum, making it consistent with the corresponding render option

William Reynish william at reynish.com
Wed Sep 16 21:58:01 CEST 2009


Revision: 23291
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23291
Author:   billrey
Date:     2009-09-16 21:58:01 +0200 (Wed, 16 Sep 2009)

Log Message:
-----------
*Changed image field order property to enum, making it consistent with the corresponding render option
*Tiny edit to image panel.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_image/image_buttons.c
    trunk/blender/source/blender/makesrna/intern/rna_image.c

Modified: trunk/blender/source/blender/editors/space_image/image_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_buttons.c	2009-09-16 19:47:58 UTC (rev 23290)
+++ trunk/blender/source/blender/editors/space_image/image_buttons.c	2009-09-16 19:58:01 UTC (rev 23291)
@@ -1014,13 +1014,31 @@
 				image_info(ima, ibuf, str);
 				uiItemL(layout, str, 0);
 			}
-		
+			
+			if(ima->source != IMA_SRC_GENERATED) {
+				uiItemS(layout);
+
+				split= uiLayoutSplit(layout, 0);
+
+				col= uiLayoutColumn(split, 0);
+				uiItemR(col, NULL, 0, &imaptr, "fields", 0);
+				row= uiLayoutRow(col, 0);
+				uiItemR(row, NULL, 0, &imaptr, "field_order", UI_ITEM_R_EXPAND);
+				uiLayoutSetActive(row, RNA_boolean_get(&imaptr, "fields"));
+
+				col= uiLayoutColumn(split, 0);
+				uiItemR(col, NULL, 0, &imaptr, "antialias", 0);
+				uiItemR(col, NULL, 0, &imaptr, "premultiply", 0);
+			}
+
 			if(ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
+				uiItemS(layout);
+				
 				split= uiLayoutSplit(layout, 0);
 
 				col= uiLayoutColumn(split, 0);
 				 
-				sprintf(str, "(%d) Frames:", iuser->framenr);
+				sprintf(str, "(%d) Frames", iuser->framenr);
 				row= uiLayoutRow(col, 1);
 				uiItemR(col, str, 0, userptr, "frames", 0);
 				if(ima->anim) {
@@ -1048,23 +1066,8 @@
 				uiItemR(col, NULL, 0, &imaptr, "generated_type", UI_ITEM_R_EXPAND);
 			}
 
-			if(ima->source != IMA_SRC_GENERATED) {
-				uiItemS(layout);
+					}
 
-				split= uiLayoutSplit(layout, 0);
-
-				col= uiLayoutColumn(split, 0);
-				uiItemR(col, NULL, 0, &imaptr, "fields", 0);
-				row= uiLayoutRow(col, 0);
-				uiItemR(row, "Odd", 0, &imaptr, "odd_fields", 0);
-				uiLayoutSetActive(row, RNA_boolean_get(&imaptr, "fields"));
-
-				col= uiLayoutColumn(split, 0);
-				uiItemR(col, NULL, 0, &imaptr, "antialias", 0);
-				uiItemR(col, NULL, 0, &imaptr, "premultiply", 0);
-			}
-		}
-
 		uiBlockSetNFunc(block, NULL, NULL, NULL);
 	}
 

Modified: trunk/blender/source/blender/makesrna/intern/rna_image.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_image.c	2009-09-16 19:47:58 UTC (rev 23290)
+++ trunk/blender/source/blender/makesrna/intern/rna_image.c	2009-09-16 19:58:01 UTC (rev 23291)
@@ -217,6 +217,10 @@
 		{0, "UV", 0, "UV Coordinates", "Use UV coordinates for mapping the image"},
 		{IMA_REFLECT, "REFLECTION", 0, "Reflection", "Use reflection mapping for mapping the image"},
 		{0, NULL, 0, NULL, NULL}};
+	static const EnumPropertyItem prop_field_order_items[]= {
+		{0, "EVEN", 0, "Even", "Even Fields first"},
+		{IMA_STD_FIELD, "Odd", 0, "Odd", "Odd Fields first"},
+		{0, NULL, 0, NULL, NULL}};
 
 	srna= RNA_def_struct(brna, "Image", "ID");
 	RNA_def_struct_ui_text(srna, "Image", "Image datablock referencing an external or packed image.");
@@ -242,18 +246,19 @@
 	prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "packedfile");
 	RNA_def_property_ui_text(prop, "Packed File", "");
-
+	
+	prop= RNA_def_property(srna, "field_order", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+	RNA_def_property_enum_items(prop, prop_field_order_items);
+	RNA_def_property_ui_text(prop, "Field Order", "Order of video fields. Select which lines are displayed first.");
+	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL);
+	
 	/* booleans */
 	prop= RNA_def_property(srna, "fields", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_FIELDS);
 	RNA_def_property_ui_text(prop, "Fields", "Use fields of the image.");
 	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_fields_update");
 
-	prop= RNA_def_property(srna, "odd_fields", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_STD_FIELD);
-	RNA_def_property_ui_text(prop, "Odd Fields", "Standard field toggle.");
-	RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update");
-
 	prop= RNA_def_property(srna, "antialias", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANTIALI);
 	RNA_def_property_ui_text(prop, "Anti-alias", "Toggles image anti-aliasing, only works with solid colors");





More information about the Bf-blender-cvs mailing list