diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 208 |
1 files changed, 129 insertions, 79 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index e3985b26eb0..8c331bd1911 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2326,6 +2326,16 @@ static void rna_Sequencer_view_type_update(Main *UNUSED(bmain), ED_area_tag_refresh(area); } +static char *rna_SpaceSequencerPreviewOverlay_path(PointerRNA *UNUSED(ptr)) +{ + return BLI_strdup("preview_overlay"); +} + +static char *rna_SpaceSequencerTimelineOverlay_path(PointerRNA *UNUSED(ptr)) +{ + return BLI_strdup("timeline_overlay"); +} + /* Space Node Editor */ static void rna_SpaceNodeEditor_node_tree_set(PointerRNA *ptr, @@ -5329,6 +5339,108 @@ static void rna_def_space_image(BlenderRNA *brna) rna_def_space_mask_info(srna, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mask_set"); } +static void rna_def_space_sequencer_preview_overlay(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna = RNA_def_struct(brna, "SequencerPreviewOverlay", NULL); + RNA_def_struct_sdna(srna, "SequencerPreviewOverlay"); + RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor"); + RNA_def_struct_path_func(srna, "rna_SpaceSequencerPreviewOverlay_path"); + RNA_def_struct_ui_text(srna, "Preview Overlay Settings", ""); + + prop = RNA_def_property(srna, "show_safe_areas", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_PREVIEW_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_PREVIEW_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_metadata", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_PREVIEW_SHOW_METADATA); + RNA_def_property_ui_text(prop, "Show Metadata", "Show metadata of first visible strip"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + + prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_PREVIEW_SHOW_GPENCIL); + RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); +} + +static void rna_def_space_sequencer_timeline_overlay(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna = RNA_def_struct(brna, "SequencerTimelineOverlay", NULL); + RNA_def_struct_sdna(srna, "SequencerTimelineOverlay"); + RNA_def_struct_nested(brna, srna, "SpaceSequenceEditor"); + RNA_def_struct_path_func(srna, "rna_SpaceSequencerTimelineOverlay_path"); + RNA_def_struct_ui_text(srna, "Timeline Overlay Settings", ""); + + static const EnumPropertyItem waveform_type_display_items[] = { + {SEQ_TIMELINE_NO_WAVEFORMS, + "NO_WAVEFORMS", + 0, + "Waveforms Off", + "Don't display waveforms for any sound strips"}, + {SEQ_TIMELINE_ALL_WAVEFORMS, + "ALL_WAVEFORMS", + 0, + "Waveforms On", + "Display waveforms for all sound strips"}, + {0, + "DEFAULT_WAVEFORMS", + 0, + "Use Strip Option", + "Display waveforms depending on strip setting"}, + {0, NULL, 0, NULL, NULL}, + }; + + prop = RNA_def_property(srna, "waveform_display_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, waveform_type_display_items); + RNA_def_property_ui_text(prop, "Waveform Display", "How Waveforms are displayed"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + + prop = RNA_def_property(srna, "show_fcurves", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_TIMELINE_SHOW_FCURVES); + RNA_def_property_ui_text(prop, "Show F-Curves", "Display strip opacity/volume curve"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + + prop = RNA_def_property(srna, "show_strip_name", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_TIMELINE_SHOW_STRIP_NAME); + RNA_def_property_ui_text(prop, "Show Name", ""); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + + prop = RNA_def_property(srna, "show_strip_source", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_TIMELINE_SHOW_STRIP_SOURCE); + RNA_def_property_ui_text( + prop, "Show Source", "Display path to source file, or name of source datablock"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + + prop = RNA_def_property(srna, "show_strip_duration", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_TIMELINE_SHOW_STRIP_DURATION); + RNA_def_property_ui_text(prop, "Show Duration", ""); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + + prop = RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_TIMELINE_SHOW_GRID); + RNA_def_property_ui_text(prop, "Show Grid", "Show vertical grid lines"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + + prop = RNA_def_property(srna, "show_strip_offset", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_TIMELINE_SHOW_STRIP_OFFSETS); + RNA_def_property_ui_text(prop, "Show Offsets", "Display strip in/out offsets"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); +} + static void rna_def_space_sequencer(BlenderRNA *brna) { StructRNA *srna; @@ -5369,25 +5481,6 @@ static void rna_def_space_sequencer(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; - static const EnumPropertyItem waveform_type_display_items[] = { - {SEQ_NO_WAVEFORMS, - "NO_WAVEFORMS", - 0, - "Waveforms Off", - "Don't display waveforms for any sound strips"}, - {SEQ_ALL_WAVEFORMS, - "ALL_WAVEFORMS", - 0, - "Waveforms On", - "Display waveforms for all sound strips"}, - {0, - "DEFAULT_WAVEFORMS", - 0, - "Use Strip Option", - "Display waveforms depending on strip setting"}, - {0, NULL, 0, NULL, NULL}, - }; - srna = RNA_def_struct(brna, "SpaceSequenceEditor", "Space"); RNA_def_struct_sdna(srna, "SpaceSeq"); RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data"); @@ -5428,23 +5521,6 @@ 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_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_metadata", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_METADATA); - RNA_def_property_ui_text(prop, "Show Metadata", "Show metadata of first visible strip"); - 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"); @@ -5458,11 +5534,6 @@ static void rna_def_space_sequencer(BlenderRNA *brna) "If any exists, show markers in a separate row at the bottom of the editor"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_GPENCIL); - RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - prop = RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "chanshown"); RNA_def_property_ui_text( @@ -5478,12 +5549,6 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Display Channels", "Channels of the preview to display"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, "rna_SequenceEditor_update_cache"); - prop = RNA_def_property(srna, "waveform_display_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); - RNA_def_property_enum_items(prop, waveform_type_display_items); - RNA_def_property_ui_text(prop, "Waveform Display", "How Waveforms are displayed"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - prop = RNA_def_property(srna, "use_zoom_to_fit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_ZOOM_TO_FIT); RNA_def_property_ui_text( @@ -5533,46 +5598,31 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Use Backdrop", "Display result under strips"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - prop = RNA_def_property(srna, "show_strip_offset", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "draw_flag", SEQ_DRAW_OFFSET_EXT); - RNA_def_property_ui_text(prop, "Show Offsets", "Display strip in/out offsets"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - - prop = RNA_def_property(srna, "show_fcurves", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_FCURVES); - RNA_def_property_ui_text(prop, "Show F-Curves", "Display strip opacity/volume curve"); + prop = RNA_def_property(srna, "show_transform_preview", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "draw_flag", SEQ_DRAW_TRANSFORM_PREVIEW); + RNA_def_property_ui_text(prop, "Transform Preview", "Show preview of the transformed frames"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + /* Overlay settings. */ prop = RNA_def_property(srna, "show_strip_overlay", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_STRIP_OVERLAY); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_OVERLAY); RNA_def_property_ui_text(prop, "Show Overlay", ""); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - prop = RNA_def_property(srna, "show_strip_name", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_STRIP_NAME); - RNA_def_property_ui_text(prop, "Show Name", ""); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - - prop = RNA_def_property(srna, "show_strip_source", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_STRIP_SOURCE); - RNA_def_property_ui_text( - prop, "Show Source", "Display path to source file, or name of source datablock"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - - prop = RNA_def_property(srna, "show_strip_duration", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_STRIP_DURATION); - RNA_def_property_ui_text(prop, "Show Duration", ""); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + prop = RNA_def_property(srna, "preview_overlay", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "SequencerPreviewOverlay"); + RNA_def_property_pointer_sdna(prop, NULL, "preview_overlay"); + RNA_def_property_ui_text(prop, "Preview Overlay Settings", "Settings for display of overlays"); - prop = RNA_def_property(srna, "show_transform_preview", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "draw_flag", SEQ_DRAW_TRANSFORM_PREVIEW); - RNA_def_property_ui_text(prop, "Transform Preview", "Show preview of the transformed frames"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + prop = RNA_def_property(srna, "timeline_overlay", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_struct_type(prop, "SequencerTimelineOverlay"); + RNA_def_property_pointer_sdna(prop, NULL, "timeline_overlay"); + RNA_def_property_ui_text(prop, "Timeline Overlay Settings", "Settings for display of overlays"); - prop = RNA_def_property(srna, "show_grid", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_GRID); - RNA_def_property_ui_text(prop, "Show Grid", "Show vertical grid lines"); - RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + rna_def_space_sequencer_preview_overlay(brna); + rna_def_space_sequencer_timeline_overlay(brna); } static void rna_def_space_text(BlenderRNA *brna) |