diff options
author | Richard Antalik <richardantalik@gmail.com> | 2020-12-16 22:34:26 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2020-12-16 22:38:28 +0300 |
commit | 571362642201a743168cdf4c827a59c09c40414b (patch) | |
tree | 51993f00ca98efb733e558c881dd0178fb7c0f8f /release/scripts/startup/bl_ui | |
parent | 9d152263837f0ac5e790e0b12d3b3cfed31bed0f (diff) |
VSE: Improve motion-picture workflow
This commit resolves problem introduced in e1665c3d3190 - it was
difficult to import media at their original resolution.
This is done by using original resolution as reference for scale.
All crop and strip transform values and their animation is converted
form old files.
To make both workflows easy to use, sequencer tool settings have been
created with preset for preffered scaling method. This setting is in
sequencer timeline header and add image or movie strip operator
properties.
Two new operators have been added:
`sequencer.strip_transform_fit` operator with 3 options: Scale To Fit,
Scale to Fill and Stretch To Fill.
Operator can fail if strip image or video is not loaded currently, this
case should be either sanitized or data loaded on demand.
`sequencer.strip_transform_clear` operator with 4 options:
Clear position, scale, rotation and all (previous 3 options combined).
Reviewed By: sergey, fsiddi
Differential Revision: https://developer.blender.org/D9582
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/space_sequencer.py | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 84602057e18..e79b5d3e2c8 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -129,6 +129,8 @@ class SEQUENCER_HT_header(Header): layout = self.layout st = context.space_data + scene = context.scene + sequencer_tool_settings = context.tool_settings.sequencer_tool_settings show_region_tool_header = st.show_region_tool_header @@ -139,9 +141,15 @@ class SEQUENCER_HT_header(Header): SEQUENCER_MT_editor_menus.draw_collapsible(context, layout) - layout.separator_spacer() + if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}: + layout.separator_spacer() + row = layout.row(align=True) + row.prop(sequencer_tool_settings, "fit_method", text="") + layout.separator_spacer() if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}: + if st.view_type == 'PREVIEW': + layout.separator_spacer() layout.prop(st, "display_mode", text="", icon_only=True) layout.prop(st, "preview_channels", text="", icon_only=True) @@ -700,6 +708,22 @@ class SEQUENCER_MT_add_effect(Menu): col.enabled = selected_sequences_len(context) != 0 +class SEQUENCER_MT_strip_image_transform(Menu): + bl_label = "Image Transform" + + def draw(self, _context): + layout = self.layout + + layout.operator("sequencer.strip_transform_fit", text="Scale To Fit").fit_method = 'FIT' + layout.operator("sequencer.strip_transform_fit", text="Scale to Fill").fit_method = 'FILL' + layout.operator("sequencer.strip_transform_fit", text="Stretch To Fill").fit_method = 'STRETCH' + layout.separator() + + layout.operator("sequencer.strip_transform_clear", text="Clear Position").property = 'POSITION' + layout.operator("sequencer.strip_transform_clear", text="Clear Scale").property = 'SCALE' + layout.operator("sequencer.strip_transform_clear", text="Clear Rotation").property = 'ROTATION' + layout.operator("sequencer.strip_transform_clear", text="Clear All").property = 'ALL' + class SEQUENCER_MT_strip_transform(Menu): bl_label = "Transform" @@ -794,6 +818,7 @@ class SEQUENCER_MT_strip(Menu): layout.separator() layout.menu("SEQUENCER_MT_strip_transform") + layout.menu("SEQUENCER_MT_strip_image_transform") layout.separator() layout.operator("sequencer.split", text="Split").type = 'SOFT' @@ -2285,6 +2310,7 @@ classes = ( SEQUENCER_MT_strip_effect, SEQUENCER_MT_strip_movie, SEQUENCER_MT_strip, + SEQUENCER_MT_strip_image_transform, SEQUENCER_MT_strip_transform, SEQUENCER_MT_strip_input, SEQUENCER_MT_strip_lock_mute, |