Mystfit / Unreal-StableDiffusionTools

Animate Unreal Engine scenes using Stable Diffusion
MIT License
252 stars 29 forks source link

Sequencer - Use of editor as dependency in non-editor targets #21

Open mateuszwojt opened 1 year ago

mateuszwojt commented 1 year ago

I'm building the plugin using command-line tools (UAT) for "reasons", which unfortunately triggers a lot of errors and warnings. This doesn't happen when compiling with Visual Studio

In my case, the build fails because the StableDiffusionSequencer module is using UnrealEd as one of the dependencies, even though it's a runtime module. I'm getting the following error:

Unable to instantiate module 'UnrealEd': Unable to instantiate UnrealEd module for non-editor targets.
(referenced via Target -> StableDiffusionSequencer.Build.cs)

My workaround was changing it from Runtime to the deprecated Developer type, but this is not ideal of course. I'm not sure what should be the correct approach here. I found that issue in some other plugins, like DLSS.

Mystfit commented 1 year ago

I split the Sequencer into editor and runtime modules to try and tackle exactly this sort of issue but it seems as though that dependency has hung around for some reason. I'll try and remove it from the runtime sequencer module and see what that breaks.

Mystfit commented 1 year ago

Sorry that this has taken me a while to get around to. I'm experimenting making sure editor modules are only compiled in the editor. Would you be able to add the following code to StableDIffusionSequencer.Build.cs and remove the existing UnrealEd and EditorFramework references from PrivateDependencyModuleNames?

if (Target.bBuildEditor){
    PrivateDependencyModuleNames.AddRange(new string[]{
        "UnrealEd",
        "EditorFramework"
    });
}