diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-05-07 03:44:13 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-05-07 03:52:14 +0300 |
commit | 7b9c865afc6107e52696eebb22586a19ae54d554 (patch) | |
tree | 2fb0a5765a9e76bbf5eed7d81d9050f8fd304b61 /source/blender/editors/physics/particle_edit.c | |
parent | ee0ec0f2af4f03340c4fc91495f702bb67a96c33 (diff) |
Fix inconsistency setting particle edit-mode
The check to include particle edit mode in the object-mode drop-down
didn't match the poll function to edit particle edit mode.
Share the check between both functions.
Diffstat (limited to 'source/blender/editors/physics/particle_edit.c')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index de4ad913d6d..5b545784e5b 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -5375,8 +5375,7 @@ static bool particle_edit_toggle_poll(bContext *C) return 0; } - return (ob->particlesystem.first || BKE_modifiers_findby_type(ob, eModifierType_Cloth) || - BKE_modifiers_findby_type(ob, eModifierType_Softbody)); + return ED_object_particle_edit_mode_supported(ob); } static void free_all_psys_edit(Object *object) @@ -5391,6 +5390,12 @@ static void free_all_psys_edit(Object *object) } } +bool ED_object_particle_edit_mode_supported(const Object *ob) +{ + return (ob->particlesystem.first || BKE_modifiers_findby_type(ob, eModifierType_Cloth) || + BKE_modifiers_findby_type(ob, eModifierType_Softbody)); +} + void ED_object_particle_edit_mode_enter_ex(Depsgraph *depsgraph, Scene *scene, Object *ob) { /* Needed so #ParticleSystemModifierData.mesh_final is set. */ |