Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/legacy/node_geo_raycast.cc
| Show First 20 Lines • Show All 244 Lines • ▼ Show 20 Lines | raycast_to_mesh(*src_mesh, | ||||
| hit_distances); | hit_distances); | ||||
| hit_attribute.save(); | hit_attribute.save(); | ||||
| hit_position_attribute.save(); | hit_position_attribute.save(); | ||||
| hit_normal_attribute.save(); | hit_normal_attribute.save(); | ||||
| hit_distance_attribute.save(); | hit_distance_attribute.save(); | ||||
| /* Custom interpolated attributes */ | /* Custom interpolated attributes */ | ||||
| bke::mesh_surface_sample::MeshAttributeInterpolator interp(src_mesh, hit_positions, hit_indices); | bke::mesh_surface_sample::MeshAttributeInterpolator interp( | ||||
| src_mesh, IndexMask(ray_origins.size()), hit_positions, hit_indices); | |||||
| for (const int i : hit_attribute_names.index_range()) { | for (const int i : hit_attribute_names.index_range()) { | ||||
| const std::optional<AttributeMetaData> meta_data = src_mesh_component->attribute_get_meta_data( | const std::optional<AttributeMetaData> meta_data = src_mesh_component->attribute_get_meta_data( | ||||
| hit_attribute_names[i]); | hit_attribute_names[i]); | ||||
| if (meta_data) { | if (meta_data) { | ||||
| ReadAttributeLookup hit_attribute = src_mesh_component->attribute_try_get_for_read( | ReadAttributeLookup hit_attribute = src_mesh_component->attribute_try_get_for_read( | ||||
| hit_attribute_names[i]); | hit_attribute_names[i]); | ||||
| OutputAttribute hit_attribute_output = dst_component.attribute_try_get_for_output_only( | OutputAttribute hit_attribute_output = dst_component.attribute_try_get_for_output_only( | ||||
| hit_attribute_output_names[i], result_domain, meta_data->data_type); | hit_attribute_output_names[i], result_domain, meta_data->data_type); | ||||
| Show All 37 Lines | for (const GeometryComponentType type : types) { | ||||
| } | } | ||||
| } | } | ||||
| params.set_output("Geometry", geometry_set); | params.set_output("Geometry", geometry_set); | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes | ||||
| void register_node_type_geo_raycast() | void register_node_type_geo_legacy_raycast() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| geo_node_type_base(&ntype, GEO_NODE_LEGACY_RAYCAST, "Raycast", NODE_CLASS_GEOMETRY, 0); | geo_node_type_base(&ntype, GEO_NODE_LEGACY_RAYCAST, "Raycast", NODE_CLASS_GEOMETRY, 0); | ||||
| node_type_size_preset(&ntype, NODE_SIZE_LARGE); | node_type_size_preset(&ntype, NODE_SIZE_LARGE); | ||||
| node_type_init(&ntype, blender::nodes::geo_node_raycast_init); | node_type_init(&ntype, blender::nodes::geo_node_raycast_init); | ||||
| node_type_update(&ntype, blender::nodes::geo_node_raycast_update); | node_type_update(&ntype, blender::nodes::geo_node_raycast_update); | ||||
| node_type_storage( | node_type_storage( | ||||
| &ntype, "NodeGeometryRaycast", node_free_standard_storage, node_copy_standard_storage); | &ntype, "NodeGeometryRaycast", node_free_standard_storage, node_copy_standard_storage); | ||||
| ntype.declare = blender::nodes::geo_node_raycast_declare; | ntype.declare = blender::nodes::geo_node_raycast_declare; | ||||
| ntype.geometry_node_execute = blender::nodes::geo_node_raycast_exec; | ntype.geometry_node_execute = blender::nodes::geo_node_raycast_exec; | ||||
| ntype.draw_buttons = blender::nodes::geo_node_raycast_layout; | ntype.draw_buttons = blender::nodes::geo_node_raycast_layout; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||