diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-01-19 08:30:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-19 08:47:57 +0300 |
commit | 09c83d6fea0fc55b54900329c1b81d992d814b9e (patch) | |
tree | bacfcef098e078ee6afb0ce8fc7e417a3ccade00 /source/blender/makesrna | |
parent | 9f54a73b3283177d478110977c907955ef86e77a (diff) |
Viewport: Add adjustable safe areas, 3d-view & VSE
Also adds safe-area presets.
D325 by Diego Gangl with own edits.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_camera.c | 11 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 57 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 13 |
4 files changed, 75 insertions, 7 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 6167164a7ac..34c2e5a3f25 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -203,6 +203,7 @@ extern StructRNA RNA_DataTransferModifier; extern StructRNA RNA_DecimateModifier; extern StructRNA RNA_DelaySensor; extern StructRNA RNA_DisplaceModifier; +extern StructRNA RNA_DisplaySafeAreas; extern StructRNA RNA_DistortedNoiseTexture; extern StructRNA RNA_DomainFluidSettings; extern StructRNA RNA_DopeSheet; diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 9f119b33889..5704004b4b6 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -258,9 +258,14 @@ void RNA_def_camera(BlenderRNA *brna) "Show a darkened overlay outside the image area in Camera view"); RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); - prop = RNA_def_property(srna, "show_title_safe", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWTITLESAFE); - RNA_def_property_ui_text(prop, "Show Safe Areas", "Show TV title safe and action safe zones in Camera view"); + prop = RNA_def_property(srna, "show_safe_areas", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOW_SAFE_MARGINS); + RNA_def_property_ui_text(prop, "Show Safe Areas", "Show TV title safe and action safe areas in Camera view"); + RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); + + prop = RNA_def_property(srna, "show_safe_center", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOW_SAFE_CENTER); + RNA_def_property_ui_text(prop, "Show Center-cut safe areas", "Show safe areas to fit content in a different aspect ratio"); RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); prop = RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index d9587b8d983..57d50958e2c 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -5390,6 +5390,55 @@ static void rna_def_selected_uv_element(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Face Index", ""); } +static void rna_def_display_safe_areas(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static float default_title[2] = {0.035f, 0.035f}; + static float default_action[2] = {0.1f, 0.05f}; + + static float default_title_center[2] = {0.175f, 0.05f}; + static float default_action_center[2] = {0.15f, 0.05f}; + + srna = RNA_def_struct(brna, "DisplaySafeAreas", NULL); + RNA_def_struct_ui_text(srna, "Safe Areas", "Safe Areas used in 3D view and the VSE"); + RNA_def_struct_sdna(srna, "DisplaySafeAreas"); + + /* SAFE AREAS */ + prop = RNA_def_property(srna, "title", PROP_FLOAT, PROP_XYZ); + RNA_def_property_float_sdna(prop, NULL, "title"); + RNA_def_property_array(prop, 2); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_float_array_default(prop, default_title); + RNA_def_property_ui_text(prop, "Title Safe margins", "Safe area for text and graphics"); + RNA_def_property_update(prop, NC_SCENE | ND_DRAW_RENDER_VIEWPORT, NULL); + + prop = RNA_def_property(srna, "action", PROP_FLOAT, PROP_XYZ); + RNA_def_property_float_sdna(prop, NULL, "action"); + RNA_def_property_array(prop, 2); + RNA_def_property_float_array_default(prop, default_action); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Action Safe Margins", "Safe area for general elements"); + RNA_def_property_update(prop, NC_SCENE | ND_DRAW_RENDER_VIEWPORT, NULL); + + + prop = RNA_def_property(srna, "title_center", PROP_FLOAT, PROP_XYZ); + RNA_def_property_float_sdna(prop, NULL, "title_center"); + RNA_def_property_array(prop, 2); + RNA_def_property_float_array_default(prop, default_title_center); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Center Title Safe Margins", "Safe area for text and graphics in a different aspect ratio"); + RNA_def_property_update(prop, NC_SCENE | ND_DRAW_RENDER_VIEWPORT, NULL); + + prop = RNA_def_property(srna, "action_center", PROP_FLOAT, PROP_XYZ); + RNA_def_property_float_sdna(prop, NULL, "action_center"); + RNA_def_property_array(prop, 2); + RNA_def_property_float_array_default(prop, default_action_center); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Center Action Safe Margins", "Safe area for general elements in a different aspect ratio"); + RNA_def_property_update(prop, NC_SCENE | ND_DRAW_RENDER_VIEWPORT, NULL); +} void RNA_def_scene(BlenderRNA *brna) @@ -5685,6 +5734,13 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_struct_type(prop, "RenderSettings"); RNA_def_property_ui_text(prop, "Render Data", ""); + /* Safe Areas */ + prop = RNA_def_property(srna, "safe_areas", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "safe_areas"); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "DisplaySafeAreas"); + RNA_def_property_ui_text(prop, "Safe Areas", ""); + /* Markers */ prop = RNA_def_property(srna, "timeline_markers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "markers", NULL); @@ -5799,6 +5855,7 @@ void RNA_def_scene(BlenderRNA *brna) rna_def_scene_game_data(brna); rna_def_transform_orientation(brna); rna_def_selected_uv_element(brna); + rna_def_display_safe_areas(brna); RNA_define_animate_sdna(true); /* *** Animated *** */ rna_def_scene_render_data(brna); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index d1d39d65913..58476c43b73 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2570,11 +2570,16 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Separate Colors", "Separate color channels in preview"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - prop = RNA_def_property(srna, "show_safe_margin", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS); - RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview"); + prop = RNA_def_property(srna, "show_safe_areas", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_SAFE_MARGINS); + RNA_def_property_ui_text(prop, "Safe Areas", "Show TV title safe and action safe areas in preview"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - + + prop = RNA_def_property(srna, "show_safe_center", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_SAFE_CENTER); + RNA_def_property_ui_text(prop, "Center-Cut Safe Areas", "Show safe areas to fit content in a different aspect ratio"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + prop = RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES); RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames"); |