Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc
| Show All 22 Lines | |||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "BKE_volume.h" | #include "BKE_volume.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| namespace blender::nodes { | namespace blender::nodes::node_geo_points_to_volume_cc { | ||||
| static void geo_node_points_to_volume_declare(NodeDeclarationBuilder &b) | static void geo_node_points_to_volume_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>(N_("Points")); | b.add_input<decl::Geometry>(N_("Points")); | ||||
| b.add_input<decl::Float>(N_("Density")).default_value(1.0f).min(0.0f); | b.add_input<decl::Float>(N_("Density")).default_value(1.0f).min(0.0f); | ||||
| b.add_input<decl::Float>(N_("Voxel Size")).default_value(0.3f).min(0.01f).subtype(PROP_DISTANCE); | b.add_input<decl::Float>(N_("Voxel Size")).default_value(0.3f).min(0.01f).subtype(PROP_DISTANCE); | ||||
| b.add_input<decl::Float>(N_("Voxel Amount")).default_value(64.0f).min(0.0f); | b.add_input<decl::Float>(N_("Voxel Amount")).default_value(64.0f).min(0.0f); | ||||
| b.add_input<decl::Float>(N_("Radius")) | b.add_input<decl::Float>(N_("Radius")) | ||||
| ▲ Show 20 Lines • Show All 207 Lines • ▼ Show 20 Lines | #ifdef WITH_OPENVDB | ||||
| params.set_output("Volume", std::move(geometry_set)); | params.set_output("Volume", std::move(geometry_set)); | ||||
| #else | #else | ||||
| params.error_message_add(NodeWarningType::Error, | params.error_message_add(NodeWarningType::Error, | ||||
| TIP_("Disabled, Blender was compiled without OpenVDB")); | TIP_("Disabled, Blender was compiled without OpenVDB")); | ||||
| params.set_output("Volume", GeometrySet()); | params.set_output("Volume", GeometrySet()); | ||||
| #endif | #endif | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes::node_geo_points_to_volume_cc | ||||
| void register_node_type_geo_points_to_volume() | void register_node_type_geo_points_to_volume() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_geo_points_to_volume_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| geo_node_type_base( | geo_node_type_base( | ||||
| &ntype, GEO_NODE_POINTS_TO_VOLUME, "Points to Volume", NODE_CLASS_GEOMETRY, 0); | &ntype, GEO_NODE_POINTS_TO_VOLUME, "Points to Volume", NODE_CLASS_GEOMETRY, 0); | ||||
| node_type_storage(&ntype, | node_type_storage(&ntype, | ||||
| "NodeGeometryPointsToVolume", | "NodeGeometryPointsToVolume", | ||||
| node_free_standard_storage, | node_free_standard_storage, | ||||
| node_copy_standard_storage); | node_copy_standard_storage); | ||||
| node_type_size(&ntype, 170, 120, 700); | node_type_size(&ntype, 170, 120, 700); | ||||
| node_type_init(&ntype, blender::nodes::geo_node_points_to_volume_init); | node_type_init(&ntype, file_ns::geo_node_points_to_volume_init); | ||||
| node_type_update(&ntype, blender::nodes::geo_node_points_to_volume_update); | node_type_update(&ntype, file_ns::geo_node_points_to_volume_update); | ||||
| ntype.declare = blender::nodes::geo_node_points_to_volume_declare; | ntype.declare = file_ns::geo_node_points_to_volume_declare; | ||||
| ntype.geometry_node_execute = blender::nodes::geo_node_points_to_volume_exec; | ntype.geometry_node_execute = file_ns::geo_node_points_to_volume_exec; | ||||
| ntype.draw_buttons = blender::nodes::geo_node_points_to_volume_layout; | ntype.draw_buttons = file_ns::geo_node_points_to_volume_layout; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||