Edit: @JonRaymond beat me to it - but here are the details:
NOTE: I have not yet tried this myself. I’m lucky enough to be on a sunny island some 4,500 kms from home. If you try this at all, be prepared for misbehavior until me or someone else (you?) can confirm.
Find “Pause G-code” in your printer profile. It looks like this:
M400 U1
Trivially add the gcode for homing XY (and some comments) so it looks like this:
M400 U1 ; Pause for user intervention
G28 X Y ; Home the X and Y axes in case they were upset
Save it as a user profile and use that from now on. EDIT: see caveat about repeatability below.
See @BambuLab I already did half of it for you! Now please tweak the firmwares so the home button(s) only homes XY when pressed during a printer pause. Must be fixed everywhere: On printer, in Studio and in Handy.
EDIT: Looking at Marlin docs, it says “By default “G28
” disables bed leveling. Follow with “M420 S
” to turn leveling on.” and then some exceptions to that statement for newer versions and depending on how it was built. A quick look at Bambu’s G-codes indicates such command shouldn’t be needed, and that Bambu seem to use “G29.2 S1
” for that if it would be.
The fact that Bambu doesn’t just provide us a list of what G-codes are supported or not is ridiculous.