Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-04-21 17:11:26 +0300
committerJacques Lucke <jacques@blender.org>2022-04-21 17:11:26 +0300
commitb9799dfb8a78dddbb3591dcb3e0b4de954c80fee (patch)
tree531a96e1ff7774b07ae1c91a4242c86d7d7f156e /source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc
parentaca083fbf38246437caa6e50a6feeeb23b64ee18 (diff)
Geometry Nodes: better support for byte color attributes
Since {rBeae36be372a6b16ee3e76eff0485a47da4f3c230} the distinction between float and byte colors is more explicit in the ui. So far, geometry nodes couldn't really deal with byte colors in general. This patch fixes that. There is still only one color socket, which contains float colors. Conversion to and from byte colors is done when read from or writing to attributes. * Support writing to byte color attributes in Store Named Attribute node. * Support converting to/from byte color in attribute conversion operator. * Support propagating byte color attributes. * Add all the implicit conversions from byte colors to the other types. * Display byte colors as integers in spreadsheet. Differential Revision: https://developer.blender.org/D14705
Diffstat (limited to 'source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc')
-rw-r--r--source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc
index 6206b2d0c03..7c1ac024c12 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc
@@ -42,7 +42,8 @@ static std::string operation_string(const eSpreadsheetColumnValueType data_type,
if (ELEM(data_type,
SPREADSHEET_VALUE_TYPE_BOOL,
SPREADSHEET_VALUE_TYPE_INSTANCES,
- SPREADSHEET_VALUE_TYPE_COLOR)) {
+ SPREADSHEET_VALUE_TYPE_COLOR,
+ SPREADSHEET_VALUE_TYPE_BYTE_COLOR)) {
return "=";
}
@@ -101,6 +102,14 @@ static std::string value_string(const SpreadsheetRowFilter &row_filter,
}
case SPREADSHEET_VALUE_TYPE_STRING:
return row_filter.value_string;
+ case SPREADSHEET_VALUE_TYPE_BYTE_COLOR: {
+ std::ostringstream result;
+ result.precision(3);
+ result << std::fixed << "(" << (int)row_filter.value_byte_color[0] << ", "
+ << (int)row_filter.value_byte_color[1] << ", " << (int)row_filter.value_byte_color[2]
+ << ", " << (int)row_filter.value_byte_color[3] << ")";
+ return result.str();
+ }
case SPREADSHEET_VALUE_TYPE_UNKNOWN:
return "";
}
@@ -229,6 +238,10 @@ static void spreadsheet_filter_panel_draw(const bContext *C, Panel *panel)
case SPREADSHEET_VALUE_TYPE_STRING:
uiItemR(layout, filter_ptr, "value_string", 0, IFACE_("Value"), ICON_NONE);
break;
+ case SPREADSHEET_VALUE_TYPE_BYTE_COLOR:
+ uiItemR(layout, filter_ptr, "value_byte_color", 0, IFACE_("Value"), ICON_NONE);
+ uiItemR(layout, filter_ptr, "threshold", 0, nullptr, ICON_NONE);
+ break;
case SPREADSHEET_VALUE_TYPE_UNKNOWN:
uiItemL(layout, IFACE_("Unknown column type"), ICON_ERROR);
break;