@
The rumor has it I can sample each pixel from a grayscale texture and get pixel’s value using plugin. How would I do that ?
If not possible, do you think you could add such functionality and expose it to BP ?
Thanks
@
The rumor has it I can sample each pixel from a grayscale texture and get pixel’s value using plugin. How would I do that ?
If not possible, do you think you could add such functionality and expose it to BP ?
Thanks
Hi ,
Brilliant work but how would i go about saving a render target texture to be used again when my game is reloaded?
Thanks again!
Victory BP Library Suite of Image / Pixel Loading and Access!!!
Hi there!
Here are the names of the pixel functions in the Victory BP Library that you can look up and check out!
Yes you can indeed read pixel values from grayscale, just make sure it is not compressed if stored in the project. Compressed textures will give weird values. To date no one has shown up with a decompression solution for existing textures. If someone knows solution and wants to share, please do
However if you load the grayscale texture from hard disk, it won’t be compressed and can be loaded as straight pixels.
I provide you with node to load image from disk
So I’d recommend
load image from disk into pixel array
access the pixel array
So that means you should use node:
Victory_LoadTexture2D_FromFile_Pixels
/** Load a Texture2D from a JPG,PNG,BMP,ICO,EXR,ICNS file! IsValid tells you if file path was valid or not. Enjoy! - */
static UTexture2D* **Victory_LoadTexture2D_FromFile**(const FString& FullFilePath,EJoyImageFormats ImageFormat,bool& IsValid, int32& Width, int32& Height);
/** Load a Texture2D from a JPG,PNG,BMP,ICO,EXR,ICNS file! IsValid tells you if file path was valid or not. Enjoy! - */
static UTexture2D* **Victory_LoadTexture2D_FromFile_Pixels**(const FString& FullFilePath,EJoyImageFormats ImageFormat,bool& IsValid, int32& Width, int32& Height, TArray<FLinearColor>& OutPixels);
/** Retrieve a pixel color value given the pixel array, the image height, and the coordinates. Returns false if the coordinates were not valid. Pixel coordinates start from upper left corner as 0,0. X= horizontal, Y = vertical */
static bool **Victory_Get_Pixel**(const TArray<FLinearColor>& Pixels, int32 ImageHeight, int32 x, int32 y, FLinearColor& FoundColor);
/** Save an array of pixels to disk as a PNG! It is very important that you supply the curret width and height of the image! Returns false if Width * Height != Array length or file could not be saved to the location specified. I return an ErrorString to clarify what the exact was. - */
static bool **Victory_SavePixels**(const FString& FullFilePath,int32 Width, int32 Height, const TArray<FLinearColor>& ImagePixels, bool SaveAsBMP, bool sRGB, FString& ErrorString);
/** will modify the original T2D to remove sRGB and change compression to VectorDisplacementMap to ensure accurate pixel reading. -*/
static bool **Victory_GetPixelFromT2D**(UTexture2D* T2D, int32 X, int32 Y, FLinearColor& PixelColor);
/** will modify the original T2D to remove sRGB and change compression to VectorDisplacementMap to ensure accurate pixel reading. -*/
static bool **Victory_GetPixelsArrayFromT2D**(UTexture2D* T2D, int32& TextureWidth, int32& TextureHeight,TArray<FLinearColor>& PixelArray);
HUD Get Actors In Selection Rectangle
Hi there!
The only node you need is one, which I contributed to the engine a while back:
.unrealengine.com/latest/INT/BlueprintAPI/HUD/GetActorsinSelectionRectangle/index.html
And you can just use DrawHUD itself.
You should not be using that hitbox code with the node above.
There’s some detailed discussion on the node here:
Use the customization options that I"ve provided to control whether you pick up actors that are only partially intersected, or have to be fully intersected.
The underlying code uses UE4’s bounds rect for that actor, so actors at unusual rotations or shapes may have a very large rectang;e on the screen and therefore be drag selected either unexpected or not at , depending on the settings you picked. The node was intended for things like characters and items with precise bounding boxes, not large mountains and rivers
If your unit seems to be getting selected when you don’t want, make sure to only include components with collision so that the long flowing cape of your character, or hair, doesn’t abnormally extend the bounding rect.
Enjoy!
PS:
Basic Usage
For other readers, node is not part of Victory BP Library, it is in the main engine!
You can use it right now by making a BP of a HUD class and then changing your game mode to use your new HUD BP.
Then create the DrawHUD node and add the node post is focused on.
For drawing of the marquee / selection rect, you can calculate the bounds from the anchor and cursor position and draw lines using one of my other contributes to the engine, the Draw Line With Thickness HUD node.
Thanks so much for Plugin -Sama! It really works beautifully.
I have a small problem though:
I need to use the HMD commands VRHeadsetPutOnHead and VRHeadsetRemovedFromHead wich is only being implemented for the Rift in 4.17
so i will have to use your victory plugin(since im lost without it) with UE 4.17 once it is released. Is there a way i can compile the 4.16 version of
victory plugin into 4.17? or will i have to wait for the auther(the mighty -Sama) to compile a working 4.17 version?
Thanks for the help
Thanks so much for your selection help! That worked really well for me!
I can’t believe I didn’t know about that node you mentioned, and the idea to split the selection between Player Controller and HUD was so much better, now I can actually have it go off of left click instead of any mouse button!
Thanks!
Hello ,
I need some help with Patching and Updating game process, that would be great if you can make a tutorial for that,
I tired flow :
but when i try to create a release based on another release gave me a Critical error, it’s okay if i make R2 based on nothing but in case problem is P3 contains P1 and P2 inside himself and it’s not good in large content update. I want each of them separate .
Another problem i have is with priority…
How engine should know P1, P2 and P3 priority order ?
Thank you.
Did you try ? it works great without any https://www./V25ypOjplWM
I didn’t see that before but that’s very similar to the way i did, but is the problem:
When you create first release we call R1 you’ve your base assets inside .pak file and it’s ok
then when you create your first Patch we call P1 it’ll add changes & assets to a new .pak file named New_P.pak and it’s ok
but problem starts here when you want to create P2, at point the new _P.pak has previous P1 content and it seems users must download P1 & P2 and when and if your P1 was a large file the P2 has P1 assets and makes it large.
My Solution is : use epic patching tool for some changing like scripting and small changes and create custom .pak for new assets and load them manually but way is a little hard to manage custom .pak file like creating and load priority .
Let me know what do you think?
Hello ,
I’m trying to save a texture from a RenderTarget to a file. Used the C++ function to create a T2D from a RT and then used your VictoryGetPixelsArrayFromT2D and VictorySavePixels, but the file looks really weird and I guess it has to do with the compression you mentioned. However I can’t deactivate it, only choose between different settings like VectorDisplacementMap, Default DXT1 etc.). Where did you find the “Turn off compression” option?
When I use the engine function CaptureComponent2DSaveImage it works as it should except I get a HDR file I can’t work with, because I haven’t found a way to import it.
Edit:
Okay i got it finally working…
Instead of using a RenderTarget from the engine which always uses compression, I just generated it with C++ with the correct PixelFormat:
UTextureRenderTarget2D* blah::CreateRenderTargetBGRA8(UObject* outer, int32 TexWidth, int32 TexHeight)
{
UTextureRenderTarget2D* newRT = NewObject<UTextureRenderTarget2D>(outer);
newRT->InitCustomFormat(TexWidth, TexHeight, EPixelFormat::PF_B8G8R8A8, 0);
return newRT;
}
and used to create a T2D from a RT2D
UTexture2D* bla::RenderTargetToTexture2D(UObject *outer, UTextureRenderTarget2D* target)
{
target->CompressionSettings = TextureCompressionSettings::TC_MAX;
target->CompressionNone = 1;
UTexture2D* CreatedTexture = target->ConstructTexture2D(outer, "", EObjectFlags::RF_NoFlags, 0, 0);
CreatedTexture->CompressionSettings = TextureCompressionSettings::TC_MAX;
CreatedTexture->MipGenSettings = TextureMipGenSettings::TMGS_NoMipmaps;
CreatedTexture->LODGroup = TextureGroup::TEXTUREGROUP_UI;
CreatedTexture->Filter = TextureFilter::TF_Nearest;
CreatedTexture->CompressionNone = 1;
return CreatedTexture;
}
4.17 see next posts!
You’re welcome!
I’ve not investigated Epic patching tool yet, thanks for the heads up though I will check it out as soon as I can!
Thanks for sharing your solution!
Victory Plugin 4.17
Dear Community,
Here is the 4.17 release of Victory Plugin!
Please keep in mind 4.17 is an experimental build of UE4 still, so there’s a Epic may make changes that break my current 4.17 version of the plugin. If happens let me know
Special thanks to Community member @teak421 for cleaning up some of the categories to result in only “Victory BP Library” being present in your right click context searches!
EDIT:
Now that official 4.17 launcher version has been released, I’ve updated the plugin to full release.
**Download Links**
**4.17 Build (win32, win64, editor, dev packaged, and shipping)**
http://www.mediafire.com/file/8slx6251tw6gg6w/VictoryPlugin.zip
♥ Please note I now use the UE4 Marketplace C++ Plugin Standard when packaging Victory plugin for you ♥
1. Win64 Development
2. Win64 Shipping **<~~~~~~ NEW!**
3. Win32 Development
4. Win32 Shipping
Please see my instructions for [Packaging UE4 Plugins With Your Game](https://forums.unrealengine.com/showthread.php?3851-(39)--s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required!&p=476476&viewfull=1#post476476).
Prior Engine Versions
**4.11: **VictoryPlugin11
**4.12: **VictoryPlugin12
**4.13: **VictoryPlugin13
**4.14: ** VictoryPlugin14
**4.15: ** VictoryPlugin15
**4.16: ** VictoryPlugin16
**Donations can be sent to me via:**
http://lightningfitness.org/donate/
♥
,
Please keep in mind that some of the Blueprint nodes have been re-categorized…including what mentioned above. For example, some were not categorized have been moved under Misc. and others that were not categorized were moved to the appropriate category. was pass number one and more changes might be … Open to suggestions as well! Thanks to for making such a great plugin.
teak
Fantabulastic.
4.17 says the plugin is incopatible with current version. Could you please look into it or give advice?
i’ve is to use freshly installed 4.17 and plugin downloaded from the link you provided.
THANKS,
H
The release version of 4.17 was just released, I’ve now updated the plugin to release 4.17
4.17 Build (win32, win64, editor, dev packaged, and shipping)
Hi I have a request,
Could you make a ‘reset input to defaults’ node? I am having a hell of a trying to reset re-binded inputs. Especially double and triple binded. Deleting the input.ini file your nodes generate does it, but only after game restart (no fun for a normal user :P).
Thanks muchly
-LZ
Huge thanks for a quick 4.17 update! <3
Aaand, it WORKS! Thank you !!
Hi, do you have the new update of VictoryEdEngine for 4.17? looking foward to it