diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2010-07-26 22:37:47 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2010-07-26 22:37:47 +0400 |
commit | 8fb499c34f8dd9bd38c73c88cf2e588aae854606 (patch) | |
tree | d175811bef390cd7f3bc70e08557db955b515263 /source/blender/makesrna | |
parent | 10b124ae39c4cdbff6d6191177c3f77b2bc3d802 (diff) |
* Added a new RNA subtype, PROP_IMAGEPATH. It's the same as PROP_FILEPATH, but for images only.
* Changed UI code to display image browser for PROP_IMAGEPATH
* Set the icon_filepath RNA property for brushes to use PROP_IMAGEPATH
* Changed preview icon drawing to ignore unset icons
* Fixed const warnings in brush RNA
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/RNA_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 16 |
3 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 88058769f4b..06e42c77daf 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -98,6 +98,7 @@ typedef enum PropertySubType { PROP_FILEPATH = 1, PROP_DIRPATH = 2, PROP_FILENAME = 3, + PROP_IMAGEPATH = 4, /* numbers */ PROP_UNSIGNED = 13, diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 35b2eff9c62..42b72ce4341 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1652,6 +1652,7 @@ static const char *rna_property_subtypename(PropertySubType type) case PROP_FILEPATH: return "PROP_FILEPATH"; case PROP_FILENAME: return "PROP_FILENAME"; case PROP_DIRPATH: return "PROP_DIRPATH"; + case PROP_IMAGEPATH: return "PROP_IMAGEPATH"; case PROP_UNSIGNED: return "PROP_UNSIGNED"; case PROP_PERCENTAGE: return "PROP_PERCENTAGE"; case PROP_FACTOR: return "PROP_FACTOR"; diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index e402cd044e6..cd4aff5d187 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -39,7 +39,7 @@ #include "WM_types.h" -static const EnumPropertyItem prop_direction_items[]= { +static EnumPropertyItem prop_direction_items[]= { {0, "ADD", 0, "Add", "Add effect of brush"}, {BRUSH_DIR_IN, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"}, {0, NULL, 0, NULL, NULL}}; @@ -264,30 +264,30 @@ static float rna_Brush_get_alpha(PointerRNA *ptr) static EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, PointerRNA *ptr, int *free) { - static const EnumPropertyItem prop_default_items[]= { + static EnumPropertyItem prop_default_items[]= { {0, NULL, 0, NULL, NULL}}; - static const EnumPropertyItem prop_flatten_contrast_items[]= { + static EnumPropertyItem prop_flatten_contrast_items[]= { {0, "FLATTEN", 0, "Flatten", "Add effect of brush"}, {BRUSH_DIR_IN, "CONTRAST", 0, "Contrast", "Subtract effect of brush"}, {0, NULL, 0, NULL, NULL}}; - static const EnumPropertyItem prop_fill_deepen_items[]= { + static EnumPropertyItem prop_fill_deepen_items[]= { {0, "FILL", 0, "Fill", "Add effect of brush"}, {BRUSH_DIR_IN, "DEEPEN", 0, "Deepen", "Subtract effect of brush"}, {0, NULL, 0, NULL, NULL}}; - static const EnumPropertyItem prop_scrape_peaks_items[]= { + static EnumPropertyItem prop_scrape_peaks_items[]= { {0, "SCRAPE", 0, "Scrape", "Add effect of brush"}, {BRUSH_DIR_IN, "PEAKS", 0, "Peaks", "Subtract effect of brush"}, {0, NULL, 0, NULL, NULL}}; - static const EnumPropertyItem prop_pinch_magnify_items[]= { + static EnumPropertyItem prop_pinch_magnify_items[]= { {0, "PINCH", 0, "Pinch", "Add effect of brush"}, {BRUSH_DIR_IN, "MAGNIFY", 0, "Magnify", "Subtract effect of brush"}, {0, NULL, 0, NULL, NULL}}; - static const EnumPropertyItem prop_inflate_deflate_items[]= { + static EnumPropertyItem prop_inflate_deflate_items[]= { {0, "INFLATE", 0, "Inflate", "Add effect of brush"}, {BRUSH_DIR_IN, "DEFLATE", 0, "Deflate", "Subtract effect of brush"}, {0, NULL, 0, NULL, NULL}}; @@ -770,7 +770,7 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Custom Icon", "Set the brush icon from an image file"); RNA_def_property_update(prop, 0, "rna_Brush_icon_update"); - prop= RNA_def_property(srna, "icon_filepath", PROP_STRING, PROP_FILEPATH); + prop= RNA_def_property(srna, "icon_filepath", PROP_STRING, PROP_IMAGEPATH); RNA_def_property_string_sdna(prop, NULL, "icon_filepath"); RNA_def_property_ui_text(prop, "Brush Icon Filepath", "File path to brush icon"); RNA_def_property_update(prop, 0, "rna_Brush_icon_update"); |