Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_sequencer.c
| Show First 20 Lines • Show All 700 Lines • ▼ Show 20 Lines | static void rna_Sequence_update_reopen_files(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| Editing *ed = BKE_sequencer_editing_get(scene, false); | Editing *ed = BKE_sequencer_editing_get(scene, false); | ||||
| BKE_sequencer_free_imbuf(scene, &ed->seqbase, false); | BKE_sequencer_free_imbuf(scene, &ed->seqbase, false); | ||||
| if (RNA_struct_is_a(ptr->type, &RNA_SoundSequence)) | if (RNA_struct_is_a(ptr->type, &RNA_SoundSequence)) | ||||
| BKE_sequencer_update_sound_bounds(scene, ptr->data); | BKE_sequencer_update_sound_bounds(scene, ptr->data); | ||||
| } | } | ||||
| static void rna_Sequence_view_render_override_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) | |||||
| { | |||||
| Sequence *sequence = (Sequence *)ptr->data; | |||||
| Scene *scene = (Scene *)ptr->id.data; | |||||
| if (BLI_strcaseeq(sequence->view_render.engine_id, scene->view_render.engine_id) == false) { | |||||
campbellbarton: No need for case insensitive comparison, `STREQ` macro can be used instead. | |||||
| BKE_sequence_invalidate_cache(scene, sequence); | |||||
| } | |||||
| WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, scene); | |||||
| } | |||||
| static void rna_Sequence_mute_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) | static void rna_Sequence_mute_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| { | { | ||||
| Scene *scene = (Scene *) ptr->id.data; | Scene *scene = (Scene *) ptr->id.data; | ||||
| Editing *ed = BKE_sequencer_editing_get(scene, false); | Editing *ed = BKE_sequencer_editing_get(scene, false); | ||||
| BKE_sequencer_update_muting(ed); | BKE_sequencer_update_muting(ed); | ||||
| rna_Sequence_update(bmain, scene, ptr); | rna_Sequence_update(bmain, scene, ptr); | ||||
| } | } | ||||
| static void rna_Sequence_filepath_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) | static void rna_Sequence_filepath_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) | ||||
Done Inline ActionsWhy not expose sequence.view_render using the ViewRenderSettings type? Then there is no need to duplicate it's logic. This way instead of accessing seq.engine, seq.view_render.engine would be used (from Python). campbellbarton: Why not expose `sequence.view_render` using the `ViewRenderSettings` type?
Then there is no… | |||||
| { | { | ||||
| Scene *scene = (Scene *) ptr->id.data; | Scene *scene = (Scene *) ptr->id.data; | ||||
| Sequence *seq = (Sequence *)(ptr->data); | Sequence *seq = (Sequence *)(ptr->data); | ||||
| BKE_sequence_reload_new_file(scene, seq, true); | BKE_sequence_reload_new_file(scene, seq, true); | ||||
| BKE_sequence_calc(scene, seq); | BKE_sequence_calc(scene, seq); | ||||
| rna_Sequence_update(bmain, scene, ptr); | rna_Sequence_update(bmain, scene, ptr); | ||||
| } | } | ||||
| static void rna_Sequence_sound_update(Main *bmain, Scene *scene, PointerRNA *ptr) | static void rna_Sequence_sound_update(Main *bmain, Scene *scene, PointerRNA *ptr) | ||||
| { | { | ||||
| Sequence *seq = (Sequence *) ptr->data; | Sequence *seq = (Sequence *) ptr->data; | ||||
| if (seq->sound != NULL) { | if (seq->sound != NULL) { | ||||
| BKE_sound_update_scene_sound(seq->scene_sound, seq->sound); | BKE_sound_update_scene_sound(seq->scene_sound, seq->sound); | ||||
| } | } | ||||
| rna_Sequence_update(bmain, scene, ptr); | rna_Sequence_update(bmain, scene, ptr); | ||||
| } | } | ||||
| static int seqproxy_seq_cmp_cb(Sequence *seq, void *arg_pt) | static int seqproxy_seq_cmp_cb(Sequence *seq, void *arg_pt) | ||||
| { | { | ||||
| SequenceSearchData *data = arg_pt; | SequenceSearchData *data = arg_pt; | ||||
| if (seq->strip && seq->strip->proxy == data->data) { | if (seq->strip && seq->strip->proxy == data->data) { | ||||
| data->seq = seq; | data->seq = seq; | ||||
| return -1; /* done so bail out */ | return -1; /* done so bail out */ | ||||
| } | } | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| static Sequence *sequence_get_by_proxy(Editing *ed, StripProxy *proxy) | static Sequence *sequence_get_by_proxy(Editing *ed, StripProxy *proxy) | ||||
| { | { | ||||
| SequenceSearchData data; | SequenceSearchData data; | ||||
| data.seq = NULL; | data.seq = NULL; | ||||
| data.data = proxy; | data.data = proxy; | ||||
| BKE_sequencer_base_recursive_apply(&ed->seqbase, seqproxy_seq_cmp_cb, &data); | BKE_sequencer_base_recursive_apply(&ed->seqbase, seqproxy_seq_cmp_cb, &data); | ||||
Done Inline ActionsThis is too much duplication, logic should be shared with rna_ViewRenderSettings_engine_* functions, Check on how enum functions are shared already. campbellbarton: This is too much duplication, logic should be shared with `rna_ViewRenderSettings_engine_*`… | |||||
Not Done Inline ActionsPer our talk in IRC, I just removed this for now and left as a TODO to clear strip cache on ViewRender.engine updates. spockTheGray: Per our talk in IRC, I just removed this for now and left as a TODO to clear strip cache on… | |||||
| return data.seq; | return data.seq; | ||||
| } | } | ||||
| static void rna_Sequence_tcindex_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | static void rna_Sequence_tcindex_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| { | { | ||||
| Scene *scene = (Scene *) ptr->id.data; | Scene *scene = (Scene *) ptr->id.data; | ||||
| Editing *ed = BKE_sequencer_editing_get(scene, false); | Editing *ed = BKE_sequencer_editing_get(scene, false); | ||||
| Sequence *seq = sequence_get_by_proxy(ed, ptr->data); | Sequence *seq = sequence_get_by_proxy(ed, ptr->data); | ||||
| ▲ Show 20 Lines • Show All 687 Lines • ▼ Show 20 Lines | static void rna_def_sequence(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_enum_items(prop, seq_type_items); | RNA_def_property_enum_items(prop, seq_type_items); | ||||
| RNA_def_property_ui_text(prop, "Type", ""); | RNA_def_property_ui_text(prop, "Type", ""); | ||||
| RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SEQUENCE); | RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_SEQUENCE); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); | RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update"); | ||||
| prop = RNA_def_property(srna, "view_render", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_flag(prop, PROP_NEVER_NULL); | |||||
| RNA_def_property_struct_type(prop, "ViewRenderSettings"); | |||||
| RNA_def_property_ui_text(prop, "View Render", ""); | |||||
| /* flags */ | /* flags */ | ||||
| prop = RNA_def_property(srna, "use_view_render_override", PROP_BOOLEAN, PROP_NONE); | |||||
Done Inline Actionssince this is a boolean, should use use_ prefix. eg: use_view_render_override - since view render may contain other settings in the future. campbellbarton: since this is a boolean, should use `use_` prefix. eg: `use_view_render_override` - since view… | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_VIEW_RENDER_OVERRIDE); | |||||
| RNA_def_property_ui_text(prop, "Override View Render Settings", "Override the preview engine used for scene strip"); | |||||
| RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_view_render_override_update"); | |||||
| prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT); | RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT); | ||||
| RNA_def_property_ui_text(prop, "Select", ""); | RNA_def_property_ui_text(prop, "Select", ""); | ||||
| RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER | NA_SELECTED, NULL); | RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER | NA_SELECTED, NULL); | ||||
| prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL); | RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL); | ||||
| RNA_def_property_ui_text(prop, "Left Handle Selected", ""); | RNA_def_property_ui_text(prop, "Left Handle Selected", ""); | ||||
| ▲ Show 20 Lines • Show All 1,283 Lines • Show Last 20 Lines | |||||
No need for case insensitive comparison, STREQ macro can be used instead.