diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-09-21 10:38:30 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-09-21 11:55:04 +0300 |
commit | fa2c1698b077f510175e79adf3dbf3e1602b1030 (patch) | |
tree | 7b15540db52813ae7de54eceeda7e78cce25b724 /source/blender/makesrna/intern | |
parent | 26f9b1ef49772d568560f8ac1d8d2d15bb77849f (diff) |
VSE: Image transform tools
Add tools for image manipulation in sequencer preview region.
This includes:
- Translate, rotate and resize operators, tools and gizmos
- Origin for image transformation
- Median point and individual origins pivot modes
- Select and Box select operator works in preview
- Image overlay drawing
ref T90156
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D12105
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 14 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 5 |
3 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index badaaa14aa4..1762b964f8d 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -3525,6 +3525,16 @@ static void rna_def_sequencer_tool_settings(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; + static const EnumPropertyItem pivot_points[] = { + {V3D_AROUND_CENTER_MEDIAN, "MEDIAN", ICON_PIVOT_MEDIAN, "Median Point", ""}, + {V3D_AROUND_LOCAL_ORIGINS, + "INDIVIDUAL_ORIGINS", + ICON_PIVOT_INDIVIDUAL, + "Individual Origins", + "Pivot around each selected island's own median point"}, + {0, NULL, 0, NULL, NULL}, + + }; srna = RNA_def_struct(brna, "SequencerToolSettings", NULL); RNA_def_struct_path_func(srna, "rna_SequencerToolSettings_path"); RNA_def_struct_ui_text(srna, "Sequencer Tool Settings", ""); @@ -3568,6 +3578,10 @@ static void rna_def_sequencer_tool_settings(BlenderRNA *brna) prop = RNA_def_property(srna, "overlap_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, scale_overlap_modes); RNA_def_property_ui_text(prop, "Overlap Mode", "How to resolve overlap after transformation"); + + prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, pivot_points); + RNA_def_property_ui_text(prop, "Pivot Point", "Rotation or scaling pivot point"); } static void rna_def_unified_paint_settings(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index cd87e4d10c1..b713ffb68b4 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -1442,6 +1442,12 @@ static void rna_def_strip_transform(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Rotation", "Rotate around image center"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update"); + prop = RNA_def_property(srna, "origin", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "origin"); + RNA_def_property_ui_text(prop, "Origin", "Origin of image for transformation"); + RNA_def_property_ui_range(prop, 0, 1, 1, 3); + RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_SequenceTransform_update"); + RNA_def_struct_path_func(srna, "rna_SequenceTransform_path"); } diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 8c331bd1911..70fe2dbc75a 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -5371,6 +5371,11 @@ static void rna_def_space_sequencer_preview_overlay(BlenderRNA *brna) 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); + + prop = RNA_def_property(srna, "show_image_outline", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_PREVIEW_SHOW_OUTLINE_SELECTED); + RNA_def_property_ui_text(prop, "Image Outline", ""); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); } static void rna_def_space_sequencer_timeline_overlay(BlenderRNA *brna) |