diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 63 |
1 files changed, 50 insertions, 13 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index a8e8cbcc153..a3cd2d55c0a 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -22,6 +22,11 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file blender/makesrna/intern/rna_scene.c + * \ingroup RNA + */ + + #include <stdlib.h> #include "RNA_define.h" @@ -51,6 +56,7 @@ #include <libavformat/avformat.h> #endif +#include "WM_api.h" #include "WM_types.h" #include "BLI_threads.h" @@ -74,9 +80,9 @@ EnumPropertyItem proportional_falloff_items[] ={ EnumPropertyItem proportional_editing_items[] = { - {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", ""}, - {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", ""}, - {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", ""}, + {PROP_EDIT_OFF, "DISABLED", ICON_PROP_OFF, "Disable", "Proportional Editing disabled"}, + {PROP_EDIT_ON, "ENABLED", ICON_PROP_ON, "Enable", "Proportional Editing enabled"}, + {PROP_EDIT_CONNECTED, "CONNECTED", ICON_PROP_CON, "Connected", "Proportional Editing using connected geometry only"}, {0, NULL, 0, NULL, NULL}}; /* keep for operators, not used here */ @@ -218,7 +224,7 @@ static Base *rna_Scene_object_link(Scene *scene, bContext *C, ReportList *report } base= scene_add_base(scene, ob); - ob->id.us++; + id_us_plus(&ob->id); /* this is similar to what object_add_type and add_object do */ base->lay= scene->lay; @@ -316,6 +322,12 @@ static void rna_Scene_view3d_update(Main *bmain, Scene *unused, PointerRNA *ptr) BKE_screen_view3d_main_sync(&bmain->screen, scene); } +static void rna_Scene_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + rna_Scene_view3d_update(bmain, scene, ptr); + DAG_on_visible_update(bmain, FALSE); +} + static void rna_Scene_framelen_update(Main *bmain, Scene *scene, PointerRNA *ptr) { scene->r.framelen= (float)scene->r.framapto/(float)scene->r.images; @@ -745,6 +757,9 @@ static void rna_RenderSettings_color_management_update(Main *bmain, Scene *unuse bNode *node; if(ntree && scene->use_nodes) { + /* XXX images are freed here, stop render and preview threads, until Image is threadsafe */ + WM_jobs_stop_all(bmain->wm.first); + for (node=ntree->nodes.first; node; node=node->next) { if (ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_IMAGE)) { ED_node_changed_update(&scene->id, node); @@ -899,6 +914,24 @@ static void rna_Scene_simplify_update(Main *bmain, Scene *scene, PointerRNA *ptr rna_Scene_use_simplify_update(bmain, scene, ptr); } +static int rna_Scene_use_audio_get(PointerRNA *ptr) +{ + Scene *scene= (Scene*)ptr->data; + return scene->audio.flag & AUDIO_MUTE; +} + +static void rna_Scene_use_audio_set(PointerRNA *ptr, int value) +{ + Scene *scene= (Scene*)ptr->data; + + if(value) + scene->audio.flag |= AUDIO_MUTE; + else + scene->audio.flag &= ~AUDIO_MUTE; + + sound_mute_scene(scene, value); +} + static int rna_Scene_sync_mode_get(PointerRNA *ptr) { Scene *scene= (Scene*)ptr->data; @@ -1074,7 +1107,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "proportional"); RNA_def_property_enum_items(prop, proportional_editing_items); - RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional editing mode"); + RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional Editing mode, allows transforms with distance fall-off"); RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */ prop= RNA_def_property(srna, "use_proportional_edit_objects", PROP_BOOLEAN, PROP_NONE); @@ -1203,6 +1236,10 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, edge_tag_items); RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path"); + prop= RNA_def_property(srna, "edge_path_live_unwrap", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "edge_mode_live_unwrap", 1); + RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edges seam re-calculates UV unwrap"); + /* etch-a-ton */ prop= RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING); @@ -1942,7 +1979,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem color_mode_items[] ={ - {R_PLANESBW, "BW", 0, "BW", "Images are saved with BW (grayscale) data"}, + {R_PLANESBW, "BW", 0, "BW", "Images get saved in 8 bits grayscale (only PNG, JPEG, TGA, TIF)"}, {R_PLANES24, "RGB", 0, "RGB", "Images are saved with RGB (color) data"}, {R_PLANES32, "RGBA", 0, "RGBA", "Images are saved with RGB and Alpha data (if supported)"}, {0, NULL, 0, NULL, NULL}}; @@ -1951,7 +1988,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {R_OUTPUT_SCREEN, "SCREEN", 0, "Full Screen", "Images are rendered in full Screen"}, {R_OUTPUT_AREA, "AREA", 0, "Image Editor", "Images are rendered in Image Editor"}, {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"}, - {R_OUTPUT_NONE, "NONE", 0, "No Output", "Images are rendered without drawing"}, + {R_OUTPUT_NONE, "NONE", 0, "Keep UI", "Images are rendered without forcing UI changes, optionally showing result"}, {0, NULL, 0, NULL, NULL}}; /* Bake */ @@ -2027,7 +2064,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {1, "CINE_24FPS", 0, "Cinema 24fps 2048x1080", ""}, {2, "CINE_48FPS", 0, "Cinema 48fps 2048x1080", ""}, {3, "CINE_24FPS_4K", 0, "Cinema 24fps 4096x2160", ""}, - {4, "CINE_SCOPE_48FPS", 0, "Cine-Scope 24fps 2048x858", ""}, + {4, "CINE_SCOPE_24FPS", 0, "Cine-Scope 24fps 2048x858", ""}, {5, "CINE_SCOPE_48FPS", 0, "Cine-Scope 48fps 2048x858", ""}, {6, "CINE_FLAT_24FPS", 0, "Cine-Flat 24fps 1998x1080", ""}, {7, "CINE_FLAT_48FPS", 0, "Cine-Flat 48fps 1998x1080", ""}, @@ -2148,7 +2185,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE); RNA_def_property_int_sdna(prop, NULL, "size"); - RNA_def_property_range(prop, 1, INT_MAX); + RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_ui_range(prop, 1, 100, 10, 1); RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); @@ -2233,7 +2270,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "exr_zbuf", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "subimtype", R_OPENEXR_ZBUF); - RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int zbuffer)"); + RNA_def_property_ui_text(prop, "Zbuf", "Save the z-depth per pixel (32 bit unsigned int z-buffer)"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "exr_preview", PROP_BOOLEAN, PROP_NONE); @@ -2971,7 +3008,7 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop) prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL, NULL); - RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_UNLINK); RNA_def_property_ui_text(prop, "Active Object", "Active object for this scene"); /* Could call: ED_base_object_activate(C, scene->basact); * but would be a bad level call and it seems the notifier is enough */ @@ -3170,7 +3207,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_array(prop, 20); RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set"); RNA_def_property_ui_text(prop, "Layers", "Layers visible when rendering the scene"); - RNA_def_property_update(prop, NC_SCENE|ND_LAYER, "rna_Scene_view3d_update"); + RNA_def_property_update(prop, NC_SCENE|ND_LAYER, "rna_Scene_layer_update"); /* Frame Range Stuff */ prop= RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME); @@ -3333,7 +3370,7 @@ void RNA_def_scene(BlenderRNA *brna) /* Audio Settings */ prop= RNA_def_property(srna, "use_audio", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "audio.flag", AUDIO_MUTE); + RNA_def_property_boolean_funcs(prop, "rna_Scene_use_audio_get", "rna_Scene_use_audio_set"); RNA_def_property_ui_text(prop, "Audio Muted", "Play back of audio from Sequence Editor will be muted"); RNA_def_property_update(prop, NC_SCENE, NULL); |