Skip to content

Commit

Permalink
UnrealPlugin HotFixes: CrashFix for FG-Bluson-Library, Windows Build …
Browse files Browse the repository at this point in the history
…Fixes
  • Loading branch information
danielbui78 committed May 23, 2022
1 parent 90fe7d3 commit 53886da
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ UObject* FDazToUnrealModule::ImportFromDaz(TSharedPtr<FJsonObject> JsonObject)
if (!FDazToUnrealUtils::MakeDirectoryAndCheck(ImportDirectory)) return nullptr;
if (!FDazToUnrealUtils::MakeDirectoryAndCheck(ImportCharacterFolder)) return nullptr;
if (!FDazToUnrealUtils::MakeDirectoryAndCheck(ImportCharacterTexturesFolder)) return nullptr;
#if __APPLE__
#if PLATFORM_MAC
if (!FDazToUnrealUtils::MakeDirectoryAndCheck(LocalDAZImportFolder)) return nullptr;
if (!FDazToUnrealUtils::MakeDirectoryAndCheck(LocalDAZAnimationImportFolder)) return nullptr;
if (!FDazToUnrealUtils::MakeDirectoryAndCheck(LocalCharacterFolder)) return nullptr;
Expand Down Expand Up @@ -856,7 +856,7 @@ UObject* FDazToUnrealModule::ImportFromDaz(TSharedPtr<FJsonObject> JsonObject)

// If there are any subdivisions, load the base FBX
FbxScene* BaseScene = nullptr;
#if __APPLE__
#if PLATFORM_MAC
// Subdivision support in DazStudioPlugin
#else
// NOTE: This is for backward-compatibility, all subdivision support already in DazStudioPlugin
Expand Down Expand Up @@ -894,7 +894,7 @@ UObject* FDazToUnrealModule::ImportFromDaz(TSharedPtr<FJsonObject> JsonObject)
}
}

#if __APPLE__
#if PLATFORM_MAC
// Subdivision support in DazStudioPlugin
#else
// NOTE: This is for backward-compatibility, all subdivision support already in DazStudioPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,14 @@ void FDazToUnrealMaterials::CorrectDazShaders(FString MaterialName, TMap<FString
return;
}

TArray<FDUFTextureProperty> Properties = MaterialProperties[MaterialName];
if (Properties.Num() == 0)
{
// This material was likely remapped to a base material and removed
UE_LOG(LogTemp, Warning, TEXT("CorrectDazShaders(): INFO: MaterialName has no properties: %s"), *MaterialName);
return;
}

FString ShaderName = MaterialProperties[MaterialName][0].ShaderName;
FString sMaterialAssetName = MaterialProperties[MaterialName][0].MaterialAssetName;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if __APPLE__
#if PLATFORM_MAC
// Subdivision support in DazStudioPlugin
#else
// NOTE: This is for backward-compatibility, all subdivision support already in DazStudioPlugin
Expand Down Expand Up @@ -219,4 +219,4 @@ void FDazToUnrealSubdivision::SubdivideMesh(FbxNode* BaseNode, FbxNode* TranferW
}
}

#endif // __APPLE__
#endif // PLATFORM_MAC

0 comments on commit 53886da

Please sign in to comment.