Invalid call. Nonexistent function 'get_base_control' in base 'EditorPlugin'.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By tyo

I’m trying to import a plugin for creating polygons from raster images into Godot 3.0 but I’m getting this error. There was another error which seemed to stem from the plugin being from an earlier build, which was an easy fix, but this one isn’t going away. I’ve looked at the documentation and it seems that EditiorInterface still holds a get_base_control ( ) function, which the plugin doesn’t overload, so I’m confused as to why this isn’t working.

The error before this one was because the plugin was checking to see if the node being handled is a Sprite. Its previous syntax was
return (node extends Sprite)
which I changed to
return (node is Sprite)

Don’t think that would be relevant, but just in case it might be.

I’m really stumped.

here’s a link to the plugin’s repository. The above is the only thing I’ve done to it, I haven’t even imported anything into my project yet because I haven’t gotten the thing to load properly.

Thanks for any and all assistance.

:bust_in_silhouette: Reply From: Zylann

The error means you are trying to call get_base_control on a EditorPlugin. You should be calling it on an EditorInterface: EditorInterface — Godot Engine (3.0) documentation in English

Make sure you are doing it like this:

# In your script extending EditorPlugin
var base_control = get_editor_interface().get_base_control()

Ahhh!

Must be that the plugin was made before EditorPlugin and EditorInterface was separated and my mind filled in blanks where there wasn’t any. I’ve found several more errors like this and am combing through now. Thanks for the assist.

tyo | 2018-11-30 18:08