Fix #156015: VSE: Make new duration property writeable

Having it read-only was an intentional choice at the time due to
discussion in #153012.  Changing strip duration and the right handle
position effectively did the same thing from the UI.

But there are some cases where we might want to change duration instead.
Such as when "copying to selected" or if performing logic from a script.
So make the new property writeable too.

Pull Request: https://projects.blender.org/blender/blender/pulls/156115
This commit is contained in:
John Kiril Swenson 2026-03-23 16:15:15 +01:00 • committed by Thomas Dinges
parent 3730d5530c
commit ada6f2bd41

View file

@ -2469,7 +2469,6 @@ static void rna_def_strip(BlenderRNA *brna)
/* strip positioning */
/* Cache has to be invalidated before and after transformation. */
prop = RNA_def_property(srna, "frame_final_duration", PROP_INT, PROP_TIME);
RNA_def_property_range(prop, 1, MAXFRAME);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(
prop, "Length", "The length of the contents of this strip after the handles are applied");
@ -2481,10 +2480,12 @@ static void rna_def_strip(BlenderRNA *brna)
RNA_def_property_deprecated(prop, "Replaced by '.duration'.", 510, 600);
prop = RNA_def_property(srna, "duration", PROP_INT, PROP_TIME);
RNA_def_property_clear_flag(prop, PROP_EDITABLE | PROP_ANIMATABLE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(
prop, "Strip Duration", "Length of the strip in frames from left handle to right handle");
RNA_def_property_int_funcs(prop, "rna_Strip_duration_get", nullptr, nullptr);
RNA_def_property_int_funcs(
prop, "rna_Strip_duration_get", "rna_Strip_duration_set", "rna_Strip_duration_range");
RNA_def_property_editable_func(prop, "rna_Strip_time_editable");
RNA_def_property_update(
prop, NC_SCENE | ND_SEQUENCER, "rna_Strip_invalidate_preprocessed_update");