Fix: wrong field input deduplication with Material Selection node

This commit is contained in:
Jacques Lucke 2021-09-30 12:51:09 +02:00
parent 80d7cac22d
commit 9628ef4135
1 changed files with 6 additions and 3 deletions

View File

@ -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;
}
};