How to use an enum from a different header in blueprints?
I have a third party library I am creating a plugin for in UE4. The library has a ton of different enums and structs. I don't have any problems interacting with the structs but all of the enums give an error. I was hoping someone could shed some light on this problem.
I'd also like to expose the enums so that they can be selected via blueprints and I'm not sure what the most efficient way of doing that is. If I create a new enum at the top of the file using the same exact structure I have no problems but if its in another file and I try to include that file and use the enum it doesn't work.
The enums are defined in the header file like this and give an error Unrecognized type 'STATE_ENUM':
I've discovered that I can use the ENUM in my code it has an issue specifically when I define a function or property with UFUNCTION or UPROPERTY that it fails. In this scenario I get 'StateID: Expected the name of a previously defined enum'.
So ultimately I ended up moving the ThirdParty lib into the plugin instead of in its own module so that the header file could be seen by UHT which appears to be what the problem was. Now I can expose anything in that header file to blueprints pretty easily assuming the types match up.
answered Feb 03 '15 at 04:30 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here