diff --git a/Content/Blueprints/Player/GI.uasset b/Content/Blueprints/Player/GI.uasset index cb9e2c175..266168eb5 100644 Binary files a/Content/Blueprints/Player/GI.uasset and b/Content/Blueprints/Player/GI.uasset differ diff --git a/Content/Blueprints/Player/GameplayFunctions.uasset b/Content/Blueprints/Player/GameplayFunctions.uasset index d040d448e..f1526afb2 100644 Binary files a/Content/Blueprints/Player/GameplayFunctions.uasset and b/Content/Blueprints/Player/GameplayFunctions.uasset differ diff --git a/Content/Blueprints/Player/MyPC.uasset b/Content/Blueprints/Player/MyPC.uasset index a91c0973b..373f5460a 100644 Binary files a/Content/Blueprints/Player/MyPC.uasset and b/Content/Blueprints/Player/MyPC.uasset differ diff --git a/Content/Blueprints/Player/WalkingPawn.uasset b/Content/Blueprints/Player/WalkingPawn.uasset index 6b96ea635..5b3bcad1b 100644 Binary files a/Content/Blueprints/Player/WalkingPawn.uasset and b/Content/Blueprints/Player/WalkingPawn.uasset differ diff --git a/Content/Blueprints/UI/Actors/KPmaker.uasset b/Content/Blueprints/UI/Actors/KPmaker.uasset index dd5ff89f9..8e81a80b5 100644 Binary files a/Content/Blueprints/UI/Actors/KPmaker.uasset and b/Content/Blueprints/UI/Actors/KPmaker.uasset differ diff --git a/Content/Blueprints/UI/Actors/actorTourHider.uasset b/Content/Blueprints/UI/Actors/actorTourHider.uasset index 949ee9bb2..449715559 100644 Binary files a/Content/Blueprints/UI/Actors/actorTourHider.uasset and b/Content/Blueprints/UI/Actors/actorTourHider.uasset differ diff --git a/Content/Blueprints/UI/Actors/parkingPoint.uasset b/Content/Blueprints/UI/Actors/parkingPoint.uasset index 611c49a31..e4f6923a4 100644 Binary files a/Content/Blueprints/UI/Actors/parkingPoint.uasset and b/Content/Blueprints/UI/Actors/parkingPoint.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/MainMenu.uasset b/Content/Blueprints/UI/WBPS/Menu/MainMenu.uasset index fa35c29b6..88d9f9130 100644 Binary files a/Content/Blueprints/UI/WBPS/Menu/MainMenu.uasset and b/Content/Blueprints/UI/WBPS/Menu/MainMenu.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/bottomMenu.uasset b/Content/Blueprints/UI/WBPS/Menu/bottomMenu.uasset index 43dc48ce4..0ebc0c4b0 100644 Binary files a/Content/Blueprints/UI/WBPS/Menu/bottomMenu.uasset and b/Content/Blueprints/UI/WBPS/Menu/bottomMenu.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/floorInfo.uasset b/Content/Blueprints/UI/WBPS/Menu/floorInfo.uasset index 908082782..91c4bee43 100644 Binary files a/Content/Blueprints/UI/WBPS/Menu/floorInfo.uasset and b/Content/Blueprints/UI/WBPS/Menu/floorInfo.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/houseInfo.uasset b/Content/Blueprints/UI/WBPS/Menu/houseInfo.uasset index ffeb7ad80..54bd2d263 100644 Binary files a/Content/Blueprints/UI/WBPS/Menu/houseInfo.uasset and b/Content/Blueprints/UI/WBPS/Menu/houseInfo.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/parkingPlaceInfo.uasset b/Content/Blueprints/UI/WBPS/Menu/parkingPlaceInfo.uasset index e39702067..f0eecd479 100644 Binary files a/Content/Blueprints/UI/WBPS/Menu/parkingPlaceInfo.uasset and b/Content/Blueprints/UI/WBPS/Menu/parkingPlaceInfo.uasset differ diff --git a/Content/Blueprints/UI/WBPS/Menu/selectFloor.uasset b/Content/Blueprints/UI/WBPS/Menu/selectFloor.uasset index 7bcc53582..a35c88444 100644 Binary files a/Content/Blueprints/UI/WBPS/Menu/selectFloor.uasset and b/Content/Blueprints/UI/WBPS/Menu/selectFloor.uasset differ diff --git a/Content/Blueprints/world/BM_Elevator.uasset b/Content/Blueprints/world/BM_Elevator.uasset index 852f56dfe..7b0ac245f 100644 Binary files a/Content/Blueprints/world/BM_Elevator.uasset and b/Content/Blueprints/world/BM_Elevator.uasset differ diff --git a/Content/Maps/Interior/Parking/Parking.umap b/Content/Maps/Interior/Parking/Parking.umap index 2f1c1f18f..185d25531 100644 Binary files a/Content/Maps/Interior/Parking/Parking.umap and b/Content/Maps/Interior/Parking/Parking.umap differ diff --git a/Content/Maps/mainScene.umap b/Content/Maps/mainScene.umap index a34432666..2a0821ee5 100644 Binary files a/Content/Maps/mainScene.umap and b/Content/Maps/mainScene.umap differ diff --git a/Masharov.uproject b/Masharov.uproject index aa41479a1..e2e49e1b8 100644 --- a/Masharov.uproject +++ b/Masharov.uproject @@ -349,6 +349,10 @@ { "Name": "RLPlugin", "Enabled": false + }, + { + "Name": "base64plugin", + "Enabled": false } ] } \ No newline at end of file diff --git a/Masharovdev.uproject b/Masharovdev.uproject index 9ca9efe29..b345536cd 100644 --- a/Masharovdev.uproject +++ b/Masharovdev.uproject @@ -349,6 +349,10 @@ { "Name": "PixelStreaming", "Enabled": true + }, + { + "Name": "base64plugin", + "Enabled": true } ] } \ No newline at end of file diff --git a/Plugins/base64plugin/Resources/Icon128.png b/Plugins/base64plugin/Resources/Icon128.png new file mode 100644 index 000000000..5d4dc158b Binary files /dev/null and b/Plugins/base64plugin/Resources/Icon128.png differ diff --git a/Plugins/base64plugin/Source/base64plugin/Private/base64plugin.cpp b/Plugins/base64plugin/Source/base64plugin/Private/base64plugin.cpp new file mode 100644 index 000000000..b57a24888 --- /dev/null +++ b/Plugins/base64plugin/Source/base64plugin/Private/base64plugin.cpp @@ -0,0 +1,22 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "base64plugin.h" + +#define LOCTEXT_NAMESPACE "Fbase64pluginModule" + +void Fbase64pluginModule::StartupModule() +{ + // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module + +} + +void Fbase64pluginModule::ShutdownModule() +{ + // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, + // we call this function before unloading the module. + +} + +#undef LOCTEXT_NAMESPACE + +IMPLEMENT_MODULE(Fbase64pluginModule, base64plugin) \ No newline at end of file diff --git a/Plugins/base64plugin/Source/base64plugin/Private/base64pluginBPLibrary.cpp b/Plugins/base64plugin/Source/base64plugin/Private/base64pluginBPLibrary.cpp new file mode 100644 index 000000000..9c0588e8e --- /dev/null +++ b/Plugins/base64plugin/Source/base64plugin/Private/base64pluginBPLibrary.cpp @@ -0,0 +1,106 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "base64pluginBPLibrary.h" +#include "base64plugin.h" + +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Misc/Base64.h" +#include "Engine/TextureRenderTarget2D.h" +#include "ImageUtils.h" +#include "Math/Color.h" +#include "Misc/FileHelper.h" + +Ubase64pluginBPLibrary::Ubase64pluginBPLibrary(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ + +} + +TArray readRT(UTextureRenderTarget2D* TextureRenderTarget) { + TArray OutLDRValues; + TArray OutHDRValues; + + if (!TextureRenderTarget) + { + return OutLDRValues; + } + + FTextureRenderTarget2DResource* RTResource = (FTextureRenderTarget2DResource*)TextureRenderTarget->GameThread_GetRenderTargetResource(); + if (!RTResource) + { + return OutLDRValues; + } + + FReadSurfaceDataFlags ReadSurfaceDataFlags; + + FRenderTarget* RenderTarget = TextureRenderTarget->GameThread_GetRenderTargetResource(); + + const int32 NumPixelsToRead = TextureRenderTarget->SizeX * TextureRenderTarget->SizeY; + + switch (TextureRenderTarget->GetFormat()) + { + case PF_B8G8R8A8: + OutLDRValues.SetNumUninitialized(NumPixelsToRead); + if (!RenderTarget->ReadPixelsPtr(OutLDRValues.GetData(), ReadSurfaceDataFlags)) + { + return OutLDRValues; + } + break; + case PF_FloatRGBA: + OutHDRValues.SetNumUninitialized(NumPixelsToRead); + if (!RenderTarget->ReadLinearColorPixelsPtr(OutHDRValues.GetData(), ReadSurfaceDataFlags)) + { + + for (auto i : OutHDRValues) + { + OutLDRValues.Add(i.ToFColor(true)); + } + return OutLDRValues; + } + break; + + + default: + return OutLDRValues; + } + return OutLDRValues; +} + +void RTtoBytes(UTextureRenderTarget2D* TextureRenderTarget, TArray& DstData) +{ + if (TextureRenderTarget) { + TArray SrcData = readRT(TextureRenderTarget); + if (SrcData.Num() > 0) { + FImageUtils::CompressImageArray(TextureRenderTarget->SizeX, TextureRenderTarget->SizeY, SrcData, DstData); + } + } +} + +bool Ubase64pluginBPLibrary::bytesToBase64(const TArray& source, FString& out) { + if (source.Num() > 0) + { + out = FBase64::Encode(source); + return true; + } + + out = FString(); + return false; +} + +bool Ubase64pluginBPLibrary::fileToBase64(FString filePath, FString& out) { + TArray outArray; + if (FFileHelper::LoadFileToArray(outArray, *filePath)) { + //out=FBase64::Encode(outArray); + return bytesToBase64(outArray, out); + } + return false; + +} +bool Ubase64pluginBPLibrary::renderTargetToBase64(UTextureRenderTarget2D* RT, FString& out) { + TArray tempArr; + RTtoBytes(RT, tempArr); + return bytesToBase64(tempArr, out); +} + diff --git a/Plugins/base64plugin/Source/base64plugin/Public/base64plugin.h b/Plugins/base64plugin/Source/base64plugin/Public/base64plugin.h new file mode 100644 index 000000000..fd24df09a --- /dev/null +++ b/Plugins/base64plugin/Source/base64plugin/Public/base64plugin.h @@ -0,0 +1,14 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Modules/ModuleManager.h" + +class Fbase64pluginModule : public IModuleInterface +{ +public: + + /** IModuleInterface implementation */ + virtual void StartupModule() override; + virtual void ShutdownModule() override; +}; diff --git a/Plugins/base64plugin/Source/base64plugin/Public/base64pluginBPLibrary.h b/Plugins/base64plugin/Source/base64plugin/Public/base64pluginBPLibrary.h new file mode 100644 index 000000000..920c78930 --- /dev/null +++ b/Plugins/base64plugin/Source/base64plugin/Public/base64pluginBPLibrary.h @@ -0,0 +1,36 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "Kismet/BlueprintFunctionLibrary.h" +#include "base64pluginBPLibrary.generated.h" + +/* +* Function library class. +* Each function in it is expected to be static and represents blueprint node that can be called in any blueprint. +* +* When declaring function you can define metadata for the node. Key function specifiers will be BlueprintPure and BlueprintCallable. +* BlueprintPure - means the function does not affect the owning object in any way and thus creates a node without Exec pins. +* BlueprintCallable - makes a function which can be executed in Blueprints - Thus it has Exec pins. +* DisplayName - full name of the node, shown when you mouse over the node and in the blueprint drop down menu. +* Its lets you name the node using characters not allowed in C++ function names. +* CompactNodeTitle - the word(s) that appear on the node. +* Keywords - the list of keywords that helps you to find node when you search for it using Blueprint drop-down menu. +* Good example is "Print String" node which you can find also by using keyword "log". +* Category - the category your node will be under in the Blueprint drop-down menu. +* +* For more info on custom blueprint nodes visit documentation: +* https://wiki.unrealengine.com/Custom_Blueprint_Node_Creation +*/ +UCLASS() +class Ubase64pluginBPLibrary : public UBlueprintFunctionLibrary +{ + GENERATED_UCLASS_BODY() +public: + UFUNCTION(BlueprintCallable,Category="base64Encoders") + static bool bytesToBase64(const TArray& source, FString & out); + UFUNCTION(BlueprintCallable, Category = "base64Encoders") + static bool fileToBase64(FString filePath, FString & out); + UFUNCTION(BlueprintCallable, Category = "base64Encoders") + static bool renderTargetToBase64(UTextureRenderTarget2D * RT, FString & out); +}; diff --git a/Plugins/base64plugin/Source/base64plugin/base64plugin.Build.cs b/Plugins/base64plugin/Source/base64plugin/base64plugin.Build.cs new file mode 100644 index 000000000..e9abcf031 --- /dev/null +++ b/Plugins/base64plugin/Source/base64plugin/base64plugin.Build.cs @@ -0,0 +1,53 @@ +// Some copyright should be here... + +using UnrealBuildTool; + +public class base64plugin : ModuleRules +{ + public base64plugin(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.AddRange( + new string[] { + // ... add public include paths required here ... + } + ); + + + PrivateIncludePaths.AddRange( + new string[] { + // ... add other private include paths required here ... + } + ); + + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + // ... add other public dependencies that you statically link with here ... + } + ); + + + PrivateDependencyModuleNames.AddRange( + new string[] + { + "CoreUObject", + "Engine", + "Slate", + "SlateCore", + // ... add private dependencies that you statically link with here ... + } + ); + + + DynamicallyLoadedModuleNames.AddRange( + new string[] + { + // ... add any modules that your module loads dynamically here ... + } + ); + } +} diff --git a/Plugins/base64plugin/base64plugin.uplugin b/Plugins/base64plugin/base64plugin.uplugin new file mode 100644 index 000000000..21a83266f --- /dev/null +++ b/Plugins/base64plugin/base64plugin.uplugin @@ -0,0 +1,23 @@ +{ + "FileVersion": 3, + "Version": 1, + "VersionName": "1.0", + "FriendlyName": "base64plugin", + "Description": "used for encode to base64 string of bytes, file or renderTarget", + "Category": "Other", + "CreatedBy": "Andron", + "CreatedByURL": "", + "DocsURL": "", + "MarketplaceURL": "", + "SupportURL": "", + "EngineVersion": "4.27.0", + "CanContainContent": false, + "Installed": true, + "Modules": [ + { + "Name": "base64plugin", + "Type": "Runtime", + "LoadingPhase": "PreLoadingScreen" + } + ] +} \ No newline at end of file