Fix particle ID init not creating particle deflect data.

This data (the force fields) are expected to always be there, but they
are currently created on the fly by RNA accessors (typically from UI
draw code), which is extremely wrong way to do it.

Differential Revision: https://developer.blender.org/D11341
This commit is contained in:
Bastien Montagne 2021-05-21 14:55:21 +02:00
parent 305b08b521
commit adf2f146d8
1 changed files with 2 additions and 0 deletions

View File

@ -101,6 +101,8 @@ static void particle_settings_init(ID *id)
MEMCPY_STRUCT_AFTER(particle_settings, DNA_struct_default_get(ParticleSettings), id);
particle_settings->effector_weights = BKE_effector_add_weights(NULL);
particle_settings->pd = BKE_partdeflect_new(PFIELD_NULL);
particle_settings->pd2 = BKE_partdeflect_new(PFIELD_NULL);
}
static void particle_settings_copy_data(Main *UNUSED(bmain),