[Bf-blender-cvs] [c13ad410a66] blender-v2.83-release: Fix T74603: Tweaking offsets causes strips to "reverse"

Richard Antalik noreply at git.blender.org
Mon Apr 27 00:05:32 CEST 2020


Commit: c13ad410a66eb2ab7f2976fca8322f726eef6203
Author: Richard Antalik
Date:   Mon Apr 27 00:04:23 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rBc13ad410a66eb2ab7f2976fca8322f726eef6203

Fix T74603: Tweaking offsets causes strips to "reverse"

Add range function to RNA properties.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7285

===================================================================

M	source/blender/makesrna/intern/rna_sequencer.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index d3eae4562ec..d218084fc66 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -388,6 +388,40 @@ static void rna_Sequence_anim_endofs_final_set(PointerRNA *ptr, int value)
   do_sequence_frame_change_update(scene, seq);
 }
 
+static void rna_Sequence_anim_endofs_final_range(
+    PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
+{
+  Sequence *seq = (Sequence *)ptr->data;
+
+  *min = 0;
+  *max = seq->len + seq->anim_endofs - seq->startofs - seq->endofs - 1;
+}
+
+static void rna_Sequence_anim_startofs_final_range(
+    PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
+{
+  Sequence *seq = (Sequence *)ptr->data;
+
+  *min = 0;
+  *max = seq->len + seq->anim_startofs - seq->startofs - seq->endofs - 1;
+}
+
+static void rna_Sequence_frame_offset_start_range(
+    PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
+{
+  Sequence *seq = (Sequence *)ptr->data;
+  *min = ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD) ? 0 : INT_MIN;
+  *max = seq->len - seq->endofs - 1;
+}
+
+static void rna_Sequence_frame_offset_end_range(
+    PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
+{
+  Sequence *seq = (Sequence *)ptr->data;
+  *min = ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD) ? 0 : INT_MIN;
+  *max = seq->len - seq->startofs - 1;
+}
+
 static void rna_Sequence_frame_length_set(PointerRNA *ptr, int value)
 {
   Sequence *seq = (Sequence *)ptr->data;
@@ -432,14 +466,6 @@ static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
   BKE_sequence_invalidate_cache_composite(scene, seq);
 }
 
-static void rna_Sequence_frame_offset_range(
-    PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
-{
-  Sequence *seq = (Sequence *)ptr->data;
-  *min = ELEM(seq->type, SEQ_TYPE_SOUND_RAM, SEQ_TYPE_SOUND_HD) ? 0 : INT_MIN;
-  *max = INT_MAX;
-}
-
 static void rna_Sequence_use_proxy_set(PointerRNA *ptr, bool value)
 {
   Sequence *seq = (Sequence *)ptr->data;
@@ -1733,7 +1759,7 @@ static void rna_def_sequence(BlenderRNA *brna)
   //  RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
   RNA_def_property_ui_text(prop, "Start Offset", "");
   RNA_def_property_int_funcs(
-      prop, NULL, "rna_Sequence_frame_offset_start_set", "rna_Sequence_frame_offset_range");
+      prop, NULL, "rna_Sequence_frame_offset_start_set", "rna_Sequence_frame_offset_start_range");
   RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
 
   prop = RNA_def_property(srna, "frame_offset_end", PROP_INT, PROP_TIME);
@@ -1741,7 +1767,7 @@ static void rna_def_sequence(BlenderRNA *brna)
   //  RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
   RNA_def_property_ui_text(prop, "End Offset", "");
   RNA_def_property_int_funcs(
-      prop, NULL, "rna_Sequence_frame_offset_end_set", "rna_Sequence_frame_offset_range");
+      prop, NULL, "rna_Sequence_frame_offset_end_set", "rna_Sequence_frame_offset_end_range");
   RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_frame_change_update");
 
   prop = RNA_def_property(srna, "frame_still_start", PROP_INT, PROP_TIME);
@@ -2122,8 +2148,10 @@ static void rna_def_input(StructRNA *srna)
   prop = RNA_def_property(srna, "animation_offset_start", PROP_INT, PROP_UNSIGNED);
   RNA_def_property_int_sdna(prop, NULL, "anim_startofs");
   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-  RNA_def_property_int_funcs(
-      prop, NULL, "rna_Sequence_anim_startofs_final_set", NULL); /* overlap tests */
+  RNA_def_property_int_funcs(prop,
+                             NULL,
+                             "rna_Sequence_anim_startofs_final_set",
+                             "rna_Sequence_anim_startofs_final_range"); /* overlap tests */
   RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start)");
   RNA_def_property_update(
       prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");
@@ -2131,8 +2159,10 @@ static void rna_def_input(StructRNA *srna)
   prop = RNA_def_property(srna, "animation_offset_end", PROP_INT, PROP_UNSIGNED);
   RNA_def_property_int_sdna(prop, NULL, "anim_endofs");
   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-  RNA_def_property_int_funcs(
-      prop, NULL, "rna_Sequence_anim_endofs_final_set", NULL); /* overlap tests */
+  RNA_def_property_int_funcs(prop,
+                             NULL,
+                             "rna_Sequence_anim_endofs_final_set",
+                             "rna_Sequence_anim_endofs_final_range"); /* overlap tests */
   RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end)");
   RNA_def_property_update(
       prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_preprocessed_update");



More information about the Bf-blender-cvs mailing list