New node for you!
This node will move / rename the most recently taken screenshot!
So the intended work flow is
Exec Console Command -> “HighResShot 2” or “shot showui”
Possibly put in a short Delay node
Use my new node! ScreenShots Move Rename Most Recent!
**More Power for You in BP**
Now you can specify an absolute path directory and also file name for the most recent screen shot, and it will be relocated for you!
So please note you can only do this **after** you create the image using UE4's console commands.
Bonus For You
You can specify a destination folder that does not exist yet and my node will create it for you!
This is great for if you delete your custom screen shots folder and expect my node to work anyway!
My node will!
**High Res vs Regular Screen Shots**
You can filter for High Resolution and regular screen shots independently using my node!
So if you have High Res selected, ONLY High Resolution screenshots are considered when sorting by file time.
Otherwise, if this is unchecked, I will ONLY look for regular screenshots taken with "shot showui"
Keep in Same Directory?
To keep the file in the same directory, use my new Paths node that retrieves your project’s ScreenShot directory!
If you have a bunch of shots, you can:
1. use my node in a for loop with a break and a max count of 1000, (or while loop if you are feeling confident)
2. Ensure that you are moving the files OUT of their current directory (otherwise for loop will run to its limit)
3. The break condition is when my new node returns false, so just plug the false end of the branch right back into the break condition!
This will work because my node is only checking the dates of the files that are within the screenshots directory, so as you keep moving the files out, my node will keep finding the new most recent picture!
My C++ Code For You
I had to write a lot of custom File Operations code to fulfill this request, so a lot of the functions you see in this node are not stock UE4 code.
OriginalFileName = "None";
**//File Name given?**
if(NewName.Len() <= 0) return false;
**//Ensure target directory exists,
// _or can be created!_ <3 Rama**
if(!VCreateDirectory(NewAbsoluteFolderPath)) return false;
FString ScreenShotsDir = VictoryPaths__ScreenShotsDir();
**//Find all screenshots**
TArray<FString> Files; //false = not recursive, not expecting subdirectories
bool Success = GetFiles(ScreenShotsDir, Files, false);
TArray<FString> ToRemove; //16 bytes each, more stable than ptrs though since RemoveSwap is involved
for(FString& Each : Files)
//remove those that dont have it
if(Each.Left(4) != "High")
//Remove those that have it!
if(Each.Left(4) == "High")
for(FString& Each : ToRemove)
Files.RemoveSwap(Each); //Fast remove! Does not preserve order
if(Files.Num() < 1)
// Rama's Sort Files by Time Stamp Feature
//Sort the file names by time stamp
// This is my custom c++ struct to do this,
// combined with my operator< and UE4's
// TArray::Sort() function!**
for(FString& Each : Files)
//Sort all the file names by their Time Stamp!
//Biggest value = last entry
OriginalFileName = *FileSort.Last().FileName;
**//Generate new Full File Path!**
FString NewFullFilePath = NewAbsoluteFolderPath + "/" + NewName + ".bmp";
return RenameFile(NewFullFilePath, ScreenShotsDir + "/" + OriginalFileName);
**How It Works**
The core feature of my logic and this node is that I used a custom C++ struct in order to sort all of the files by date!
**I do this in a super-efficient way, using UE4's TArray::Sort function which leverages all of Epic's hard work to create a fast sorting function!**
I defined the C++ **operator<** for my custom struct so that UE4 could do the sorting for me!
**In addition I have developed my own File I/O library since my time in the UE4 Beta program.**
So I had all the supporting functions I needed!
C++ Code Speed
Please note that in my internal file sorting system I do not duplicate the FString data! I refer to it via pointer, and use the FDateTime as the only data I access.
So essentially my custom C++ struct is a FDateTime wrapper for a FString ptr so that UE4 can sort the files for me like Lightning!
**Download and plug in!**
**Latest plugin download is here:**