-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow tool script to alter transform of node 3d editor viewport camera #93503
base: master
Are you sure you want to change the base?
Allow tool script to alter transform of node 3d editor viewport camera #93503
Conversation
6bfa6c5
to
6d85913
Compare
This looks awesome! Have the godot devs had a chance to discuss / look at this? |
I'm also keeping a keen eye on this issue. I am planning a terrain system of sorts that should allow for very large terrain and I would like to create some sort of mini-map tool and allow the user to click on the map to move the camera to the relevant part of the terrain. Not being able to control the camera was a showstopper for that. It would also be great if the zoom level could be controlled in the same way but if I read the comments correctly that is also included in this PR right? I can't wait for this to land. Also I think there are a few people working on terrain stuff for Godot that would also welcome this! 👍 EDIT: @akien-mga Or other reviewers, did this maybe fall of your radar? Looks like this could be merged quickly as it does not have conflicts, all tests passing and very humble scope / few changes. |
Check out this terrain plugin. It's pretty awesome. Ive made a minimap
plugin for it... There's a hack you can use to apply the camera position in
editor...it involves injecting a key press for the hotkey for
focus_on_selected (f by default).
https://github.com/mohsenph69/Godot-MTerrain-plugin
This is a draft of my minimap add-on:
https://github.com/rossunger/mterrain_minimap
…On Mon, Sept 9, 2024, 2:01 a.m. Stijn de Witt ***@***.***> wrote:
I'm also keeping a keen eye on this issue. I am planning a terrain system
of sorts that should allow for very large terrain and I would like to
create some sort of mini-map tool and allow the user to click on the map to
move the camera to the relevant part of the terrain. Not being able to
control the camera was a showstopper for that.
It would also be great if the zoom level could be controlled in the same
way but if I read the comments correctly that is also included in this PR
right? I can't wait for this to land. Also I think there are a few people
working on terrain stuff for Godot that would also welcome this! 👍
—
Reply to this email directly, view it on GitHub
<#93503 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGZ2R5PBQS2NVIVCCMOPG3ZVVBT5AVCNFSM6AAAAABJYDDECKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZXGI4DKOJRG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like my plugin/tool script to be able to move the 3d editor's camera. Same as some comments in several issues, e.g.
godotengine/godot-proposals#1302 (comment)
godotengine/godot-proposals#3287 (comment)
godotengine/godot-proposals#3164 (comment)
As others have found, moving/rotating the camera only works temporarily, it springs back to original transform as soon as you pan or navigate.
Cause:
Looking at node_3d_editor_plugin I see it's because camera is updated from a "cursor" and cursor is not exposed to tool script.
Proposed approach:
Rather than expose new methods or properties to script, I thought it would be simplest to have node_3d_editor_plugin look for external changes to the camera transform, and if any occur, to update its cursor to match the manually updated camera position. Seems to work fine.
Before:
After:
Repro project:
cam-move-test.zip