From 2613bfadb26532335c5b78552c6250b903335d52 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 12 Feb 2015 02:36:33 +1100 Subject: RNA: sequencer channel range was incorrect Broke since 2.4x, zero sequence channels shouldn't be allowed --- source/blender/makesrna/intern/rna_sequencer.c | 2 +- source/blender/makesrna/intern/rna_sequencer_api.c | 28 +++++++++++----------- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index f628112a19a..927e77960d7 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -1496,7 +1496,7 @@ static void rna_def_sequence(BlenderRNA *brna) prop = RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "machine"); - RNA_def_property_range(prop, 0, MAXSEQ - 1); + RNA_def_property_range(prop, 1, MAXSEQ); RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip"); RNA_def_property_int_funcs(prop, NULL, "rna_Sequence_channel_set", NULL); /* overlap test */ RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c index 3d358b412c8..351a15c0171 100644 --- a/source/blender/makesrna/intern/rna_sequencer_api.c +++ b/source/blender/makesrna/intern/rna_sequencer_api.c @@ -485,8 +485,8 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to add"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); - parm = RNA_def_int(func, "channel", 0, 0, MAXSEQ - 1, "Channel", - "The channel for the new sequence", 0, MAXSEQ - 1); + parm = RNA_def_int(func, "channel", 0, 1, MAXSEQ, "Channel", + "The channel for the new sequence", 1, MAXSEQ); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_int(func, "frame_start", 0, -MAXFRAME, MAXFRAME, "", "The start frame for the new sequence", -MAXFRAME, MAXFRAME); @@ -502,8 +502,8 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_pointer(func, "mask", "Mask", "", "Mask to add"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); - parm = RNA_def_int(func, "channel", 0, 0, MAXSEQ - 1, "Channel", - "The channel for the new sequence", 0, MAXSEQ - 1); + parm = RNA_def_int(func, "channel", 0, 1, MAXSEQ, "Channel", + "The channel for the new sequence", 1, MAXSEQ); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_int(func, "frame_start", 0, -MAXFRAME, MAXFRAME, "", "The start frame for the new sequence", -MAXFRAME, MAXFRAME); @@ -519,8 +519,8 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to add"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); - parm = RNA_def_int(func, "channel", 0, 0, MAXSEQ - 1, "Channel", - "The channel for the new sequence", 0, MAXSEQ - 1); + parm = RNA_def_int(func, "channel", 0, 1, MAXSEQ, "Channel", + "The channel for the new sequence", 1, MAXSEQ); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_int(func, "frame_start", 0, -MAXFRAME, MAXFRAME, "", "The start frame for the new sequence", -MAXFRAME, MAXFRAME); @@ -536,8 +536,8 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_string(func, "filepath", "File", 0, "", "Filepath to image"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm = RNA_def_int(func, "channel", 0, 0, MAXSEQ - 1, "Channel", - "The channel for the new sequence", 0, MAXSEQ - 1); + parm = RNA_def_int(func, "channel", 0, 1, MAXSEQ, "Channel", + "The channel for the new sequence", 1, MAXSEQ); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_int(func, "frame_start", 0, -MAXFRAME, MAXFRAME, "", "The start frame for the new sequence", -MAXFRAME, MAXFRAME); @@ -553,8 +553,8 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_string(func, "filepath", "File", 0, "", "Filepath to movie"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm = RNA_def_int(func, "channel", 0, 0, MAXSEQ - 1, "Channel", - "The channel for the new sequence", 0, MAXSEQ - 1); + parm = RNA_def_int(func, "channel", 0, 1, MAXSEQ, "Channel", + "The channel for the new sequence", 1, MAXSEQ); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_int(func, "frame_start", 0, -MAXFRAME, MAXFRAME, "", "The start frame for the new sequence", -MAXFRAME, MAXFRAME); @@ -570,8 +570,8 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_string(func, "filepath", "File", 0, "", "Filepath to movie"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm = RNA_def_int(func, "channel", 0, 0, MAXSEQ - 1, "Channel", - "The channel for the new sequence", 0, MAXSEQ - 1); + parm = RNA_def_int(func, "channel", 0, 1, MAXSEQ, "Channel", + "The channel for the new sequence", 1, MAXSEQ); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_int(func, "frame_start", 0, -MAXFRAME, MAXFRAME, "", "The start frame for the new sequence", -MAXFRAME, MAXFRAME); @@ -588,8 +588,8 @@ void RNA_api_sequences(BlenderRNA *brna, PropertyRNA *cprop) parm = RNA_def_enum(func, "type", seq_effect_items, 0, "Type", "type for the new sequence"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm = RNA_def_int(func, "channel", 0, 0, MAXSEQ - 1, "Channel", - "The channel for the new sequence", 0, MAXSEQ - 1); + parm = RNA_def_int(func, "channel", 0, 1, MAXSEQ, "Channel", + "The channel for the new sequence", 1, MAXSEQ); /* don't use MAXFRAME since it makes importer scripts fail */ RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_int(func, "frame_start", 0, INT_MIN, INT_MAX, "", -- cgit v1.2.3