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:
@@ -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. */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user