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:
Diffstat (limited to 'source/blender/modifiers/intern/MOD_simulation.cc')
-rw-r--r--source/blender/modifiers/intern/MOD_simulation.cc16
1 files changed, 2 insertions, 14 deletions
diff --git a/source/blender/modifiers/intern/MOD_simulation.cc b/source/blender/modifiers/intern/MOD_simulation.cc
index 819ed320255..d9cc9840e08 100644
--- a/source/blender/modifiers/intern/MOD_simulation.cc
+++ b/source/blender/modifiers/intern/MOD_simulation.cc
@@ -93,20 +93,8 @@ static bool isDisabled(const struct Scene *UNUSED(scene),
static const ParticleSimulationState *find_particle_state(SimulationModifierData *smd)
{
- if (smd->simulation == nullptr) {
- return nullptr;
- }
- if (smd->data_path == nullptr) {
- return nullptr;
- }
- LISTBASE_FOREACH (const SimulationState *, state, &smd->simulation->states) {
- if (STREQ(smd->data_path, state->name)) {
- if (state->type == SIM_STATE_TYPE_PARTICLES) {
- return (ParticleSimulationState *)state;
- }
- }
- }
- return nullptr;
+ return (const ParticleSimulationState *)BKE_simulation_state_try_find_by_name_and_type(
+ smd->simulation, smd->data_path, SIM_TYPE_NAME_PARTICLE_SIMULATION);
}
static PointCloud *modifyPointCloud(ModifierData *md,