+2 votes

Hello

How can I Acces to Node Tree of EditorPlugin when I'm in other scene?

Right now I have something like this in my extension:

var dock = preload("res://addons/RoshamboManager/RoshamboPanel.tscn").instance()

var scene = get_tree().get_edited_scene_root()

Dock should be for accesing EditorPlugin and scene is for access to edited scene.

Now when I'm clicking in button with code like this:

func waves_editor():
    dock.get_node("Waves_Editor").popup()

it's ends with error:

res://addons/RoshamboManager/roshambomanager.gd:484 - Invalid call.
Nonexistent function 'get
node' in base 'Nil'.

But the same code works flawlessly when connected button is clicked with opened EditorPlugin scene.

How can i Solve that?

in Engine by (227 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.