Select Similar: hide 'compare' from UI when not used

When the 'compare' is not used for the resulting selection, just hide
it. This is the case for 'Vertex Groups' atm (where only membership is
taken into account).

Similar to rB9dc9692b0979.

Differential Revision: https://developer.blender.org/D14979
This commit is contained in:
Philipp Oeser 2022-05-18 11:02:53 +02:00
parent 314e5cb889
commit 812a9728f8
Notes: blender-bot 2023-02-14 06:54:28 +01:00
Referenced by issue #98461, Regression: Crash running screenshot from the command-line
1 changed files with 7 additions and 1 deletions

View File

@ -1370,8 +1370,14 @@ static bool edbm_select_similar_poll_property(const bContext *UNUSED(C),
const char *prop_id = RNA_property_identifier(prop);
const int type = RNA_enum_get(op->ptr, "type");
/* Only show compare when it is used. */
if (STREQ(prop_id, "compare")) {
if (type == SIMVERT_VGROUP) {
return false;
}
}
/* Only show threshold when it is used. */
if (STREQ(prop_id, "threshold")) {
else if (STREQ(prop_id, "threshold")) {
if (!ELEM(type,
SIMVERT_NORMAL,
SIMEDGE_BEVEL,