4 # include <openvdb/openvdb.h>
53 for (
const int i : position.
span.index_range()) {
54 position.
span[i] += translation;
64 for (
const int i : position.
span.index_range()) {
81 for (
float4x4 &instance_transform : instance_transforms) {
82 instance_transform =
transform * instance_transform;
95 openvdb::Mat4s vdb_matrix;
96 memcpy(vdb_matrix.asPointer(), &
transform,
sizeof(
float[4][4]));
97 openvdb::Mat4d vdb_matrix_d{vdb_matrix};
99 bool found_too_small_scale =
false;
108 found_too_small_scale =
true;
110 BKE_volume_grid_clear_tree(volume, *volume_grid);
126 if (found_too_small_scale) {
127 params.error_message_add(NodeWarningType::Warning,
128 TIP_(
"Volume scale is lower than permitted by OpenVDB"));
154 mat = deform_mat * mat;
261 params.set_output(
"Geometry", std::move(geometry_set));
Low-level operations for curves.
void BKE_mesh_translate(struct Mesh *me, const float offset[3], bool do_keys)
void BKE_mesh_transform(struct Mesh *me, const float mat[4][4], bool do_keys)
#define GEO_NODE_TRANSFORM
#define NODE_CLASS_GEOMETRY
void nodeRegisterType(struct bNodeType *ntype)
General operations for point clouds.
VolumeGrid * BKE_volume_grid_get_for_write(struct Volume *volume, int grid_index)
void BKE_volume_grid_transform_matrix(const struct VolumeGrid *grid, float mat[4][4])
void BKE_volume_grid_transform_matrix_set(struct VolumeGrid *volume_grid, const float mat[4][4])
int BKE_volume_num_grids(const struct Volume *volume)
bool BKE_volume_grid_determinant_valid(double determinant)
bool BKE_volume_load(const struct Volume *volume, const struct Main *bmain)
MINLINE int compare_ff(float a, float b, float max_diff)
void copy_m3_m4(float m1[3][3], const float m2[4][4])
void mul_m4_m4_pre(float R[4][4], const float A[4][4])
float determinant_m4(const float m[4][4])
MINLINE float normalize_v3(float r[3])
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
MINLINE void add_v3_v3(float r[3], const float a[3])
struct Depsgraph Depsgraph
struct Main * DEG_get_bmain(const Depsgraph *graph)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to curves
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
btScalar determinant() const
Return the determinant of the matrix.
blender::MutableSpan< blender::float4x4 > instance_transforms()
const Curves & curves_id_orig
std::optional< Array< float3 > > positions
std::optional< Array< float3x3 > > deform_mats
void translate(const float3 &translation)
static CurvesGeometry & wrap(::CurvesGeometry &dna_struct)
void transform(const float4x4 &matrix)
GSpanAttributeWriter lookup_or_add_for_write_span(const AttributeIDRef &attribute_id, const eAttrDomain domain, const eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefault())
const Depsgraph * depsgraph
MutableAttributeAccessor pointcloud_attributes_for_write(PointCloud &pointcloud)
T length_squared(const vec_base< T, Size > &a)
static void transform_volume(GeoNodeExecParams ¶ms, Volume &volume, const float4x4 &transform, const Depsgraph &depsgraph)
static void transform_instances(InstancesComponent &instances, const float4x4 &transform)
static void translate_curve_edit_hints(bke::CurvesEditHints &edit_hints, const float3 &translation)
static void transform_pointcloud(PointCloud &pointcloud, const float4x4 &transform)
static void translate_geometry_set(GeoNodeExecParams ¶ms, GeometrySet &geometry, const float3 translation, const Depsgraph &depsgraph)
static void translate_pointcloud(PointCloud &pointcloud, const float3 translation)
static void translate_instances(InstancesComponent &instances, const float3 translation)
static void translate_volume(GeoNodeExecParams ¶ms, Volume &volume, const float3 translation, const Depsgraph &depsgraph)
void transform_geometry_set(GeoNodeExecParams ¶ms, GeometrySet &geometry, const float4x4 &transform, const Depsgraph &depsgraph)
static void translate_mesh(Mesh &mesh, const float3 translation)
void transform_mesh(Mesh &mesh, const float3 translation, const float3 rotation, const float3 scale)
static bool use_translate(const float3 rotation, const float3 scale)
static void transform_curve_edit_hints(bke::CurvesEditHints &edit_hints, const float4x4 &transform)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
Curves * get_curves_for_write()
PointCloud * get_pointcloud_for_write()
Mesh * get_mesh_for_write()
bool has_instances() const
blender::bke::CurvesEditHints * get_curve_edit_hints_for_write()
Volume * get_volume_for_write()
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare
MutableVArraySpan< T > span
static float4x4 from_loc_eul_scale(const float3 location, const float3 rotation, const float3 scale)
static float4x4 from_location(const float3 location)