From f26ac206c9acd9f1593cde2dc822c9e344507e97 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Wed, 16 Sep 2009 19:58:01 +0000 Subject: *Changed image field order property to enum, making it consistent with the corresponding render option *Tiny edit to image panel. --- source/blender/editors/space_image/image_buttons.c | 39 ++++++++++++---------- source/blender/makesrna/intern/rna_image.c | 17 ++++++---- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index f3607ed7276..78687958c60 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -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); } diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index ad96eaa99ad..8614e6f4ef3 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -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"); -- cgit v1.2.3