diff options
Diffstat (limited to 'source/blender/editors/physics/particle_object.c')
-rw-r--r-- | source/blender/editors/physics/particle_object.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index e10df28a75e..3b063fd7164 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -51,6 +51,7 @@ #include "BKE_report.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "DEG_depsgraph_build.h" #include "RNA_access.h" @@ -1069,7 +1070,8 @@ static bool copy_particle_systems_to_object(const bContext *C, psys_start = totpsys > 0 ? tmp_psys[0] : NULL; /* Get the evaluated mesh (psys and their modifiers have not been appended yet) */ - final_mesh = mesh_get_eval_final(depsgraph, scene, ob_to, cdmask); + Object *ob_to_eval = DEG_get_evaluated_object(depsgraph, ob_to); + final_mesh = mesh_get_eval_final(depsgraph, scene, ob_to_eval, cdmask); /* now append psys to the object and make modifiers */ for (i = 0, psys_from = PSYS_FROM_FIRST; @@ -1082,6 +1084,7 @@ static bool copy_particle_systems_to_object(const bContext *C, /* append to the object */ BLI_addtail(&ob_to->particlesystem, psys); + psys_unique_name(ob_to, psys, ""); /* add a particle system modifier for each system */ md = modifier_new(eModifierType_ParticleSystem); @@ -1089,7 +1092,7 @@ static bool copy_particle_systems_to_object(const bContext *C, /* push on top of the stack, no use trying to reproduce old stack order */ BLI_addtail(&ob_to->modifiers, md); - BLI_snprintf(md->name, sizeof(md->name), "ParticleSystem %i", i); + BLI_strncpy(md->name, psys->name, sizeof(md->name)); modifier_unique_name(&ob_to->modifiers, (ModifierData *)psmd); psmd->psys = psys; |