I facing a weird with CaptureComponent2D_SaveImage
It works flawlessly on windows and on ios! On though it creates an image that is upside down, like rotated 180 degrees…
Any idea why?
Hi, or anyone who knows, I tested in a blank project, added the plugin, and compiled from source, and I got these errors.
1>C:/Users/Admin/Documents/Unreal Projects/VictoryTest/Plugins/VictoryBPLibrary/Source/VictoryBPLibrary/Private/VictoryBPFunctionLibrary.cpp(4098): error C2665: 'operator new': none of the 9 overloads could convert the argument types
1> C:\Program Files\Epic Games\UE_4.23\Engine\Source\Runtime\Core\Public\Misc/MemStack.h(229): note: could be 'void *operator new(size_t,FMemStackBase &,int32,int32)'
1> C:\Program Files\Epic Games\UE_4.23\Engine\Source\Runtime\Core\Public\Delegates/DelegateBase.h(256): note: or 'void *operator new(size_t,FDelegateBase &)'
1> C:\Program Files\Epic Games\UE_4.23\Engine\Source\Runtime\Core\Public\Containers/SparseArray.h(1262): note: or 'void *operator new(size_t,const FSparseArrayAllocationInfo &)'
1> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\INCLUDE\vcruntime_new.h(184): note: or 'void *operator new(size_t,void *) noexcept'
1> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\INCLUDE\vcruntime_new.h(71): note: or 'void *operator new(size_t,const std::nothrow_t &) noexcept'
I don’t think is yet a working version of 4.23. Just checking if there is another version out there that people are using that is error free on compile?
I also tried the download link from the 1st page. Same errors.
EDIT:
Well I didn’t know how to fix it so i just commented out the offending function in .h and .cpp, and that gets me going.
/*
UFUNCTION(BlueprintCallable, Category = "Victory BP Library|Load Texture From File",meta=(Keywords="image DDS"))
static UTexture2D* LoadTexture2D_FromDDSFile(const FString& FullFilePath);
*/
Greetings everyone,
I have been trying to figure out how to get the vertex snapping and other editor features to work and there is a ton of information that I cannot tell what I need to do. I can see the plugin and blueprints, but I do not see the other features that were described in the wiki, A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums.
Just for clarification as it seems plugin has been through a lot of iterations… I need to install the package to the engine directory. Do I also need something per project, or no? I would think not, but I wasn’t sure if there is some other piece I need here. I tried to edit the DefaultEngine.ini as described and it causes it to crash on load. Any assistance would be greatly appreciated.
Thanks!
Hi,I want screenshot with a camera , so i use captureScene2DComponent. But when i use CaptureComponent2d_SaveImage() to Save Image to disk,the image is so dark ,i spend a lot of but can’t resolve it ,can you help me, thank you
https://forums.unrealengine.com/deve…54#post1661754
Yes, it is missing in the first post
I’d like to report a bug that causes using widget functions to crash applications. Like Get widget of class , etc.
(using version for 4.23 on 4.23.1)
Can your “Instanced Static Mesh Editor” or “Vertex Snap Editor” plugin show/manipulate translate/rotate/scale widget in runtime (in game mode)?
Hello ,
I was trying to implement a way for the user to upload images from their drive to a local folder in the contents folder.
I’m attempting to do by using 3 functions from your library:
UVictoryBPFunctionLibrary::Victory_LoadTexture2D_FromFile to
UVictoryBPFunctionLibrary::Victory_GetPixelFromT2D to
UVictoryBPFunctionLibrary::Victory_SavePixels
Here it is in Blueprint:
And here are the code snippets:
My implementation of UVictoryBPFunctionLibrary::Victory_LoadTexture2D_FromFile:
UTexture2D * ULSI_FilePickerLibrary::LSI_LoadTextureFromFilePixels(const FString & FullFilePath, EJoyImageFormats ImageFormat, bool & IsValid, int32 & Width, int32 & Height, TArray<FLinearColor>& OutPixels)
{
OutPixels.Empty();
IsValid = false;
UTexture2D* LoadedTexture = nullptr;
IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
TSharedPtr<IImageWrapper> ImageWrapper = ImageWrapperModule.CreateImageWrapper(GetImageFormat(ImageFormat));
TArray<uint8> RawFileData;
if (!FFileHelper::LoadFileToArray(RawFileData, *FullFilePath))
{
return nullptr;
}
if (ImageWrapper.IsValid() && ImageWrapper->SetCompressed(RawFileData.GetData(), RawFileData.Num()))
{
const TArray<uint8>* UncompressedBGRA = nullptr;
if (ImageWrapper->GetRaw(ERGBFormat::BGRA, 8, UncompressedBGRA))
{
LoadedTexture = UTexture2D::CreateTransient(ImageWrapper->GetWidth(), ImageWrapper->GetHeight(), PF_B8G8R8A8);
if (!LoadedTexture)
{
return nullptr;
}
Width = ImageWrapper->GetWidth();
Height = ImageWrapper->GetHeight();
void* TextureData = LoadedTexture->PlatformData->Mips[0].BulkData.Lock(LOCK_READ_WRITE);
FMemory::Memcpy(TextureData, UncompressedBGRA->GetData(), UncompressedBGRA->Num());
LoadedTexture->PlatformData->Mips[0].BulkData.Unlock();
LoadedTexture->UpdateResource();
}
}
IsValid = true;
return LoadedTexture;
}
My implementation of UVictoryBPFunctionLibrary::Victory_GetPixelFromT2D:
bool ULSI_FilePickerLibrary::LSI_GetPixelsFromText2D(UTexture2D * T2D, int32 & TextWidth, int32 & TextHeight, TArray<FLinearColor>& PixelArray)
{
if (!T2D)
{
return false;
}
PixelArray.Empty();
T2D->SRGB = false;
T2D->CompressionSettings = TC_VectorDisplacementmap;
T2D->UpdateResource();
FTexture2DMipMap& MyMipMap = T2D->PlatformData->Mips[0];
TextWidth = MyMipMap.SizeX;
TextHeight = MyMipMap.SizeY;
FByteBulkData* RawImageData = &MyMipMap.BulkData;
if (!RawImageData)
{
return false;
}
FColor* RawColorArray = static_cast<FColor*>(RawImageData->Lock(LOCK_READ_ONLY));
for (int32 x = 0; x < TextWidth; x++)
{
for (int32 y = 0; y < TextHeight; y++)
{
PixelArray.Add(RawColorArray[x* TextWidth + y]);
}
}
RawImageData->Unlock();
return true;
}
My implementation of UVictoryBPFunctionLibrary::Victory_SavePixels:
bool ULSI_FilePickerLibrary::LSI_SavePNGtoFile(const FString & FullFilePath, int32 Width, int32 Height, const TArray<FLinearColor>& ImagePixels, bool sRGB, FString & ErrorString)
{
if (FullFilePath.Len() < 1)
{
ErrorString = "No File Path";
return false;
}
FString NewAbsoluteFolderPath = FPaths::GetPath(FullFilePath);
FPaths::NormalizeDirectoryName(NewAbsoluteFolderPath);
if (!CreateDirectory(NewAbsoluteFolderPath))
{
ErrorString = "Folder could not be created, cheack read/write permissions-: " + NewAbsoluteFolderPath;
return false;
}
TArray<FColor> ColorArray;
for (const FLinearColor& Each : ImagePixels)
{
ColorArray.Add(Each.ToFColor(sRGB));
}
if (ColorArray.Num() != Width * Height)
{
ErrorString = "Error: height x width is not equal to the total pixel array length.";
return false;
}
FString FinalFileName = FPaths::GetBaseFilename(FullFilePath, false);
FinalFileName += ".png";
TArray<uint8> CompressedPNG;
FImageUtils::CompressImageArray(Width, Height, ColorArray, CompressedPNG);
return FFileHelper::SaveArrayToFile(CompressedPNG, *FinalFileName);
}
However after testing these, of my tests say nothing is going wrong, it makes it through the blueprint without error, and through the code as well, and everything appears to be working correctly, but there is no new .png file created in the directory. Upon further inspection of your source code I found that you have a comment that says that at some point these functions did not work for unknown reasons. Are they still not working or have you fixed that? If so, what have I wrong?
credit for implementation will go to you of course.
if you just want to move a file into the content folder of the project, why not use a file copy on the system? As of what your code does it is overcomplicated and slow compared to just a file copy
Didn’t realize I could do that, I’ll give that a shot
Is there a way to do that without source control? is a local project and I’m the only one working on it.
.unrealengine.com/en-US/…ger/index.html
I don’t know why Unreal does not expose file operations to Blueprint, but might have reasons, eg. that Mods created with Blueprint are not able to damage the filesystem.
As of Unreal 4.23 Unreal has exposed SourceControl functionality to Blueprint. MAYBE that works for you. Not sure what a Copy File would actually do in case.
Yes I found those, but I’m not using any source control on project as I am the only one working on it. So it is local. Do you know of anyway to do with local files, so I don’t have to enable source control for .
.unrealengine.com/en-US/…ger/index.html
ALWAYS USE SOURCE CONTROL! Also when working solo
https://softwareengineering.stackexc…ersion-control
Perforce is **free **for 5 User and 20 Workspaces when working locally.
no. i dont thing so
Is LoadStringToFile broken in 4.23? It always return blank. My file is “e:\myfile.txt”.
Hi, we are trying to compile in 4.24 without success. We are getting error:
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "__declspec(dllimport) struct FThreadSafeStaticStat<struct FStat_STAT_PhysSceneWriteLock> StatPtr_STAT_PhysSceneWriteLock" (__imp_?StatPtr_STAT_PhysSceneWriteLock@@3U?$FThreadSafeStaticStat@UFStat_STAT_PhysSceneWriteLock@@@@A) Wardens D:\Revolver\Wardens\Intermediate\ProjectFiles\Module.VictoryBPLibrary.cpp.obj 1
If someone was able to compile, please give us help.
Thank you.
https:///#!sSoXTSiA!qsxkqaCVnMci_FzPSHM3ph7PbdLnNkaodrTk2Pcaiag
Hello there,
Thank you very very much for amazing plugin. I have a question regarding “Victory Sound Volume Change” and “Victory Get Sound Volume”. These 2 functions are working just fine when playing in the editor but they don’t work at when playing in Standalone or packaged game. What can I do to solve ?
FYI I’m using 4.19.
Thank you again for the plugin.

