hugoattal / DarkerNodes

Modern theme for the Unreal editor
51 stars 2 forks source link

Source control checkout #182

Open eddiebeazer opened 1 year ago

eddiebeazer commented 1 year ago

I'm not sure if I missed this in the documentation or another issue but every single time I open my project, Perforce wants me to checkout all of the shaders inside of the Content/Materials folder of this plugin. Not a big issue, my problem that I'm having with them is that when I try to run the DerivedDataCache -fill commandlet I get this issue due to the those files

[09:47:54 ] Directory mappings are:
[09:47:54 ]   /Engine -> ../../../Engine/Shaders
[09:47:54 ]    /ShaderAutogen -> C:/BuildAgent/work/3fef798aa8768f91/Intermediate/ShaderAutogen
[09:47:54 ]   /Plugin/GLTFExporter -> ../../../Engine/Plugins/Enterprise/GLTFExporter/Shaders
[09:47:54 ]    /Plugin/FX/Niagara -> ../../../Engine/Plugins/FX/Niagara/Shaders
[09:47:54 ]    /Plugin/ExrReaderShaders -> ../../../Engine/Plugins/Media/ImgMedia/Shaders
[09:47:54 ]  /Plugin/Experimental/ChaosNiagara -> ../../../Engine/Plugins/Experimental/ChaosNiagara/Shaders
[09:47:54 ]  [2023.09.11-13.47.54:795][  0]LogShaders: Error: Can't map virtual shader source path "/DarkerNodes/Button.usf".

That above error pops up for every file in the Content/Materials folder,

I'm able to run that commandlet if I delete the Plugins/DarkerNodes/Content/Materials folder. I just have two questions

hugoattal commented 1 year ago

Sorry for this...

Hum, so to prevent bugs, Darker Nodes recompile its shaders at the launch. That's why Perforce would want to checkout shaders (as UE probably add some kind of timestamp to the compiled shader?), but you could add it to your p4ignore without any problem.

The DarkerNodes/Button.usf and everything in DarkerNodes/Content/Material are the material shaders used for updated UI on the Darker Nodes theme. So it's pretty useful: if you delete them, you might have weird black or bliking glitches on some elements of the engine.

I admit I'm not familiar with the "DerivedDataCache" commandlet... Could you guide me through a minimal reproduction on a blank project, so that I can try to fix this?

eddiebeazer commented 1 year ago

Thanks for the response and nothing to be sorry about, the plugin works great and I feel like my use case is definitely not the majority.

DDC Documentation, scroll down to "Building Derived Data" to find the command to run it. I'm using the third person template, have the DarkerNodes plugin installed. I do have the plugin in my project folder rather than engine, not sure if that will cause an issue in terms of replicating the bug.

All that being said, I wouldn't mind this issue being closed if you don't have the time to work on an edge case like this. I mostly opened to see if it was something you were aware of and if there was a more permanent solution. So far my solution of deleting that folder during builds has worked well since I run that commandlet only on a build machine and my actual workstation has the correct files.

hugoattal commented 1 year ago

I do have the plugin in my project folder rather than engine, not sure if that will cause an issue in terms of replicating the bug.

Could you try using the engine folder instead? This is more the intended use (having the plugin in the Engine/Plugins/Marketplace folder).

I'll have a look anyway.

eddiebeazer commented 1 year ago

I also missed some details. I run the command with

UnrealEditor.exe -run=DerivedDataCache  -projectonly -targetplatform=Windows -nullrhi

The command in the documentation will try to build the DDC for the entire engine with the default command. I didn't think about using the engine folder instead, I can say that if I did I would not have this issue because that command would not load the shaders since its only looking at the projects plugin and content folders

AWildErin commented 9 months ago

Hi, this issue is a few months old but it seems related to what I'm having.

I have the plugin in my project, but when I package the project, I always get the same error above. I've narrowed it down to it not loading the module for commandlets, which is because the plugin is specified not to.

I've fixed it in my project by replacing the module type with Editor instead of EditorNoCommandlet, but I'm not 100% sure if this is the best fix. I assume the issue is that, because the module isn't loaded, Unreal isn't being given the directory through AddShaderSourceDirectoryMapping.

hugoattal commented 9 months ago

Sorry for this... I'll be unavailable for the next week, I'll take a look the week after.

Maybe linked to https://github.com/hugoattal/DarkerNodes/issues/131