*Changed image field order property to enum, making it consistent with the correspond...
authorWilliam Reynish <william@reynish.com>
Wed, 16 Sep 2009 19:58:01 +0000 (19:58 +0000)
committerWilliam Reynish <william@reynish.com>
Wed, 16 Sep 2009 19:58:01 +0000 (19:58 +0000)
*Tiny edit to image panel.

source/blender/editors/space_image/image_buttons.c
source/blender/makesrna/intern/rna_image.c

index f3607ed727612f4d123f61d681a2193023de5594..78687958c602912b1a2f7a029c60f710f4fb6839 100644 (file)
@@ -1014,13 +1014,31 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
                                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,22 +1066,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
                                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);
        }
index ad96eaa99ad505c814ef6257483d4d39c62c1a2c..8614e6f4ef36c6cf13a50ec31bd13f9a269b3ba9 100644 (file)
@@ -217,6 +217,10 @@ static void rna_def_image(BlenderRNA *brna)
                {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 @@ static void rna_def_image(BlenderRNA *brna)
        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");