If I have a UFUNCTION that is referenced by a macro library, when hot-reloaded, this leads to a ‘Graph is Linked to External Object’ error when trying to save any blueprint that uses said macro. Doing “File → Refresh All nodes” on the macro library followed also refreshing and recompiling the blueprint seems to fix it.
Unfortunately, there is no indication of which macro library is the culprit at any given time.
Even knowing, it’s already becoming untenable to use macro libraries as such, even with only a few blueprints, since this happens for every hot reload, not just reloads that change the UFUNCTION.
It would be nice if the engine could refresh at least the macro library automatically, so only blueprints would need refreshed. Refreshing everything would be ideal, of course.
edit: Details!
Should reproduce, though I haven’t tried it twice:
- Create a new C++ class based on Blueprint Function Library.
- Add a function.
- Create a Macro Library; this can probably be based on anything. I’ve used both ActorComponent and Object.
- Reference the C++ function in the Macro Library.
- Use the macro in a blueprint (let’s say an ActorComponent).
- Cause your C++ to be rebuilt, resulting in a hot reload
- Modify and try to save the latter ActorComponent. This should result in the error.
The code is being compiled directly into the game in this case, not a plugin.
edit 2: There is also an USTRUCT that is pass-by-reference to the macro and function. I’m not sure if this changes anything. The USTRUCT is declared in the same file as the Blueprint Function Library.
edit 3: Updated to 4.14.3 and this still seems to be an issue. Going to try making a plugin for this code and see if I can isolate the “utility” stuff from the main game code, and if this will at least reduce the frequency of having to refresh everything.