28 b.add_input<
decl::Float>(
N_(
"Density")).default_value(1.0f).min(0.01f).max(FLT_MAX);
34 b.add_input<
decl::Float>(
N_(
"Voxel Amount")).default_value(64.0f).min(0.0f).max(FLT_MAX);
49 .
description(
N_(
"Initialize the density grid in every cell inside the enclosed volume"));
90 const float exterior_band_width =
params.get_input<
float>(
"Exterior Band Width");
91 const float interior_band_width =
params.get_input<
float>(
"Interior Band Width");
92 const bool fill_volume =
params.get_input<
bool>(
"Fill Volume");
97 resolution.settings.voxel_amount =
params.get_input<
float>(
"Voxel Amount");
98 if (resolution.settings.voxel_amount <= 0.0f) {
103 resolution.settings.voxel_size =
params.get_input<
float>(
"Voxel Size");
104 if (resolution.settings.voxel_size <= 0.0f) {
123 const float voxel_size = geometry::volume_compute_voxel_size(
params.depsgraph(),
127 mesh_to_volume_space_transform);
133 geometry::volume_grid_add_from_mesh(volume,
136 mesh_to_volume_space_transform,
155 Volume *volume = create_volume_from_mesh(*geometry_set.get_mesh_for_read(), params);
156 geometry_set.replace_volume(volume);
157 geometry_set.keep_only_during_modify({GEO_COMPONENT_TYPE_VOLUME});
160 params.set_output(
"Volume", std::move(geometry_set));
162 params.error_message_add(NodeWarningType::Error,
163 TIP_(
"Disabled, Blender was compiled without OpenVDB"));
164 params.set_default_remaining_outputs();
@ GEO_COMPONENT_TYPE_MESH
void * BKE_id_new_nomain(short type, const char *name)
bool BKE_mesh_wrapper_minmax(const struct Mesh *me, float min[3], float max[3])
void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth)
#define GEO_NODE_MESH_TO_VOLUME
void node_type_update(struct bNodeType *ntype, void(*updatefunc)(struct bNodeTree *ntree, struct bNode *node))
#define NODE_STORAGE_FUNCS(StorageT)
void nodeSetSocketAvailability(struct bNodeTree *ntree, struct bNodeSocket *sock, bool is_available)
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
#define NODE_CLASS_GEOMETRY
void node_type_storage(struct bNodeType *ntype, const char *storagename, void(*freefunc)(struct bNode *node), void(*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node))
struct bNodeSocket * nodeFindSocket(const struct bNode *node, eNodeSocketInOut in_out, const char *identifier)
void nodeRegisterType(struct bNodeType *ntype)
General operations, lookup, etc. for blender objects.
void BKE_volume_init_grids(struct Volume *volume)
MeshToVolumeModifierResolutionMode
@ MESH_TO_VOLUME_RESOLUTION_MODE_VOXEL_SIZE
@ MESH_TO_VOLUME_RESOLUTION_MODE_VOXEL_AMOUNT
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
StringRefNull description() const
void *(* MEM_callocN)(size_t len, const char *str)
static void node_init(bNodeTree *UNUSED(tree), bNode *node)
static void node_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
static void node_update(bNodeTree *ntree, bNode *node)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken density("density", pxr::TfToken::Immortal)
static void node_init(const struct bContext *C, bNodeTree *ntree, bNode *node)
void register_node_type_geo_mesh_to_volume()
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
void modify_geometry_sets(ForeachSubGeometryCallback callback)
NodeGeometryExecFunction geometry_node_execute
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
NodeDeclareFunction declare
static float4x4 identity()
MeshToVolumeModifierResolutionMode mode