SSubstanceEditorPanel.cpp error is preventing me from building the the source engine

So i downloaded the source engine (4.10), and i copied the substance folder into the source engine folder. I ran the GenerateProjectFiles.bat to recreate the solution to include Substance and when i try to build it gives out this error seen in the screen shot. I’m also doing the build as a Development Editor. Any suggestion?? i really need this working asap!

Hi Sy_U,

I would recommend grabbing the substance plugin source from github: https://github.com/Allegorithmic/UnrealEngine

The errors you are coming up with look like something I fixed when doing version migration, so I would start there.

So i downloaded the engine from the git hub, but do i need to build that unreal engine?? or just take the substance plugin straight from the folder and put it in the current source engine im using?? thanks!

Hi Sy_U,

You don’t need to build ours, you can just copy the Plugins/Substance folder to your source engine, re-run GenerateProjectFiles.bat, and recompile.

That didn’t work. Still same error. Here is the output about substance if it helps

>D:\Epic Games\UnrealEngine\Engine\Plugins\Substance\Source\SubstanceEditor\Private\SSubstanceEditorPanel.cpp(198): error C2664: ‘bool IsReferenced(UObject *&,EObjectFlags,EInternalObjectFlags,bool,FReferencerInformationList *)’: cannot convert argument 3 from ‘bool’ to ‘EInternalObjectFlags’
5> D:\Epic Games\UnrealEngine\Engine\Plugins\Substance\Source\SubstanceEditor\Private\SSubstanceEditorPanel.cpp(198): note: Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
5>D:\Epic Games\UnrealEngine\Engine\Plugins\Substance\Source\SubstanceEditor\Private\SSubstanceEditorPanel.cpp(258): error C2664: ‘bool IsReferenced(UObject *&,EObjectFlags,EInternalObjectFlags,bool,FReferencerInformationList *)’: cannot convert argument 3 from ‘bool’ to ‘EInternalObjectFlags’
5> D:\Epic Games\UnrealEngine\Engine\Plugins\Substance\Source\SubstanceEditor\Private\SSubstanceEditorPanel.cpp(258): note: Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
5>D:\Epic Games\UnrealEngine\Engine\Plugins\Substance\Source\SubstanceEditor\Private\SSubstanceEditorPanel.cpp(314): error C2664: ‘bool IsReferenced(UObject *&,EObjectFlags,EInternalObjectFlags,bool,FReferencerInformationList *)’: cannot convert argument 3 from ‘bool’ to ‘EInternalObjectFlags’
5> D:\Epic Games\UnrealEngine\Engine\Plugins\Substance\Source\SubstanceEditor\Private\SSubstanceEditorPanel.cpp(314): note: Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
5>D:\Epic Games\UnrealEngine\Engine\Plugins\Substance\Source\SubstanceEditor\Private\SSubstanceEditorPanel.cpp(321): error C2664: ‘bool IsReferenced(UObject *&,EObjectFlags,EInternalObjectFlags,bool,FReferencerInformationList *)’: cannot convert argument 3 from ‘bool’ to ‘EInternalObjectFlags’
5> D:\Epic Games\UnrealEngine\Engine\Plugins\Substance\Source\SubstanceEditor\Private\SSubstanceEditorPanel.cpp(321): note: Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)

>ERROR : UBT error : Failed to produce item: D:\Epic Games\UnrealEngine\Engine\Plugins\Substance\Binaries\Win64\UE4Editor-SubstanceEditor.dll

Hi Sy_U,

are you sure you are building from 4.10?

Because in 4.11 Preview I had to change those lines. Here is one diff as an example:

Before


08b480c0 (Josh Coyne 2015-12-21 12:37:43 -0500  224)            bool bIsReferenced = TextureObject ? IsReferenced(TextureObject, GARBAGE_COLLECTION_KEEPFLAGS, true, &Refs) : false;

After


a5fa6721 (Josh Coyne 2016-01-08 11:04:41 -0500  224)            bool bIsReferenced = TextureObject ? IsReferenced(TextureObject, GARBAGE_COLLECTION_KEEPFLAGS, EInternalObjectFlags::GarbageCollectionKeepFlags, true, &Refs) : false;

Check that you are running 4.10 proper (and not say master branch) and if it is later than 4.10, try the second code entry provided.

I am using 4.10, but i dont know what you mean by proper?? I will definitely give these lines a try. Ill get back as soon as i can

Hi Sy_U,

For example when I build the Substance Plugin I try to make sure I’m building from tags, such as 4.10.0-release etc, so that the codeline is something easily built from. It could be possible your version is 4.10 but using more updated code that eventually has made its way into master and now 4.11.

Ultimately it shouldn’t matter much, but that’s my thought process :slight_smile:

The one with the EInternalObjectFlags::GarbageCollectionKeepFlags flag works! Thank you!! Also i realized that i downloaded the substance 4.10 from the github, should i have downloaded the master branch??

Hi Sy_U,

Fantastic! I’m glad it worked out. I believe the 4.10 branch should be the acceptable one, but typically what I do is I download based on releases:

https://github.com/EpicGames/UnrealEngine/releases

Then you do something like git checkout 4.10.4-release and it will make sure you are precisely on that code release.