|
Blender V4.3
|
#include <FN_field.hh>
Inherits blender::NonMovable, and blender::NonCopyable.
Public Member Functions | |
| FieldEvaluator (const FieldContext &context, const IndexMask *mask) | |
| FieldEvaluator (const FieldContext &context, const int64_t size) | |
| ~FieldEvaluator () | |
| void | set_selection (Field< bool > selection) |
| template<typename T > | |
| int | add_with_destination (Field< T > field, VMutableArray< T > dst) |
| template<typename T > | |
| int | add_with_destination (Field< T > field, MutableSpan< T > dst) |
| template<typename T > | |
| int | add (Field< T > field, VArray< T > *varray_ptr) |
| const GVArray & | get_evaluated (const int field_index) const |
| template<typename T > | |
| VArray< T > | get_evaluated (const int field_index) |
#FieldEvaluator | |
| int | add_with_destination (GField field, GVMutableArray dst) |
| int | add_with_destination (GField field, GMutableSpan dst) |
| int | add (GField field, GVArray *varray_ptr) |
| int | add (GField field) |
| void | evaluate () |
| IndexMask | get_evaluated_selection_as_mask () const |
| IndexMask | get_evaluated_as_mask (int field_index) |
Utility class that makes it easier to evaluate fields.
Definition at line 338 of file FN_field.hh.
|
inline |
Takes #mask by pointer because the mask has to live longer than the evaluator.
Definition at line 360 of file FN_field.hh.
|
inline |
Construct a field evaluator for all indices less than #size.
Definition at line 366 of file FN_field.hh.
|
inline |
Definition at line 371 of file FN_field.hh.
References BLI_assert.
|
inline |
| field | Field to add to the evaluator. |
| varray_ptr | Once evaluate is called, the resulting virtual array will be will be assigned to the given position. |
Definition at line 429 of file FN_field.hh.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), and blender::Vector< T, InlineBufferCapacity, Allocator >::append_and_get_index().
Definition at line 767 of file field.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append().
Definition at line 756 of file field.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append().
Referenced by blender::nodes::node_geo_uv_pack_islands_cc::construct_uv_gvarray(), blender::nodes::node_geo_uv_unwrap_cc::construct_uv_gvarray(), blender::nodes::node_geo_points_to_curves_cc::curves_from_points(), blender::nodes::node_geo_split_to_instances_cc::do_common_split(), blender::nodes::node_geo_curve_fill_cc::do_group_aware_cdt(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_edges(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_mesh(), blender::nodes::node_geo_points_to_vertices_cc::geometry_set_points_to_vertices(), blender::nodes::node_geo_merge_layers_cc::get_layers_map_by_id(), blender::nodes::node_geo_merge_layers_cc::get_layers_map_by_name(), blender::bke::EvaluateAtIndexInput::get_varray_for_context(), blender::nodes::node_geo_accumulate_field_cc::AccumulateFieldInput::get_varray_for_context(), blender::nodes::node_geo_accumulate_field_cc::TotalFieldInput::get_varray_for_context(), blender::nodes::node_geo_blur_attribute_cc::BlurAttributeFieldInput::get_varray_for_context(), blender::nodes::node_geo_curve_endpoint_selection_cc::EndpointFieldInput::get_varray_for_context(), blender::nodes::node_geo_curve_topology_points_of_curve_cc::PointsOfCurveInput::get_varray_for_context(), blender::nodes::node_geo_edge_paths_to_selection_cc::PathToEdgeSelectionFieldInput::get_varray_for_context(), blender::nodes::node_geo_edges_to_face_groups_cc::FaceSetFromBoundariesInput::get_varray_for_context(), blender::nodes::node_geo_index_of_nearest_cc::HasNeighborFieldInput::get_varray_for_context(), blender::nodes::node_geo_index_of_nearest_cc::IndexOfNearestFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_curve_handles_cc::HandlePositionFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_face_is_planar_cc::PlanarFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_shortest_edge_paths_cc::ShortestEdgePathsCostFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_shortest_edge_paths_cc::ShortestEdgePathsNextVertFieldInput::get_varray_for_context(), blender::nodes::node_geo_mesh_face_group_boundaries_cc::BoundaryFieldInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_edge_cc::CornersOfEdgeInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_face_cc::CornersOfFaceInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_vertex_cc::CornersOfVertInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_edges_of_vertex_cc::EdgesOfVertInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_offset_corner_in_face_cc::OffsetCornerInFaceFieldInput::get_varray_for_context(), blender::nodes::node_geo_offset_point_in_curve_cc::ControlPointNeighborFieldInput::get_varray_for_context(), blender::nodes::node_geo_offset_point_in_curve_cc::OffsetValidFieldInput::get_varray_for_context(), blender::nodes::node_geo_proximity_cc::ProximityFunction::init_for_mesh(), blender::nodes::node_geo_merge_by_distance_cc::mesh_merge_by_distance_all(), blender::nodes::node_geo_attribute_statistic_cc::node_geo_exec(), blender::nodes::node_geo_edge_paths_to_curves_cc::node_geo_exec(), blender::nodes::node_geo_flip_faces_cc::node_geo_exec(), blender::nodes::node_geo_mesh_to_curve_cc::node_geo_exec(), blender::nodes::node_geo_realize_instances_cc::node_geo_exec(), blender::nodes::node_geo_sample_index_cc::node_geo_exec(), blender::nodes::node_geo_triangulate_cc::node_geo_exec(), blender::nodes::node_geo_sample_nearest_surface_cc::SampleNearestSurfaceFunction::SampleNearestSurfaceFunction(), blender::geometry::separate_mesh_selection(), and blender::nodes::node_geo_sort_elements_cc::sorted_indices().
|
inline |
| field | Field to add to the evaluator. |
| dst | Mutable span that the evaluated result for this field is be written into. |
Definition at line 416 of file FN_field.hh.
References add_with_destination().
|
inline |
Same as add_with_destination but typed.
Definition at line 397 of file FN_field.hh.
References add_with_destination().
| int blender::fn::FieldEvaluator::add_with_destination | ( | GField | field, |
| GMutableSpan | dst ) |
| field | Field to add to the evaluator. |
| dst | Mutable span that the evaluated result for this field is be written into. |
Definition at line 751 of file field.cc.
References add_with_destination(), and blender::GVMutableArray::ForSpan().
| int blender::fn::FieldEvaluator::add_with_destination | ( | GField | field, |
| GVMutableArray | dst ) |
| field | Field to add to the evaluator. |
| dst | Mutable virtual array that the evaluated result for this field is be written into. |
Definition at line 743 of file field.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append().
Referenced by add_with_destination(), add_with_destination(), add_with_destination(), blender::bke::curves_normals_point_domain_calc(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_vertices(), blender::bke::EvaluateOnDomainInput::get_varray_for_context(), blender::nodes::node_geo_blur_attribute_cc::BlurAttributeFieldInput::get_varray_for_context(), blender::nodes::node_geo_merge_by_distance_cc::mesh_merge_by_distance_connected(), blender::nodes::node_geo_points_cc::node_geo_exec(), blender::nodes::node_geo_volume_cube_cc::node_geo_exec(), blender::nodes::node_geo_set_position_cc::set_instances_position(), blender::fn::tests::TEST(), blender::fn::tests::TEST(), blender::fn::tests::TEST(), blender::fn::tests::TEST(), blender::fn::tests::TEST(), and blender::fn::tests::TEST().
| void blender::fn::FieldEvaluator::evaluate | ( | ) |
Evaluate all fields on the evaluator. This can only be called once.
Definition at line 788 of file field.cc.
References BLI_assert, BLI_assert_msg, blender::fn::evaluate_fields(), and blender::fn::evaluate_selection().
Referenced by blender::nodes::node_geo_points_to_curves_cc::curves_from_points(), blender::bke::curves_normals_point_domain_calc(), blender::nodes::node_geo_split_to_instances_cc::do_common_split(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::nodes::node_geo_blur_attribute_cc::BlurAttributeFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_curve_handles_cc::HandlePositionFieldInput::get_varray_for_context(), blender::nodes::node_geo_flip_faces_cc::node_geo_exec(), blender::nodes::node_geo_realize_instances_cc::node_geo_exec(), blender::nodes::node_geo_sample_index_cc::node_geo_exec(), blender::nodes::node_geo_volume_cube_cc::node_geo_exec(), blender::geometry::separate_grease_pencil_layer_selection(), blender::geometry::separate_mesh_selection(), blender::nodes::node_geo_set_position_cc::set_instances_position(), and blender::nodes::node_geo_sort_elements_cc::sorted_indices().
|
inline |
Definition at line 456 of file FN_field.hh.
References get_evaluated(), and blender::GVArray::typed().
Definition at line 450 of file FN_field.hh.
References BLI_assert.
Referenced by blender::nodes::node_geo_points_to_curves_cc::curves_from_points(), blender::nodes::node_geo_split_to_instances_cc::do_common_split(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), get_evaluated(), get_evaluated_as_mask(), blender::nodes::node_geo_blur_attribute_cc::BlurAttributeFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_curve_handles_cc::HandlePositionFieldInput::get_varray_for_context(), blender::nodes::node_geo_realize_instances_cc::node_geo_exec(), blender::nodes::node_geo_sample_index_cc::node_geo_exec(), blender::geometry::separate_mesh_selection(), and blender::nodes::node_geo_sort_elements_cc::sorted_indices().
Retrieve the output of an evaluated boolean field and convert it to a mask, which can be used to avoid calculations for unnecessary elements later on. The evaluator will own the indices in some cases, so it must live at least as long as the returned mask.
Definition at line 809 of file field.cc.
References get_evaluated(), blender::VArrayCommon< T >::get_internal_single(), blender::fn::index_mask_from_selection(), blender::VArrayCommon< T >::is_single(), blender::VArrayCommon< T >::size(), and blender::GVArray::typed().
Referenced by blender::nodes::node_geo_flip_faces_cc::node_geo_exec().
| IndexMask blender::fn::FieldEvaluator::get_evaluated_selection_as_mask | ( | ) | const |
Definition at line 822 of file field.cc.
References BLI_assert.
Referenced by blender::nodes::node_geo_split_to_instances_cc::do_common_split(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::nodes::node_geo_realize_instances_cc::node_geo_exec(), blender::geometry::separate_grease_pencil_layer_selection(), blender::nodes::node_geo_set_position_cc::set_instances_position(), and blender::nodes::node_geo_sort_elements_cc::sorted_indices().
|
inline |
The selection field is evaluated first to determine which indices of the other fields should be evaluated. Calling this method multiple times will just replace the previously set selection field. Only the elements selected by both this selection and the selection provided in the constructor are calculated. If no selection field is set, it is assumed that all indices passed to the constructor are selected.
Definition at line 385 of file FN_field.hh.
Referenced by blender::nodes::node_geo_distribute_points_on_faces_cc::calc_full_density_factors_with_selection(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curves_to_grease_pencil_with_one_layer(), blender::geometry::delete_selected_instances(), blender::nodes::node_geo_split_to_instances_cc::do_common_split(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::nodes::node_geo_extrude_mesh_cc::extrude_individual_mesh_faces(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_face_regions(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::nodes::node_geo_edge_split_cc::node_geo_exec(), blender::nodes::node_geo_grease_pencil_to_curves_cc::node_geo_exec(), blender::nodes::node_geo_realize_instances_cc::node_geo_exec(), blender::nodes::node_geo_scale_elements_cc::node_geo_exec(), blender::nodes::node_geo_store_named_attribute_cc::node_geo_exec(), blender::nodes::node_geo_rotate_instances_cc::rotate_instances(), blender::nodes::node_geo_scale_instances_cc::scale_instances(), blender::geometry::separate_grease_pencil_layer_selection(), blender::nodes::node_geo_curve_set_handle_type_cc::set_handle_type(), blender::nodes::node_geo_set_id_cc::set_id_in_component(), blender::nodes::node_geo_set_position_cc::set_instances_position(), blender::nodes::node_geo_set_curve_handles_cc::set_position_in_component(), blender::nodes::node_geo_sort_elements_cc::sorted_indices(), and blender::nodes::node_geo_translate_instances_cc::translate_instances().