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>2021-10-26 16:32:01 +0300
committerJacques Lucke <jacques@blender.org>2021-10-26 16:32:01 +0300
commitfd477e738dfd65f7bb0f06c1d91c3259ed26295d (patch)
treed3caadbd97f7b3be9e453047c0c1b3cd4590afad /source/blender/functions
parentb8b9023d8cd7e0be93f83533c37f50931a2a7c56 (diff)
Geometry Nodes: remove reference to anonymous attributes in tooltips
This changes socket inspection for fields according to T91881. Differential Revision: https://developer.blender.org/D13006
Diffstat (limited to 'source/blender/functions')
-rw-r--r--source/blender/functions/FN_field.hh16
-rw-r--r--source/blender/functions/intern/field.cc1
2 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/functions/FN_field.hh b/source/blender/functions/FN_field.hh
index ed5064fdf25..5e0302130af 100644
--- a/source/blender/functions/FN_field.hh
+++ b/source/blender/functions/FN_field.hh
@@ -227,9 +227,19 @@ class FieldContext;
* A #FieldNode that represents an input to the entire field-tree.
*/
class FieldInput : public FieldNode {
+ public:
+ /* The order is also used for sorting in socket inspection. */
+ enum class Category {
+ NamedAttribute = 0,
+ Generated = 1,
+ AnonymousAttribute = 2,
+ Unknown,
+ };
+
protected:
const CPPType *type_;
std::string debug_name_;
+ Category category_ = Category::Unknown;
public:
FieldInput(const CPPType &type, std::string debug_name = "");
@@ -245,6 +255,7 @@ class FieldInput : public FieldNode {
virtual std::string socket_inspection_name() const;
blender::StringRef debug_name() const;
const CPPType &cpp_type() const;
+ Category category() const;
const CPPType &output_cpp_type(int output_index) const override;
void foreach_field_input(FunctionRef<void(const FieldInput &)> foreach_fn) const override;
@@ -527,6 +538,11 @@ inline const CPPType &FieldInput::cpp_type() const
return *type_;
}
+inline FieldInput::Category FieldInput::category() const
+{
+ return category_;
+}
+
inline const CPPType &FieldInput::output_cpp_type(int output_index) const
{
BLI_assert(output_index == 0);
diff --git a/source/blender/functions/intern/field.cc b/source/blender/functions/intern/field.cc
index 5c13db9ec17..4de5e71c910 100644
--- a/source/blender/functions/intern/field.cc
+++ b/source/blender/functions/intern/field.cc
@@ -523,6 +523,7 @@ const GVArray *FieldContext::get_varray_for_input(const FieldInput &field_input,
IndexFieldInput::IndexFieldInput() : FieldInput(CPPType::get<int>(), "Index")
{
+ category_ = Category::Generated;
}
GVArray *IndexFieldInput::get_index_varray(IndexMask mask, ResourceScope &scope)