Differential D16893 Diff 58979 source/blender/nodes/geometry/nodes/node_geo_mesh_topology_vertex_of_corner.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_vertex_of_corner.cc
| Show All 13 Lines | b.add_input<decl::Int>(N_("Corner Index")) | ||||
| .implicit_field(implicit_field_inputs::index) | .implicit_field(implicit_field_inputs::index) | ||||
| .description( | .description( | ||||
| N_("The corner to retrieve data from. Defaults to the corner from the context")); | N_("The corner to retrieve data from. Defaults to the corner from the context")); | ||||
| b.add_output<decl::Int>(N_("Vertex Index")) | b.add_output<decl::Int>(N_("Vertex Index")) | ||||
| .dependent_field() | .dependent_field() | ||||
| .description(N_("The vertex the corner is attached to")); | .description(N_("The vertex the corner is attached to")); | ||||
| } | } | ||||
| static int get_loop_vert(const MLoop &loop) | |||||
| { | |||||
| return loop.v; | |||||
| } | |||||
| class CornerVertFieldInput final : public bke::MeshFieldInput { | class CornerVertFieldInput final : public bke::MeshFieldInput { | ||||
| public: | public: | ||||
| CornerVertFieldInput() : bke::MeshFieldInput(CPPType::get<int>(), "Corner Vertex") | CornerVertFieldInput() : bke::MeshFieldInput(CPPType::get<int>(), "Corner Vertex") | ||||
| { | { | ||||
| category_ = Category::Generated; | category_ = Category::Generated; | ||||
| } | } | ||||
| GVArray get_varray_for_context(const Mesh &mesh, | GVArray get_varray_for_context(const Mesh &mesh, | ||||
| const eAttrDomain domain, | const eAttrDomain domain, | ||||
| const IndexMask /*mask*/) const final | const IndexMask /*mask*/) const final | ||||
| { | { | ||||
| if (domain != ATTR_DOMAIN_CORNER) { | if (domain != ATTR_DOMAIN_CORNER) { | ||||
| return {}; | return {}; | ||||
| } | } | ||||
| return VArray<int>::ForDerivedSpan<MLoop, get_loop_vert>(mesh.loops()); | return VArray<int>::ForSpan(mesh.corner_verts()); | ||||
| } | } | ||||
| uint64_t hash() const final | uint64_t hash() const final | ||||
| { | { | ||||
| return 30495867093876; | return 30495867093876; | ||||
| } | } | ||||
| bool is_equal_to(const fn::FieldNode &other) const final | bool is_equal_to(const fn::FieldNode &other) const final | ||||
| Show All 35 Lines | |||||