diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index 207f6f86820..08290f20a69 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -218,9 +218,13 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): row.prop(part, "hair_step") if psys is not None and psys.is_edited: if psys.is_global_hair: - layout.operator("particle.connect_hair") + row = layout.row(align=True) + row.operator("particle.connect_hair").all = False + row.operator("particle.connect_hair", text="Connect All").all = True else: - layout.operator("particle.disconnect_hair") + row = layout.row(align=True) + row.operator("particle.disconnect_hair").all = False + row.operator("particle.disconnect_hair", text="Disconnect All").all = True elif psys is not None and part.type == 'REACTOR': split.enabled = particle_panel_enabled(context, psys) split.prop(psys, "reactor_target_object") diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 7aa4c245f11..1297133e1a2 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -649,7 +649,7 @@ void PARTICLE_OT_disconnect_hair(wmOperatorType *ot) ot->exec = disconnect_hair_exec; /* flags */ - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_UNDO; /* No REGISTER, redo does not work due to missing update, see T47750. */ RNA_def_boolean(ot->srna, "all", 0, "All hair", "Disconnect all hair systems from the emitter mesh"); } @@ -862,7 +862,6 @@ static int connect_hair_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= ED_object_context(C); - PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= NULL; const bool all = RNA_boolean_get(op->ptr, "all"); bool any_connected = false; @@ -876,12 +875,13 @@ static int connect_hair_exec(bContext *C, wmOperator *op) } } else { - psys = ptr.data; + psys = psys_get_current(ob); any_connected |= connect_hair(scene, ob, psys); } if (!any_connected) { - BKE_report(op->reports, RPT_ERROR, "Can't disconnect hair if particle system modifier is disabled"); + BKE_report(op->reports, RPT_WARNING, + "No hair connected (can't connect hair if particle system modifier is disabled)"); return OPERATOR_CANCELLED; } @@ -900,7 +900,7 @@ void PARTICLE_OT_connect_hair(wmOperatorType *ot) ot->exec = connect_hair_exec; /* flags */ - ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + ot->flag = OPTYPE_UNDO; /* No REGISTER, redo does not work due to missing update, see T47750. */ RNA_def_boolean(ot->srna, "all", 0, "All hair", "Connect all hair systems to the emitter mesh"); }