Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for not scanning blueprints from some plugins within project #24

Merged
merged 2 commits into from
Feb 14, 2024

Conversation

markdotai
Copy link
Contributor

Fix for not scanning blueprints which are child classes of a native class from a module which is not in a folder with the same name as the module.

When choosing which blueprints to scan the code seems to assume that every module is within a folder of the same name (as it uses the folder name to get the module name). But we have some plugins within our game project, and a lot of the modules are within folders which have a different name. E.g. "Runtime" or "Editor".
So this change instead uses the file name, and assumes it does match the module name in the format: Module.Build.cs
This works for us ... but clearly someone should verify/decide if it is appropriate for all cases ...

…lass from a module which is not in a folder with the same name as the module.
@hnrqbaggio hnrqbaggio self-assigned this Aug 2, 2023
@hnrqbaggio
Copy link
Contributor

Thanks for the contribution @markdotai. If you don't mind, I'd would like to setup a local repro to validate this change before we merge. Is this a good description of the repro steps?

  1. Have a game/plugin module where the containing folder and the .build.cs file have different names
  2. Have a blueprint that extends a class in that module
  3. Run the scan

Is there anything else I would need to repro the problem?
Thanks!

@markdotai
Copy link
Contributor Author

markdotai commented Aug 3, 2023

Hi :) Thanks for looking at it! That sounds a great idea - and those steps look good to me.
Like you mention, in theory it could work for a game module too but I haven't tried that. (Ours are in matching folders there!)


One interesting example with the scanning:

  • AExamplePluginActor C++ class from ExampleModule in a plugin (within a folder called DifferentlyNamedFolder).
  • AExampleGameActor C++ class derived from AExamplePluginActor in the game module.
  • BP_ExamplePluginActor blueprint class derived from AExamplePluginActor.
  • BP_ExampleGameActor blueprint derived from AExampleGameActor.

Then looking at the UCLASS declaration of AExamplePluginActor in Visual Studio it will show a blueprint reference for BP_ExampleGameActor and it won't show the BP_ExamplePluginActor.


This is roughly how our folder structure looks (so we haven't given the full name to the Editor and Runtime folders ...)
Root
-- Engine (UE source)
-- Game
---- Plugins
------ ExamplePlugin
-------- Source
---------- Editor
------------ ExamplePluginEditor.Build.cs
---------- Runtime
------------ ExamplePluginRuntime.Build.cs
---- Source
------ Project
-------- Project.Build.cs
------ ProjectEditor
-------- ProjectEditor.Build.cs

Copy link
Contributor

@hnrqbaggio hnrqbaggio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @markdotai. Sorry for the long delay on this PR.

The overall changes look good to me. Approved.
Thank you!

@hnrqbaggio hnrqbaggio merged commit 10d8230 into microsoft:main Feb 14, 2024
1 check passed
@markdotai
Copy link
Contributor Author

Awesome, thanks for checking it! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants