10# include <openvdb/openvdb.h>
39 for (float3 &position : positions.slice(range)) {
40 position += translation;
51 std::optional<Bounds<float3>>
bounds;
63 bounds->min += translation;
64 bounds->max += translation;
81 for (
const int layer_index :
grease_pencil.layers().index_range()) {
84 local_transform.
location() += translation;
85 layer.set_local_transform(local_transform);
92 for (
const int layer_index :
grease_pencil.layers().index_range()) {
95 local_transform =
transform * local_transform;
96 layer.set_local_transform(local_transform);
104 for (float4x4 &instance_transform : transforms.slice(range)) {
105 add_v3_v3(instance_transform.ptr()[3], translation);
114 for (float4x4 &instance_transform : transforms.slice(range)) {
115 instance_transform = transform * instance_transform;
125 openvdb::Mat4s vdb_matrix;
126 memcpy(vdb_matrix.asPointer(), &
transform,
sizeof(
float[4][4]));
127 openvdb::Mat4d vdb_matrix_d{vdb_matrix};
182 for (const int64_t i : range) {
183 deform_mats[i] = deform_mat * deform_mats[i];
188 edit_hints.deform_mats.emplace(edit_hints.curves_id_orig.geometry.point_num, deform_mat);
207 for (const int64_t i : range) {
208 deform_mats[i] = deform_mat * deform_mats[i];
236 m.location() += translation;
246 curves->geometry.wrap().translate(translation);
300 geometry.get_grease_pencil_edit_hints_for_write())
Low-level operations for curves.
Low-level operations for grease pencil.
General operations for point clouds.
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 name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
const bke::CurvesGeometry & strokes() const
b[1] b &&[1] b &&[1] b &&[1] b &&[1] b[3] b &&[1] b[3] float determinant(MatBase< C, R >) RET
float3x3 scale(float3x3 mat, float2 scale)
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))
bke::VolumeGridData * BKE_volume_grid_get_for_write(Volume *volume, int grid_index)
int BKE_volume_num_grids(const Volume *volume)
void copy_m3_m4(float m1[3][3], const float m2[4][4])
MatBase< float, 4, 4 > float4x4
MatBase< float, 3, 3 > float3x3
bool BKE_volume_grid_determinant_valid(double determinant)
VecBase< float, 3 > float3
const c_style_mat & ptr() const
static MatBase identity()
bke::PointCloudRuntime * runtime
Map< NodeGizmoID, float4x4 > gizmo_transforms
SharedCache< Bounds< float3 > > bounds_cache