VSE: Don't draw unused properties in redo panel
Property `delete_data` was drawn in redo panel, when retiming key is deleted, but this property is useful only when deleting strips.
This commit is contained in:
@@ -1675,7 +1675,7 @@ static int sequencer_delete_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
if (sequencer_retiming_mode_is_active(C)) {
|
||||
if (RNA_boolean_get(op->ptr, "use_retiming_mode")) {
|
||||
sequencer_retiming_key_remove_exec(C, op);
|
||||
}
|
||||
|
||||
@@ -1711,9 +1711,26 @@ static int sequencer_delete_invoke(bContext *C, wmOperator *op, const wmEvent *e
|
||||
}
|
||||
}
|
||||
|
||||
if (sequencer_retiming_mode_is_active(C)) {
|
||||
RNA_boolean_set(op->ptr, "use_retiming_mode", true);
|
||||
}
|
||||
|
||||
return sequencer_delete_exec(C, op);
|
||||
}
|
||||
|
||||
static bool sequencer_delete_poll_property(const bContext * /* C */,
|
||||
wmOperator *op,
|
||||
const PropertyRNA *prop)
|
||||
{
|
||||
const char *prop_id = RNA_property_identifier(prop);
|
||||
|
||||
if (STREQ(prop_id, "delete_data") && RNA_boolean_get(op->ptr, "use_retiming_mode")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void SEQUENCER_OT_delete(wmOperatorType *ot)
|
||||
{
|
||||
|
||||
@@ -1726,6 +1743,7 @@ void SEQUENCER_OT_delete(wmOperatorType *ot)
|
||||
ot->invoke = sequencer_delete_invoke;
|
||||
ot->exec = sequencer_delete_exec;
|
||||
ot->poll = sequencer_edit_poll;
|
||||
ot->poll_property = sequencer_delete_poll_property;
|
||||
|
||||
/* Flags. */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
@@ -1737,6 +1755,13 @@ void SEQUENCER_OT_delete(wmOperatorType *ot)
|
||||
"Delete Data",
|
||||
"After removing the Strip, delete the associated data also");
|
||||
RNA_def_property_flag(ot->prop, PROP_SKIP_SAVE);
|
||||
|
||||
ot->prop = RNA_def_boolean(ot->srna,
|
||||
"use_retiming_mode",
|
||||
false,
|
||||
"Use Retiming Data",
|
||||
"Operate on retiming data instead of strips");
|
||||
RNA_def_property_flag(ot->prop, PROP_HIDDEN);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
Reference in New Issue
Block a user