Author Topic: Fixed crash loading the plugin on a custom ue4 macos project  (Read 127 times)

Hello,

my compiled project , on a mac, was getting an assertion when loading the substance plugin.

It turned out the plugin code wasn't looking in all possible places for the libsubstance_sse2_blend.dylib  and missed the Project/Marketplace plugins folder where, in my case, the lib was. I didn't do anything fancy to have it built there, mine was a simple Ue4 with substance on a mac compiled via xcode.

So to avoid moving the lib by hand in one of the supported folder in `void FSubstanceCoreModule::StartupModule()` I've replaced this

Code: [Select]

        //The plugin can exist in a few different places, so lets try each one in turn
FString prefixPaths[] =
{
FPaths::Combine(*FPaths::ProjectPluginsDir(), TEXT("Runtime/")),
FPaths::Combine(*FPaths::EnginePluginsDir(), TEXT("Runtime/")),
FPaths::Combine(*FPaths::EnginePluginsDir(), TEXT("Marketplace/")),
};

with this

Code: [Select]

        //The plugin can exist in a few different places, so lets try each one in turn
FString prefixPaths[] =
{
FPaths::Combine(*FPaths::ProjectPluginsDir(), TEXT("Runtime/")),
                FPaths::Combine(*FPaths::ProjectPluginsDir(), TEXT("Marketplace/")),
FPaths::Combine(*FPaths::EnginePluginsDir(), TEXT("Runtime/")),
FPaths::Combine(*FPaths::EnginePluginsDir(), TEXT("Marketplace/")),
};

and now works properly.


Hello,

my compiled project , on a mac, was getting an assertion when loading the substance plugin.

It turned out the plugin code wasn't looking in all possible places for the libsubstance_sse2_blend.dylib  and missed the Project/Marketplace plugins folder where, in my case, the lib was. I didn't do anything fancy to have it built there, mine was a simple Ue4 with substance on a mac compiled via xcode.

So to avoid moving the lib by hand in one of the supported folder in `void FSubstanceCoreModule::StartupModule()` I've replaced this

Code: [Select]

        //The plugin can exist in a few different places, so lets try each one in turn
FString prefixPaths[] =
{
FPaths::Combine(*FPaths::ProjectPluginsDir(), TEXT("Runtime/")),
FPaths::Combine(*FPaths::EnginePluginsDir(), TEXT("Runtime/")),
FPaths::Combine(*FPaths::EnginePluginsDir(), TEXT("Marketplace/")),
};

with this

Code: [Select]

        //The plugin can exist in a few different places, so lets try each one in turn
FString prefixPaths[] =
{
FPaths::Combine(*FPaths::ProjectPluginsDir(), TEXT("Runtime/")),
                FPaths::Combine(*FPaths::ProjectPluginsDir(), TEXT("Marketplace/")),
FPaths::Combine(*FPaths::EnginePluginsDir(), TEXT("Runtime/")),
FPaths::Combine(*FPaths::EnginePluginsDir(), TEXT("Marketplace/")),
};

and now works properly.

@ilwoody ,

Glad to hear you were able to solve the problem. :)

Just to verify though, what folder did you place the plugin in? It should be in the project folder like this: *PROJECTNAME*/Plugins/Runtime/Substance