Skip to content

Commit af92db2

Browse files
authoredMar 13, 2025··
Merge pull request #6314 from BrianHanke/particle_motion_blur
Cycles : Fix incorrect particle motion blur shape

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed
 

‎Changes.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
1.5.x.x (relative to 1.5.8.0)
22
=======
33

4+
Fixes
5+
-----
6+
7+
- Cycles : Fixed incorrect particle motion blur shape (#5862).
48

59

610
1.5.8.0 (relative to 1.5.7.0)

‎src/GafferCycles/IECoreCyclesPreview/PointsAlgo.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ ccl::Geometry *convert( const vector<const IECoreScene::PointsPrimitive *> &poin
210210
pointcloud->set_use_motion_blur( true );
211211
pointcloud->set_motion_steps( samples.size() + 1 );
212212
ccl::Attribute *attr_mP = pointcloud->attributes.add( ccl::ATTR_STD_MOTION_VERTEX_POSITION, ccl::ustring("motion_P") );
213-
ccl::float3 *mP = attr_mP->data_float3();
213+
ccl::float4 *mP = attr_mP->data_float4();
214+
float *radius = pointcloud->get_radius().data();
214215

215216
for( size_t i = 0; i < samples.size(); ++i )
216217
{
@@ -229,7 +230,7 @@ ccl::Geometry *convert( const vector<const IECoreScene::PointsPrimitive *> &poin
229230
size_t numVerts = samplePData->readable().size();
230231

231232
for( size_t j = 0; j < numVerts; ++j, ++mP )
232-
*mP = ccl::make_float3( sampleP[j].x, sampleP[j].y, sampleP[j].z );
233+
*mP = ccl::make_float4( sampleP[j].x, sampleP[j].y, sampleP[j].z, radius[j] );
233234
}
234235
else
235236
{
@@ -248,7 +249,7 @@ ccl::Geometry *convert( const vector<const IECoreScene::PointsPrimitive *> &poin
248249
}
249250
}
250251
}
251-
mP = attr_mP->data_float3();
252+
mP = attr_mP->data_float4();
252253

253254
pointcloud->name = ccl::ustring( nodeName.c_str() );
254255
return pointcloud;

0 commit comments

Comments
 (0)
Please sign in to comment.