Plugin creation needs more automated assistance

To create a plugin, there is two way - 1. Create a new project and modify it to be a plugin type and add to existing one / 2. Download the example plugin and modify and same.
Unfortunately, both way are cumbersome to configure and not documented well.

Official document describes what needed to be done to work project as a plugin, but explanation is not thorough, the change item is too many and can easily missed.

As far as I figured out :

  1. Copy Plugin project to {Project Dir}\Plugins\
  2. Open projectā€™s .flaxproj with a text editor and add Reference conf string refer to the template
  3. Open projectā€™s {Project Dir}\Source\Game\Game.Build.cs with a text editor and add options.PrivateDependencies.Add string refer to the template class name you want to configure
  4. Go to {Project Dir}\Plugins{Plugin Name}\ and delete Game.Gen.cs
  5. Go to {Project Dir}\Plugins{Plugin Name}\ and rename Game(Editor)Target.Build.cs files into {Plugin Name}(Editor)Target.Build.cs.
  6. Go to {Project Dir}\Plugins{Plugin Name}\Game\ and delete Game.Build.cs
  7. Go to {Project Dir}\Plugins{Plugin Name}\ and rename directory ā€˜Gameā€™ into {Plugin Name}
  8. Open {Project Dir}\Plugins{Plugin Name}{Plugin Name}EditorTarget.Build.cs with a text editor and modify GameEditorTarget class declation into {Plugin Name}{Editor target class postfix name}
  9. Change string for Modules.Add(ā€œGameā€) into Modules.Add("{Plugin Name}") and add another line for editor module if you want to
  10. Open {Project Dir}\Plugins{Plugin Name}{Plugin Name}Target.Build.cs with a text editor and modify GameEditorTarget class declation into {Plugin Name}{target class postfix name}
  11. Change string for Modules.Add(ā€œGameā€) into Modules.Add("{Plugin Name}")
  12. Create your code inside plugin source
  13. Add _description fill code inside your GamePlugin class (C++) or create PluginDescription filled (C#) to be shown in Plugin window list (editor)

You can skip a few steps with Example Plugin repository, but still have to rename a lot of things manually by your hand.

As you see, the process just to ā€œrename things to fit in the new name and un-standalonizeā€ is to much fragmented into pieces and easy to miss. It is possible, but currently it is in very handcrafting way.

Engine needs utility to automatically generate ā€˜plugin-typeā€™ project and fill the class names, module names, file and directory names from the Plugin name.

For Flax 1.7 we got cool improvements in this area:

2 Likes

Thanks, itā€™s promising!
Unfortunately master version engine does not run for me, but expecting next 1.7 release.

Tested with this officially supported item for Clone Plugin, but didnā€™t worked. it just created an empty directory inside ā€˜Pluginsā€™ and nothing happens. No network activity appears in system monitorā€¦

Tried ā€˜Run as Administratorā€™ but nothing was different. Not sure this is system specific problem. Too badā€¦

It works fine for me. Do you have git installed? It is a requirement for the clone plugin feature to work. Also it is set up so that there should be errors in the log if there is an issue with cloning, best to share those if you have an issue.

I am using external git, not merged into environment path. It might be the difference.

Possible ++ Requirement for editor : git executable installation, configured with system path

For record, I couldnā€™t see any log lines writing in log window when clicking ā€˜Clone Pluginā€™ button.
After that I installed the plugin manually, so didnā€™t watch log files directly.

Anyway I agree that git is the key