Sub plugin is not activating

Godot Version

4.7

Question

I’d like to develop an addon that provides two main windows. However, it looks like a single addon can only provide one. However, I it also seems that Godot addons can have multiple sub-addons (Making plugins — Godot Engine (stable) documentation in English). I’ve set up a simple project that has one main plugin and a subplugin that should provide a main screen window:

The issue I’m having is that the subplugin does not seem to ever get added to the editor. The _enable_plugin() method of my sub plugin does not even seem to be being called. Am I doing something wrong here?

Did you enable the sub-plugin in your main plugin’s script like explained in the documentation you linked? (Just double checking..)

Yes. My main plugin makes the calls:

my_plugin.gd

func _enable_plugin() -> void:
	EditorInterface.set_plugin_enabled("my_plugin/my_main_screen_plugin", true)
	pass


func _disable_plugin() -> void:
	EditorInterface.set_plugin_enabled("my_plugin/my_main_screen_plugin", false)
	pass

Huh. Didn’t know you could make sub plugins. What’s your directory structure look like?

What’s in your plugin.cfg inside the my_plugin folder?

All of this is in the zip file I attached to the first message.

my_plugin/plugin.cfg:

[plugin]

name="my_plugin"
description=""
author=""
version=""
script="my_plugin.gd"

my_plugin/my_main_screen_plugin/plugin.cfg:

[plugin]

name="my_main_screen_plugin"
description=""
author=""
version=""
script="my_main_screen_plugin.gd"

Those look ok. Except based on the documentation, I don’t thing you can have a second plugin script in the subfolder. So put whatever it’s doing in the main script.

Also, I’d add version info, and something in the description and author fields.

Not everyone wants to open zip files from a Google drive. My phone also can’t. I think your solution is ready by the way. No nesting :wink:

TBH, I have Google Drive blindness. I’ve conditioned myself never to click those links, so I didn’t even notice it.

Okay. I’d have uploaded it here, but they don’t allow you to embed zip files. I was thinking of making a bug report, but wanted to check here in case I missed something silly.

Creating bug report: