29 N_(
"Desired number of voxels along one axis")},
34 N_(
"Desired voxel side length")},
35 {0,
nullptr, 0,
nullptr,
nullptr},
41 .supported_type(GeometryComponent::Type::Mesh)
42 .
description(
"Mesh to convert the inner volume to a fog volume geometry");
47 .description(
"How the voxel size is specified")
65 .description(
"Width of the gradient inside of the mesh");
79 const float density =
params.get_input<
float>(
"Density");
80 const float interior_band_width =
params.get_input<
float>(
"Interior Band Width");
84 resolution.
mode = mode;
86 resolution.settings.voxel_amount =
params.get_input<
float>(
"Voxel Amount");
87 if (resolution.settings.voxel_amount <= 0.0f) {
92 resolution.settings.voxel_size =
params.get_input<
float>(
"Voxel Size");
93 if (resolution.settings.voxel_size <= 0.0f) {
104 const float voxel_size = geometry::volume_compute_voxel_size(
106 [&]() { return *mesh.bounds_min_max(); },
109 mesh_to_volume_space_transform);
114 geometry::fog_volume_grid_add_from_mesh(volume,
116 mesh.vert_positions(),
119 mesh_to_volume_space_transform,
137 geometry_set.
keep_only({GeometryComponent::Type::Volume, GeometryComponent::Type::Edit});
140 params.set_output(
"Volume", std::move(geometry_set));
152 ntype.
ui_name =
"Mesh to Volume";
153 ntype.
ui_description =
"Create a fog volume with the shape of the input mesh's surface";
void * BKE_id_new_nomain(short type, const char *name)
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_MESH_TO_VOLUME
#define CTX_N_(context, msgid)
#define BLT_I18NCONTEXT_ID_ID
#define BLT_I18NCONTEXT_COUNTABLE
MeshToVolumeModifierResolutionMode
@ MESH_TO_VOLUME_RESOLUTION_MODE_VOXEL_SIZE
@ MESH_TO_VOLUME_RESOLUTION_MODE_VOXEL_AMOUNT
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void * MEM_callocN(size_t len, const char *str)
void node_type_size(bNodeType &ntype, int width, int minwidth, int maxwidth)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
static void node_init(bNodeTree *, bNode *node)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
static void node_geo_exec(GeoNodeExecParams params)
static EnumPropertyItem resolution_mode_items[]
void node_geo_exec_with_missing_openvdb(GeoNodeExecParams ¶ms)
MatBase< float, 4, 4 > float4x4
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
static MatBase identity()
void replace_volume(Volume *volume, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void keep_only(Span< GeometryComponent::Type > component_types)
const Mesh * get_mesh() const
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare
MeshToVolumeModifierResolutionMode mode