You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I work on project in which I read camera.zoom property to properly display my entities when I zoom out significantly.
Describe the problem or limitation you are having in your project
I would like to have the ability to do the same when I am designing the scene. Currently I have to do some ugly workarounds to achieve this. (Initial code is not mine, I found it somewhere and adapted for my purpose):
extends EditorPlugin
class_name EditorCameraHelper
const NODE_2D_VIEWPORT_CLASS_NAME = "CanvasItemEditorViewport"
var _editor_interface : EditorInterface
var _editor_viewports : Array = []
var editor_cameras : Array = []
func _init():
_editor_interface = get_editor_interface()
_find_viewports(_editor_interface.get_base_control())
for v in _editor_viewports:
_find_cameras(v)
func _find_viewports(n : Node):
if n.get_class() == NODE_2D_VIEWPORT_CLASS_NAME:
_editor_viewports.append(n)
for c in n.get_children():
_find_viewports(c)
func _find_cameras(n : Node):
if n.get_class() == "EditorZoomWidget":
editor_cameras.append(n)
return
for c in n.get_children():
_find_cameras(c)
Describe the project you are working on
I work on project in which I read
camera.zoom
property to properly display my entities when I zoom out significantly.Describe the problem or limitation you are having in your project
I would like to have the ability to do the same when I am designing the scene. Currently I have to do some ugly workarounds to achieve this. (Initial code is not mine, I found it somewhere and adapted for my purpose):
then in my code I can do:
(currently it is not working as I want due to bug I have reported here 85524)
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Provide a API to access editor's Camera.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
N/A
If this enhancement will not be used often, can it be worked around with a few lines of script?
N/A
Is there a reason why this should be core and not an add-on in the asset library?
N/A
The text was updated successfully, but these errors were encountered: