From 64521653936f914c6d2366712ded6c9afa7f0f0d Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 15 Feb 2021 00:34:00 +0100 Subject: [PATCH] Don't stop the 3D preview rotation animation when zooming in or out The rotation is still stopped when pressing any other mouse button. --- material_maker/panels/preview_3d/preview_3d.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/material_maker/panels/preview_3d/preview_3d.gd b/material_maker/panels/preview_3d/preview_3d.gd index 6ef8d200..5d7935ee 100644 --- a/material_maker/panels/preview_3d/preview_3d.gd +++ b/material_maker/panels/preview_3d/preview_3d.gd @@ -122,7 +122,10 @@ func get_materials() -> Array: func on_gui_input(event) -> void: if event is InputEventMouseButton: - $MaterialPreview/Preview3d/ObjectRotate.stop(false) + if event.button_index == BUTTON_LEFT or event.button_index == BUTTON_RIGHT or event.button_index == BUTTON_MIDDLE: + # Don't stop rotating the preview on mouse wheel usage (zoom change). + $MaterialPreview/Preview3d/ObjectRotate.stop(false) + match event.button_index: BUTTON_WHEEL_UP: camera.translation.z = clamp(