فهرست منبع

[ue4] Fixes #2006

Users project recursively generates UIs, which leads to extremely long resource names. Eventually, assigning such a name to a brush results in an assertion being triggered, as the name is too long. Fixed on our end by creating a custom resource name instead of reusing the name of the material. User still has to clean-up their code.
badlogic 3 سال پیش
والد
کامیت
d065c88ca8
1فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 6 1
      spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp

+ 6 - 1
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SSpineWidget.cpp

@@ -45,12 +45,17 @@
 
 using namespace spine;
 
+static int brushNameId = 0;
+
 // Workaround for https://github.com/EsotericSoftware/spine-runtimes/issues/1458
 // See issue comments for more information.
 struct SpineSlateMaterialBrush : public FSlateBrush {
 	SpineSlateMaterialBrush(class UMaterialInterface &InMaterial, const FVector2D &InImageSize)
 		: FSlateBrush(ESlateBrushDrawType::Image, FName(TEXT("None")), FMargin(0), ESlateBrushTileType::NoTile, ESlateBrushImageType::FullColor, InImageSize, FLinearColor::White, &InMaterial) {
-		ResourceName = FName(*InMaterial.GetFullName());
+		// Workaround for https://github.com/EsotericSoftware/spine-runtimes/issues/2006
+		FString brushName = TEXT("spineslatebrush");
+		brushName.AppendInt(brushNameId++);
+		ResourceName = FName(brushName);
 	}
 };