Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-09-24 12:56:02 +0300
committerJacques Lucke <jacques@blender.org>2020-09-24 12:56:02 +0300
commitf564126cdf1b172e01553aded2fd9b00a0e0ca67 (patch)
tree767031c5949f6a62947bbd0427345c758109e2a0 /source/blender/modifiers/intern/MOD_simulation.cc
parentf1fee433be920cd7fe04ad2a418170d5bd05d2de (diff)
Fix: add radius attribute in simulation modifier
This is necessary to not make it crash immediatly after recent changes.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_simulation.cc')
-rw-r--r--source/blender/modifiers/intern/MOD_simulation.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_simulation.cc b/source/blender/modifiers/intern/MOD_simulation.cc
index d009eef00e6..7b76cb56d5d 100644
--- a/source/blender/modifiers/intern/MOD_simulation.cc
+++ b/source/blender/modifiers/intern/MOD_simulation.cc
@@ -114,6 +114,10 @@ static PointCloud *modifyPointCloud(ModifierData *md,
CustomData_get_layer_named(&state->attributes, CD_PROP_FLOAT, "Radius"));
memcpy(pointcloud->co, positions, sizeof(float3) * state->tot_particles);
+ CustomData_add_layer_named(
+ &pointcloud->pdata, CD_PROP_FLOAT, CD_CALLOC, NULL, state->tot_particles, "Radius");
+ BKE_pointcloud_update_customdata_pointers(pointcloud);
+
for (int i = 0; i < state->tot_particles; i++) {
pointcloud->radius[i] = radii[i];
}