I think I found it
Commenting out those 2 blocks would disable all Z homing functions, but would leave Z probing with G29 working. I can test it as soon as I get home from work
In /Marlin/src/gcode/calibrate/G28.cpp
Line 256:
#if Z_HOME_DIR > 0 // If homing away from BED do Z firstif (home_all || homeZ) homeaxis(Z_AXIS);
#endif
const float z_homing_height = (
#if ENABLED(UNKNOWN_Z_NO_RAISE)
!TEST(axis_known_position, Z_AXIS) ? 0 :
#endif
(parser.seenval(‘R’) ? parser.value_linear_units() : Z_HOMING_HEIGHT)
);if (z_homing_height && (home_all || homeX || homeY)) {
// Raise Z before homing any other axes and z is not already high enough (never lower z)
destination[Z_AXIS] = z_homing_height;
if (destination[Z_AXIS] > current_position[Z_AXIS]) {#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING))
SERIAL_ECHOLNPAIR("Raise Z (before homing) to ", destination[Z_AXIS]);
#endifdo_blocking_move_to_z(destination[Z_AXIS]);
}
}
Line 337:
// Home Z last if homing towards the bed #if Z_HOME_DIR < 0 if (home_all || homeZ) { #if ENABLED(Z_SAFE_HOMING) home_z_safely(); #else homeaxis(Z_AXIS); #endif#if HOMING_Z_WITH_PROBE && defined(Z_AFTER_PROBING)
move_z_after_probing();
#endif} // home_all || homeZ
#endif // Z_HOME_DIR < 0