From fb28e2f124c30fec0b132924495325b8f08bcf2d Mon Sep 17 00:00:00 2001 From: LMW Date: Mon, 11 Aug 2025 00:00:37 +0800 Subject: [PATCH] Add Shift+RMB shortcut to rotate environment --- material_maker/panels/preview_3d/preview_3d.gd | 2 +- .../windows/environment_editor/camera_controller.gd | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/material_maker/panels/preview_3d/preview_3d.gd b/material_maker/panels/preview_3d/preview_3d.gd index ee9c47c92..8519fc730 100644 --- a/material_maker/panels/preview_3d/preview_3d.gd +++ b/material_maker/panels/preview_3d/preview_3d.gd @@ -232,7 +232,7 @@ func on_gui_input(event : InputEvent) -> void: else: motion.y = 0 var camera_basis = camera.global_transform.basis - var objects_rotation : int = -1 if Input.is_key_pressed(KEY_CTRL) else 1 if Input.is_key_pressed(KEY_SHIFT) else 0 + var objects_rotation : int = -1 if Input.is_key_pressed(KEY_CTRL) else 0 if event.button_mask & MOUSE_BUTTON_MASK_LEFT: objects_pivot.rotate(camera_basis.x.normalized(), objects_rotation * motion.y) objects_pivot.rotate(camera_basis.y.normalized(), objects_rotation * motion.x) diff --git a/material_maker/windows/environment_editor/camera_controller.gd b/material_maker/windows/environment_editor/camera_controller.gd index 163fba334..eeb7ee1a9 100644 --- a/material_maker/windows/environment_editor/camera_controller.gd +++ b/material_maker/windows/environment_editor/camera_controller.gd @@ -29,6 +29,11 @@ func process_event(event : InputEvent, viewport : Viewport = null) -> bool: camera_rotation2.rotate_x(-0.01*event.relative.y) camera_rotation1.rotate_y(-0.01*event.relative.x) return true + elif event.button_mask & MOUSE_BUTTON_MASK_RIGHT != 0: + if event.shift_pressed: + var world_env : WorldEnvironment = get_node("../WorldEnvironment") + world_env.environment.sky_rotation.y += event.relative.x * 0.001 + return false elif event is InputEventMouseButton: if not event.is_command_or_control_pressed(): var zoom = 0.0