Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_sequencer/sequencer_add.c
| Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type) | ||||
| Sequence *tgt = NULL; | Sequence *tgt = NULL; | ||||
| Sequence *seq; | Sequence *seq; | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| Editing *ed = BKE_sequencer_editing_get(scene, true); | Editing *ed = BKE_sequencer_editing_get(scene, true); | ||||
| int cfra = (int)CFRA; | int cfra = (int)CFRA; | ||||
| int proximity = INT_MAX; | int proximity = INT_MAX; | ||||
| if (!ed || !ed->seqbasep) { | if (!ed || !ed->seqbasep) { | ||||
| return 1; | return 2; | ||||
| } | } | ||||
| for (seq = ed->seqbasep->first; seq; seq = seq->next) { | for (seq = ed->seqbasep->first; seq; seq = seq->next) { | ||||
| if ((type == -1 || seq->type == type) && (seq->enddisp < cfra) && | if ((type == -1 || seq->type == type) && (seq->enddisp < cfra) && | ||||
| (cfra - seq->enddisp < proximity)) { | (cfra - seq->enddisp < proximity)) { | ||||
| tgt = seq; | tgt = seq; | ||||
| proximity = cfra - seq->enddisp; | proximity = cfra - seq->enddisp; | ||||
| } | } | ||||
| } | } | ||||
| if (tgt) { | if (tgt) { | ||||
| return tgt->machine; | return tgt->machine + 1; | ||||
| } | } | ||||
| return 1; | return 2; | ||||
| } | } | ||||
| static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, int flag, int type) | static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, int flag, int type) | ||||
ISS: Maybe I should add check if the `channel` property is set here.
That will at least restore it's… | |||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| int cfra = (int)CFRA; | int cfra = (int)CFRA; | ||||
| /* effect strips don't need a channel initialized from the mouse */ | /* effect strips don't need a channel initialized from the mouse */ | ||||
| if (!(flag & SEQPROP_NOCHAN)) { | if (!(flag & SEQPROP_NOCHAN) && RNA_struct_property_is_set(op->ptr, "frame_end") == 0) { | ||||
brechtUnsubmitted Not Done Inline Actionsframe_end should be channel? brecht: `frame_end` should be `channel`? | |||||
| RNA_int_set(op->ptr, "channel", sequencer_generic_invoke_xy_guess_channel(C, type)); | RNA_int_set(op->ptr, "channel", sequencer_generic_invoke_xy_guess_channel(C, type)); | ||||
| } | } | ||||
| RNA_int_set(op->ptr, "frame_start", cfra); | RNA_int_set(op->ptr, "frame_start", cfra); | ||||
| if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end") == 0) { | if ((flag & SEQPROP_ENDFRAME) && RNA_struct_property_is_set(op->ptr, "frame_end") == 0) { | ||||
| RNA_int_set(op->ptr, "frame_end", cfra + 25); // XXX arbitrary but ok for now. | RNA_int_set(op->ptr, "frame_end", cfra + 25); // XXX arbitrary but ok for now. | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,006 Lines • Show Last 20 Lines | |||||
Maybe I should add check if the channel property is set here.
That will at least restore it's function