Fix #108215: Cycles: Point Cloud uses wrong position with Persistent Data

The problem here was that the sync code overwrites the point data, but didn't
reset the transform_applied flag, so the rest of the code assumed that the
points are already in world space and didn't apply the transform again.
This commit is contained in:
Lukas Stockner
2025-01-20 02:38:55 +01:00
parent 5a452884fc
commit e5ca7ae421
3 changed files with 8 additions and 0 deletions

View File

@@ -207,6 +207,8 @@ void BlenderSync::sync_pointcloud(PointCloud *pointcloud, BObjectInfo &b_ob_info
need_motion,
motion_scale);
pointcloud->clear_non_sockets();
/* Update original sockets. */
for (const SocketType &socket : new_pointcloud.type->inputs) {
/* Those sockets are updated in sync_object, so do not modify them. */

View File

@@ -113,6 +113,11 @@ void PointCloud::reserve(const int numpoints)
attributes.resize(true);
}
void PointCloud::clear_non_sockets()
{
Geometry::clear(true);
}
void PointCloud::clear(const bool preserve_shaders)
{
Geometry::clear(preserve_shaders);

View File

@@ -48,6 +48,7 @@ class PointCloud : public Geometry {
~PointCloud() override;
/* Geometry */
void clear_non_sockets();
void clear(const bool preserve_shaders = false) override;
void resize(const int numpoints);