Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_sequencer.c
| Show First 20 Lines • Show All 743 Lines • ▼ Show 20 Lines | static IDProperty *rna_Sequence_idprops(PointerRNA *ptr, bool create) | ||||
| if (create && !seq->prop) { | if (create && !seq->prop) { | ||||
| IDPropertyTemplate val = {0}; | IDPropertyTemplate val = {0}; | ||||
| seq->prop = IDP_New(IDP_GROUP, &val, "Sequence ID properties"); | seq->prop = IDP_New(IDP_GROUP, &val, "Sequence ID properties"); | ||||
| } | } | ||||
| return seq->prop; | return seq->prop; | ||||
| } | } | ||||
| static bool rna_MovieSequence_reload_if_needed(ID *scene_id, Sequence *seq, Main *bmain) | |||||
| { | |||||
| Scene *scene = (Scene *)scene_id; | |||||
| bool has_reloaded; | |||||
| bool can_produce_frames; | |||||
| BKE_sequence_movie_reload_if_needed(bmain, scene, seq, &has_reloaded, &can_produce_frames); | |||||
| if (has_reloaded && can_produce_frames) { | |||||
| BKE_sequence_calc(scene, seq); | |||||
| BKE_sequence_invalidate_cache_raw(scene, seq); | |||||
sybren: Sometimes moviestrips without proper video file have an empty `anims` ListBase, sometimes they… | |||||
Not Done Inline ActionsIt could be, and it could be part of BKE_sequence_is_valid_check() to give visual indication in timeline ISS: It could be, and it could be part of `BKE_sequence_is_valid_check()` to give visual indication… | |||||
| DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS); | |||||
| WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | |||||
| } | |||||
| return can_produce_frames; | |||||
| } | |||||
| static PointerRNA rna_MovieSequence_metadata_get(Sequence *seq) | static PointerRNA rna_MovieSequence_metadata_get(Sequence *seq) | ||||
| { | { | ||||
| if (seq == NULL || seq->anims.first == NULL) { | if (seq == NULL || seq->anims.first == NULL) { | ||||
| return PointerRNA_NULL; | return PointerRNA_NULL; | ||||
| } | } | ||||
| StripAnim *sanim = seq->anims.first; | StripAnim *sanim = seq->anims.first; | ||||
| if (sanim->anim == NULL) { | if (sanim->anim == NULL) { | ||||
| ▲ Show 20 Lines • Show All 1,620 Lines • ▼ Show 20 Lines | static void rna_def_movie(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); | prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); | ||||
| RNA_def_property_ui_text(prop, "File", ""); | RNA_def_property_ui_text(prop, "File", ""); | ||||
| RNA_def_property_string_funcs(prop, | RNA_def_property_string_funcs(prop, | ||||
| "rna_Sequence_filepath_get", | "rna_Sequence_filepath_get", | ||||
| "rna_Sequence_filepath_length", | "rna_Sequence_filepath_length", | ||||
| "rna_Sequence_filepath_set"); | "rna_Sequence_filepath_set"); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_filepath_update"); | RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_filepath_update"); | ||||
| func = RNA_def_function(srna, "reload_if_needed", "rna_MovieSequence_reload_if_needed"); | |||||
| RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); | |||||
| /* return type */ | |||||
| parm = RNA_def_boolean( | |||||
| func, "can_produce_frames", 0, "True if the strip can produce frames, False otherwise", ""); | |||||
Not Done Inline ActionsDescription should be last string, second to last is for label (which is completely unused in case of function parameters). mont29: Description should be last string, second to last is for label (which is completely unused in… | |||||
| RNA_def_function_return(func, parm); | |||||
| /* metadata */ | /* metadata */ | ||||
| func = RNA_def_function(srna, "metadata", "rna_MovieSequence_metadata_get"); | func = RNA_def_function(srna, "metadata", "rna_MovieSequence_metadata_get"); | ||||
| RNA_def_function_ui_description(func, "Retrieve metadata of the movie file"); | RNA_def_function_ui_description(func, "Retrieve metadata of the movie file"); | ||||
| /* return type */ | /* return type */ | ||||
| parm = RNA_def_pointer( | parm = RNA_def_pointer( | ||||
| func, "metadata", "IDPropertyWrapPtr", "", "Dict-like object containing the metadata"); | func, "metadata", "IDPropertyWrapPtr", "", "Dict-like object containing the metadata"); | ||||
| RNA_def_parameter_flags(parm, 0, PARM_RNAPTR); | RNA_def_parameter_flags(parm, 0, PARM_RNAPTR); | ||||
| RNA_def_function_return(func, parm); | RNA_def_function_return(func, parm); | ||||
| ▲ Show 20 Lines • Show All 840 Lines • Show Last 20 Lines | |||||
Sometimes moviestrips without proper video file have an empty anims ListBase, sometimes they do have an anim in there with IMB_anim_can_produce_frames() returning false. Maybe this functionality here should be moved into a function like BKE_sequence_movie_can_produce_frames()?