diff options
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/CMakeLists.txt | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/SConscript | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_image.c | 88 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_render.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 2 |
5 files changed, 97 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index c5f62439b9e..5d736f9c011 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -293,13 +293,14 @@ blender_include_dirs( ../../../../intern/audaspace/intern ../../../../intern/cycles/blender ../../../../intern/guardedalloc + ../../../../intern/glew-mx ../../../../intern/atomic ../../../../intern/memutil ../../../../intern/smoke/extern ) blender_include_dirs_sys( - ${GLEW_INCLUDE_PATH} + "${GLEW_INCLUDE_PATH}" ) add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC}) @@ -328,4 +329,6 @@ set(SRC rna_mesh_utils.h ) +add_definitions(${GL_DEFINITIONS}) + blender_add_lib(bf_rna "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 9fda79feb74..d1eab5ca9db 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -53,11 +53,12 @@ makesrna_tool = env.Clone() rna = env.Clone() makesrna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesrna/\\"" ') -defs = [] +defs = env['BF_GL_DEFINITIONS'] incs = [ '#/intern/guardedalloc', - '#/extern/glew/include', + env['BF_GLEW_INC'], + '#/intern/glew-mx', '#/intern/audaspace/intern', '#/intern/cycles/blender', '#/intern/smoke/extern', @@ -66,6 +67,7 @@ incs = [ '../../blenlib', '../../bmesh', '../../editors/include', + '../../gpu', '../../ikplugin', '../../imbuf', '../../makesdna', diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 90c9cd108cd..141de511a09 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -399,6 +399,43 @@ static int rna_Image_is_float_get(PointerRNA *ptr) return is_float; } +static void rna_Image_render_slots_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + Image *image = (Image *)ptr->id.data; + rna_iterator_array_begin(iter, (void *)image->render_slots, sizeof(RenderSlot), IMA_MAX_RENDER_SLOT, 0, NULL); +} + +static PointerRNA rna_render_slots_active_get(PointerRNA *ptr) +{ + Image *image = (Image *)ptr->id.data; + RenderSlot *render_slot = &image->render_slots[image->render_slot]; + + return rna_pointer_inherit_refine(ptr, &RNA_RenderSlot, render_slot); +} + +static void rna_render_slots_active_set(PointerRNA *ptr, PointerRNA value) +{ + Image *image = (Image *)ptr->id.data; + if (value.id.data == image) { + RenderSlot *render_slot = (RenderSlot *)value.data; + int index = render_slot - image->render_slots; + image->render_slot = CLAMPIS(index, 0, IMA_MAX_RENDER_SLOT - 1); + } +} + +static int rna_render_slots_active_index_get(PointerRNA *ptr) +{ + Image *image = (Image *)ptr->id.data; + return image->render_slot; +} + +static void rna_render_slots_active_index_set(PointerRNA *ptr, int value) +{ + Image *image = (Image *)ptr->id.data; + image->render_slot = value; + CLAMP(image->render_slot, 0, IMA_MAX_RENDER_SLOT - 1); +} + #else static void rna_def_imageuser(BlenderRNA *brna) @@ -467,6 +504,45 @@ static void rna_def_imageuser(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Pass", "Pass in multilayer image"); } +static void rna_def_render_slot(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + srna = RNA_def_struct(brna, "RenderSlot", NULL); + RNA_def_struct_ui_text(srna, "Render Slot", "Parameters defining the render slot"); + + prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "name"); + RNA_def_property_ui_text(prop, "Name", "Render slot name"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); +} + +static void rna_def_render_slots(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna = RNA_def_struct(brna, "RenderSlots", NULL); + RNA_def_struct_sdna(srna, "RenderSlot"); + RNA_def_struct_ui_text(srna, "Render Slots", "Collection of the render slots"); + + prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "RenderSlot"); + RNA_def_property_pointer_funcs(prop, "rna_render_slots_active_get", "rna_render_slots_active_set", NULL, NULL); + RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); + RNA_def_property_ui_text(prop, "Active", "Active render slot of the image"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); + + prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE); + RNA_def_property_int_funcs(prop, "rna_render_slots_active_index_get", + "rna_render_slots_active_index_set", + NULL); + RNA_def_property_range(prop, 0, IMA_MAX_RENDER_SLOT); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Active Index", "Index of an active render slot of the image"); + RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); +} + static void rna_def_image(BlenderRNA *brna) { StructRNA *srna; @@ -668,10 +744,12 @@ static void rna_def_image(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Bindcode", "OpenGL bindcode"); RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); - prop = RNA_def_property(srna, "render_slot", PROP_INT, PROP_UNSIGNED); - RNA_def_property_range(prop, 0, IMA_MAX_RENDER_SLOT - 1); - RNA_def_property_ui_text(prop, "Render Slot", "The current render slot displayed, only for viewer type images"); - RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); + prop = RNA_def_property(srna, "render_slots", PROP_COLLECTION, PROP_NONE); + RNA_def_property_struct_type(prop, "RenderSlot"); + RNA_def_property_ui_text(prop, "Render Slots", "Render slots of the image"); + RNA_def_property_collection_funcs(prop, "rna_Image_render_slots_begin", "rna_iterator_array_next", + "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); + RNA_def_property_srna(prop, "RenderSlots"); /* * Image.has_data and Image.depth are temporary, @@ -737,6 +815,8 @@ static void rna_def_image(BlenderRNA *brna) void RNA_def_image(BlenderRNA *brna) { + rna_def_render_slot(brna); + rna_def_render_slots(brna); rna_def_image(brna); rna_def_imageuser(brna); } diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index b1f997a5f80..0ee654d4ecc 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -587,6 +587,10 @@ static void rna_def_render_engine(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_PREVIEW); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); + prop = RNA_def_property(srna, "bl_use_texture_preview", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_TEXTURE_PREVIEW); + RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); + prop = RNA_def_property(srna, "bl_use_postprocess", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", RE_USE_POSTPROCESS); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 7fdc9ba1e79..b4968333d3f 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -4388,7 +4388,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) prop = RNA_def_property(srna, "use_auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOSAVE); RNA_def_property_ui_text(prop, "Auto Save Temporary Files", - "Automatic saving of temporary files in temp directory, uses process ID"); + "Automatic saving of temporary files in temp directory, uses process ID (Sculpt or edit mode data won't be saved!')"); RNA_def_property_update(prop, 0, "rna_userdef_autosave_update"); prop = RNA_def_property(srna, "auto_save_time", PROP_INT, PROP_NONE); |