Fix: VSE: Silence RNA_boolean_get warning for use_sequence_detection
Caused by #143974. Allow `use_sequence_detection` and `use_placeholders` to be automatically drawn by `sequencer_add_draw_check_fn` when applicable instead of unconditionally adding it to the UI. Ordering of these two can be preserved by swapping the original `RNA_def_boolean` calls. Pull Request: https://projects.blender.org/blender/blender/pulls/145431
This commit is contained in:
committed by
John Kiril Swenson
parent
8188dbd246
commit
4bdcc7643b
@@ -1390,12 +1390,15 @@ static wmOperatorStatus sequencer_add_movie_strip_invoke(bContext *C,
|
||||
return OPERATOR_RUNNING_MODAL;
|
||||
}
|
||||
|
||||
static bool sequencer_add_draw_check_fn(PointerRNA * /*ptr*/,
|
||||
PropertyRNA *prop,
|
||||
void * /*user_data*/)
|
||||
static bool sequencer_add_draw_check_fn(PointerRNA *ptr, PropertyRNA *prop, void * /*user_data*/)
|
||||
{
|
||||
const char *prop_id = RNA_property_identifier(prop);
|
||||
|
||||
/* Only show placeholders option if sequence detection is enabled. */
|
||||
if (STREQ(prop_id, "use_placeholders")) {
|
||||
return RNA_boolean_get(ptr, "use_sequence_detection");
|
||||
}
|
||||
|
||||
return !STR_ELEM(prop_id,
|
||||
"filepath",
|
||||
"directory",
|
||||
@@ -1403,9 +1406,7 @@ static bool sequencer_add_draw_check_fn(PointerRNA * /*ptr*/,
|
||||
"frame_start",
|
||||
"channel",
|
||||
"length",
|
||||
"move_strips",
|
||||
"use_sequence_detection",
|
||||
"use_placeholders");
|
||||
"move_strips");
|
||||
}
|
||||
|
||||
static void sequencer_add_draw(bContext * /*C*/, wmOperator *op)
|
||||
@@ -1425,11 +1426,6 @@ static void sequencer_add_draw(bContext * /*C*/, wmOperator *op)
|
||||
layout->separator();
|
||||
}
|
||||
|
||||
layout->prop(op->ptr, "use_sequence_detection", UI_ITEM_NONE, std::nullopt, ICON_NONE);
|
||||
if (RNA_boolean_get(op->ptr, "use_sequence_detection")) {
|
||||
layout->prop(op->ptr, "use_placeholders", UI_ITEM_NONE, std::nullopt, ICON_NONE);
|
||||
}
|
||||
|
||||
/* Main draw call. */
|
||||
uiDefAutoButsRNA(layout,
|
||||
op->ptr,
|
||||
@@ -1897,18 +1893,18 @@ void SEQUENCER_OT_image_strip_add(wmOperatorType *ot)
|
||||
SEQPROP_STARTFRAME | SEQPROP_LENGTH | SEQPROP_FIT_METHOD |
|
||||
SEQPROP_VIEW_TRANSFORM | SEQPROP_MOVE);
|
||||
|
||||
RNA_def_boolean(ot->srna,
|
||||
"use_placeholders",
|
||||
false,
|
||||
"Use Placeholders",
|
||||
"Reserve placeholder frames for missing frames of the image sequence");
|
||||
|
||||
RNA_def_boolean(
|
||||
ot->srna,
|
||||
"use_sequence_detection",
|
||||
true,
|
||||
"Detect Sequences",
|
||||
"Automatically detect animated sequences in selected images (based on file names)");
|
||||
|
||||
RNA_def_boolean(ot->srna,
|
||||
"use_placeholders",
|
||||
false,
|
||||
"Use Placeholders",
|
||||
"Reserve placeholder frames for missing frames of the image sequence");
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
Reference in New Issue
Block a user