diff options
author | Jacques Lucke <jacques@blender.org> | 2021-09-30 13:51:09 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-09-30 13:51:09 +0300 |
commit | 9628ef413518e5ddda9c1c8106ce4fecbd1ae7c1 (patch) | |
tree | 7a02c56cdb18ff816fd87199eb568629163afad6 /source | |
parent | 80d7cac22d8726ca33590d644278f91a4b73c303 (diff) |
Fix: wrong field input deduplication with Material Selection node
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_material_selection.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_material_selection.cc b/source/blender/nodes/geometry/nodes/node_geo_material_selection.cc index 337bd88c6e6..9d4533b9bda 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_material_selection.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_material_selection.cc @@ -100,13 +100,16 @@ class MaterialSelectionFieldInput final : public fn::FieldInput { uint64_t hash() const override { - /* Some random constant hash. */ - return 91619626; + return get_default_hash(material_); } bool is_equal_to(const fn::FieldNode &other) const override { - return dynamic_cast<const MaterialSelectionFieldInput *>(&other) != nullptr; + if (const MaterialSelectionFieldInput *other_material_selection = + dynamic_cast<const MaterialSelectionFieldInput *>(&other)) { + return material_ == other_material_selection->material_; + } + return false; } }; |