6# include <openvdb/openvdb.h>
35 for (float3 &position : positions.slice(range)) {
36 position += translation;
47 std::optional<Bounds<float3>>
bounds;
48 if (pointcloud.
runtime->bounds_cache.is_cached()) {
59 bounds->min += translation;
60 bounds->max += translation;
77 for (
const int layer_index : grease_pencil.layers().index_range()) {
78 Layer &layer = grease_pencil.layer(layer_index);
80 local_transform.
location() += translation;
88 for (
const int layer_index : grease_pencil.layers().index_range()) {
89 Layer &layer = grease_pencil.layer(layer_index);
91 local_transform =
transform * local_transform;
100 for (float4x4 &instance_transform : transforms.slice(range)) {
101 add_v3_v3(instance_transform.ptr()[3], translation);
110 for (float4x4 &instance_transform : transforms.slice(range)) {
111 instance_transform = transform * instance_transform;
121 openvdb::Mat4s vdb_matrix;
122 memcpy(vdb_matrix.asPointer(), &
transform,
sizeof(
float[4][4]));
123 openvdb::Mat4d vdb_matrix_d{vdb_matrix};
178 for (const int64_t i : range) {
179 deform_mats[i] = deform_mat * deform_mats[i];
184 edit_hints.deform_mats.emplace(edit_hints.curves_id_orig.geometry.point_num, deform_mat);
203 for (const int64_t i : range) {
204 deform_mats[i] = deform_mat * deform_mats[i];
232 m.location() += translation;
242 curves->geometry.wrap().translate(translation);
296 geometry.get_grease_pencil_edit_hints_for_write())
Low-level operations for curves.
Low-level operations for grease pencil.
General operations for point clouds.
int BKE_volume_num_grids(const Volume *volume)
blender::bke::VolumeGridData * BKE_volume_grid_get_for_write(Volume *volume, int grid_index)
bool BKE_volume_grid_determinant_valid(double determinant)
void copy_m3_m4(float m1[3][3], const float m2[4][4])
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
constexpr IndexRange index_range() const
std::optional< MutableSpan< float3 > > positions_for_write()
std::optional< Array< float3x3 > > deform_mats
std::optional< MutableSpan< float3 > > positions_for_write()
const greasepencil::Drawing * drawing_orig
std::optional< Array< float3x3 > > deform_mats
std::optional< Array< GreasePencilDrawingEditHints > > drawing_hints
MutableSpan< float4x4 > transforms_for_write()
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef attribute_id, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
const bke::CurvesGeometry & strokes() const
void set_local_transform(const float4x4 &transform)
float4x4 local_transform() const
float determinant(MatBase< C, R >) RET
VecBase< float, 3 > float3
float4x4 get_transform_matrix(const VolumeGridData &grid)
void clear_tree(VolumeGridData &grid)
void set_transform_matrix(VolumeGridData &grid, const float4x4 &matrix)
void mesh_transform(Mesh &mesh, const float4x4 &transform, bool do_shape_keys)
void mesh_translate(Mesh &mesh, const float3 &translation, bool do_shape_keys)
static void translate_positions(MutableSpan< float3 > positions, const float3 &translation)
static void translate_greasepencil(GreasePencil &grease_pencil, const float3 translation)
static void transform_instances(bke::Instances &instances, const float4x4 &transform)
void translate_geometry(bke::GeometrySet &geometry, const float3 translation)
static void transform_grease_pencil_edit_hints(bke::GreasePencilEditHints &edit_hints, const float4x4 &transform)
static void translate_gizmos_edit_hints(bke::GizmoEditHints &edit_hints, const float3 &translation)
static void translate_instances(bke::Instances &instances, const float3 translation)
static void transform_curve_edit_hints(bke::CurvesEditHints &edit_hints, const float4x4 &transform)
static void transform_gizmo_edit_hints(bke::GizmoEditHints &edit_hints, const float4x4 &transform)
void transform_mesh(Mesh &mesh, float3 translation, math::Quaternion rotation, float3 scale)
static void translate_curve_edit_hints(bke::CurvesEditHints &edit_hints, const float3 &translation)
static void translate_volume(Volume &volume, const float3 translation)
std::optional< TransformGeometryErrors > transform_geometry(bke::GeometrySet &geometry, const float4x4 &transform)
static void transform_pointcloud(PointCloud &pointcloud, const float4x4 &transform)
static void transform_volume(Volume &volume, const float4x4 &transform, TransformGeometryErrors &r_errors)
static void translate_pointcloud(PointCloud &pointcloud, const float3 translation)
static void transform_greasepencil(GreasePencil &grease_pencil, const float4x4 &transform)
QuaternionBase< float > Quaternion
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
MatT from_location(const typename MatT::loc_type &location)
T determinant(const MatBase< T, Size, Size > &mat)
void transform_points(const float4x4 &transform, MutableSpan< float3 > points, bool use_threading=true)
MatT from_loc_rot_scale(const typename MatT::loc_type &location, const RotationT &rotation, const VecBase< typename MatT::base_type, ScaleDim > &scale)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
MatBase< float, 4, 4 > float4x4
MatBase< float, 3, 3 > float3x3
VecBase< float, 3 > float3
PointCloudRuntimeHandle * runtime
const c_style_mat & ptr() const
static MatBase identity()
Map< NodeGizmoID, float4x4 > gizmo_transforms
MutableVArraySpan< T > span