diff options
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_area.cc')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_area.cc | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_area.cc b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_area.cc index d3605cd87e5..538b9e9682d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_area.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_face_area.cc @@ -47,25 +47,20 @@ static VArray<float> construct_face_area_gvarray(const MeshComponent &component, VArray<float>::ForFunc(mesh->totpoly, area_fn), ATTR_DOMAIN_FACE, domain); } -class FaceAreaFieldInput final : public fn::FieldInput { +class FaceAreaFieldInput final : public GeometryFieldInput { public: - FaceAreaFieldInput() : fn::FieldInput(CPPType::get<float>(), "Face Area Field") + FaceAreaFieldInput() : GeometryFieldInput(CPPType::get<float>(), "Face Area Field") { category_ = Category::Generated; } - GVArray get_varray_for_context(const fn::FieldContext &context, - IndexMask UNUSED(mask), - ResourceScope &UNUSED(scope)) const final + GVArray get_varray_for_context(const GeometryComponent &component, + const AttributeDomain domain, + IndexMask UNUSED(mask)) const final { - if (const GeometryComponentFieldContext *geometry_context = - dynamic_cast<const GeometryComponentFieldContext *>(&context)) { - const GeometryComponent &component = geometry_context->geometry_component(); - const AttributeDomain domain = geometry_context->domain(); - if (component.type() == GEO_COMPONENT_TYPE_MESH) { - const MeshComponent &mesh_component = static_cast<const MeshComponent &>(component); - return construct_face_area_gvarray(mesh_component, domain); - } + if (component.type() == GEO_COMPONENT_TYPE_MESH) { + const MeshComponent &mesh_component = static_cast<const MeshComponent &>(component); + return construct_face_area_gvarray(mesh_component, domain); } return {}; } |