diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-28 16:34:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-28 16:34:22 +0400 |
commit | f28b5e672ed05bb08b317c78a36b31e7c49d4f4e (patch) | |
tree | e326ad5f429f01c63878989d4ca393aa9bc65051 /source/blender/makesrna/intern/rna_render.c | |
parent | 7a7076c878f7f5f5a28653a9a0df76065948ea7a (diff) |
python/utf8 compatibility fixes. (as discussed on the mailing list)
- user input gets non utf8 chars stripped all text input other then file paths.
- python has the same limitations, it will raise an error on non utf8 strings except for paths use unicode escape literals so its possible to deal with saving to these file paths from python.
- new string functions
BLI_utf8_invalid_byte(str, len) returns the first invalid utf8 byte or -1 on on success.
BLI_utf8_invalid_strip(str, len) strips non utf-8 chars.
Diffstat (limited to 'source/blender/makesrna/intern/rna_render.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_render.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index e4a89ed3121..e6b86ae8766 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -291,8 +291,8 @@ static void rna_def_render_engine(BlenderRNA *brna) static void rna_def_render_result(BlenderRNA *brna) { StructRNA *srna; - PropertyRNA *prop; FunctionRNA *func; + PropertyRNA *parm; srna= RNA_def_struct(brna, "RenderResult", NULL); RNA_def_struct_ui_text(srna, "Render Result", "Result of rendering, including all layers and passes"); @@ -300,22 +300,22 @@ static void rna_def_render_result(BlenderRNA *brna) func= RNA_def_function(srna, "load_from_file", "RE_result_load_from_file"); RNA_def_function_ui_description(func, "Copies the pixels of this render result from an image file."); RNA_def_function_flag(func, FUNC_USE_REPORTS); - prop= RNA_def_string(func, "filename", "", 0, "Filename", "Filename to load into this render tile, must be no smaller then the render result"); - RNA_def_property_flag(prop, PROP_REQUIRED); + parm= RNA_def_string_file_name(func, "filename", "", FILE_MAX, "File Name", "Filename to load into this render tile, must be no smaller then the render result"); + RNA_def_property_flag(parm, PROP_REQUIRED); RNA_define_verify_sdna(0); - prop= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "rectx"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); + parm= RNA_def_property(srna, "resolution_x", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(parm, NULL, "rectx"); + RNA_def_property_clear_flag(parm, PROP_EDITABLE); - prop= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "recty"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); + parm= RNA_def_property(srna, "resolution_y", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(parm, NULL, "recty"); + RNA_def_property_clear_flag(parm, PROP_EDITABLE); - prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); - RNA_def_property_struct_type(prop, "RenderLayer"); - RNA_def_property_collection_funcs(prop, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); + parm= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(parm, "RenderLayer"); + RNA_def_property_collection_funcs(parm, "rna_RenderResult_layers_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); RNA_define_verify_sdna(1); } |