(39) Rama's Extra Blueprint Nodes for You as a Plugin, No C++ Required!

Hi there,

I’m using Create Proc to run an external render node (after effects FWIW) which spits out information on its progress in a cmd window. Is there a way to get that output so I can make and update a progress bar?

Thanks,
-Rich

static int32 GetUnixTimeStamp(const FDateTime& UTCTime)

static void GetUTCFromUnixTimeStamp(int32 UnixTimeStamp, FDateTime& UTCTime)

can this be updated to int64 at this time?

Welcome to the UE Community @richhelvey !

Yes I have done this myself, my use case was video processing using the ffmpeg foundation.

If you pipe the output of the procedure to a .txt file, in addition to displaying in your cmd window,

Then you can use my LoadString nodes to periodically check the file and update it!

I would use a fairly short timer (but not too short) in case a read/write operation conflicts and prevents the file from being accessed by either side.

/** Loads a text file from hard disk and parses it into a String array, where each entry in the string array is 1 line from the text file. Option to exclude lines that are only whitespace characters or '\n'. Returns the size of the final String Array that was created. Returns false if the file could be loaded from hard disk. */
	UFUNCTION(BlueprintPure, Category = "Victory BP Library|File IO")
	static bool LoadStringArrayFromFile(TArray<FString>& StringArray, int32& ArraySize, FString FullFilePath = "Enter Full File Path", bool ExcludeEmptyLines = false);

	/** Load a text file to a single string that you can use ParseIntoArray on newline characters if you want same format as LoadStringArrayFromFile. This version supports unicode characters! */
	UFUNCTION(BlueprintCallable, Category = "Victory BP Library|File IO")
	static bool LoadStringFromFile(FString& Result, FString FullFilePath = "Enter Full File Path")
	{
		return FFileHelper::LoadFileToString( Result, *FullFilePath);
	}

:heart:

Rama

Thank you for sharing Android 4.27 Victory Plugin build with all of us!

:heart:

Rama

Great to hear from you @MOSF !

:rose: YES :rose:

I have changed to using int64,

:dolphin: though dolphins may still come to rule this world, :dolphin:

:zap: int64 BP datatype is already here… :zap:

/* Blueprints does not support int64 so at some pt in future int32 will not be enough, probably by then dolphins will rule the world, or UE4 BP will support int64, or both!  <3 Rama*/
	UFUNCTION(BlueprintPure, Category = "Victory BP Library|System")
	static int64 GetUnixTimeStamp(const FDateTime& UTCTime)
	{
		//Please note it should really be int64 but that is not supported by BP yet
		return UTCTime.ToUnixTimestamp();
	} 
	/* Blueprints does not support int64 so at some pt in future int32 will not be enough, probably by then dolphins will rule the world, or UE4 BP will support int64, or both!  <3 Rama*/
	UFUNCTION(BlueprintPure, Category = "Victory BP Library|System")
	static void GetUTCFromUnixTimeStamp(int64 UnixTimeStamp, FDateTime& UTCTime)
	{
		//Please note it should really be int64 but that is not supported by BP yet
		UTCTime = FDateTime::FromUnixTimestamp( UnixTimeStamp );
	}

:heart:

Rama

PS: 4.27 link in Original Post updated!


Victory Plugin for UE5


:heart:

Rama

This node will get the Saved folder of your game, wherever it maybe installed :slight_smile:

In fact, even if you MOVE your shipped game, after it is installed, my node will STILL find your Saved folder of your project, which is why I use ConvertRelativePathToFull.

Yes, for all the times when a user’s packaged game moves aorund without consulting with you first… (it could happen)

:zap: :racehorse: :dash: :zap:

Rama

You are welcome, has this been integrated into future versions?

2 Likes

I have a link now for people in the original post, but after I add a chunk of new features I would appreciate you recompiling, as I do not have a post-4.24 android setup going yet

I might have a fun new update within 24-48 hours so please check back periodically, or I might pm you if you want to help advance our Victory on the Android platform.

:heart:

Rama

1 Like

:star2: Get Text From Any :racehorse: :dash: Running .EXE on Your Computer! :sparkling_heart:

URamaVictoryPluginCreateProcessPipe Object :zap: is Born! :zap:


:zap: Below is a picture of me capturing the output of a .exe on my computer, a video compression tool, HandBrake! :zap:

The output of STDOUT of the .exe is coming directly into UE4, :rose: using only Blueprints! :rose:

!

Again, :sparkling_heart: welcome to the UE forums :sparkling_heart: @richhelvey !

!

I’ve made a new version of the Victory Plugin ( 4.27 (win32, win64 only) in original post ) !

This new version allows you to create a :rose: Very Special :rose: URamaVictoryPluginCreateProcessPipe to capture your Process output, if the Process is outputting to STDOUT (console window) or STDERR

  1. Construct the RamaVictoryPluginCreateProcessPipe object

  2. Pass it into VictoryCreateProc

  3. Call ReadFromPipe on the object periodically to get updates from your process

  4. When done, please call ClosePipe on the object, and null the reference to the object (I call ClosePipe inside of object BeginDestroy, but might as well :zap: take initiative :zap: yourself and close the actual OS pipe yourself immediately, rather than waiting for Garbage Collection)


Relevant UE4 C++ Code


.h

/** 
	Made With Love By Rama for Use with @VictoryCreateProc
	So that you can receive feedback from your processes.
	
	♥
	
	Rama
*/
UCLASS(Blueprintable,BlueprintType)
class URamaVictoryPluginCreateProcessPipe : public UObject
{
	GENERATED_BODY()
public:
	 
	UFUNCTION(BlueprintCallable, Category = "Joy Flow")
	bool CreatePipe();
	
	UFUNCTION(BlueprintCallable, Category = "Joy Flow")
	void ClosePipe();
	
	/** 
		This has exec pins because it is an expensive action and the output is saved/cached on the output pin, whereas a Pure node would repeat the action many times, each time node is accessed.
		
		@Return false if the pipes were not created yet
		
		♥ Rama 
	*/
	UFUNCTION(BlueprintCallable, Category = "Joy Flow")
	bool ReadFromPipe(FString& PipeContents);
	
	UFUNCTION(BlueprintPure, Category = "Joy Flow")
	bool PipeIsValid();
	
public:
	void* ReadPipe = nullptr;
	void* WritePipe = nullptr;
	
	virtual void BeginDestroy() override;
};

.cpp

bool URamaVictoryPluginCreateProcessPipe::CreatePipe()
{
	if(PipeIsValid())
	{
		//Ignore repeat creates without a close inbetween <3 Rama
		return true;
	}
	return FPlatformProcess::CreatePipe( ReadPipe, WritePipe );
}
void URamaVictoryPluginCreateProcessPipe::ClosePipe()
{
	if(PipeIsValid())
	{
		FPlatformProcess::ClosePipe(ReadPipe, WritePipe);
		ReadPipe = nullptr;
		WritePipe = nullptr;
	}
}
bool URamaVictoryPluginCreateProcessPipe::ReadFromPipe(FString& PipeContents)
{
	PipeContents = "";
	
	if(!PipeIsValid()) 
	{
		return false;
	}
	PipeContents = FPlatformProcess::ReadPipe(ReadPipe);
	return true;
}
bool URamaVictoryPluginCreateProcessPipe::PipeIsValid()
{
	return ReadPipe != nullptr && WritePipe != nullptr;
}

void URamaVictoryPluginCreateProcessPipe::BeginDestroy()
{
	Super::BeginDestroy();
	//~~~~~~~~~~~~~~~~~~~~
	
	//Close pipe if it was still open! ♥ Rama
	ClosePipe();
}

:heart:

Rama

2 Likes

Please add ‘Array Sort’ node to the UE5 version, I need the node that sorts structs by a variable name ‘Array Sort’.

Was Array sort actually working for you in UE4.27 ? The contributor to the Victory plugin who made that node would be able to help, Mr Kris Redbeard, but I thought the node had been non-functional for a while, and I don’t recall why.

Victory to You @Tbjbu1 !

:heart:

Rama

It was working for me in 4.26, not sure about 4.27 - never used that version.

I’m looking for a manual too~

Good to know thank you, I will investigate!

Do you have a specific question, what sort of manual did you have in mind?

:heart:

Rama

Hi, I have question regarding the SaveArrayToFile, is there an example of how to format it as row and column for csv file?

@Rama Looks like my UE5 release prediction was pretty spot on :smiley:

I’m trying to get a copy of our project working in UE5 Preview. So far I’ve gotten most of the levels to open fine, but if I try opening any blueprints (or even create a new blueprint > actor from scratch) I get this crash immediately:

Assertion failed: NewOperatorInputA [File:D:\build\++UE5\Sync\Engine\Source\Editor\BlueprintGraph\Private\K2Node_CommutativeAssociativeBinaryOperator.cpp] [Line: 281] (the line is: check(NewOperatorInputA);

I searched online for “K2Node_CommutativeAssociativeBinaryOperator.cpp” and saw a few references to the Victory plugin, hence why I’m posting it here (I realize it’s an engine file, but from my search results of other people having an error with this cpp file, they mentioned the victory plugin)

I know UE5 Preview literally JUST came out today, so I’m not expecting an immediate update, just thought I’d post this here in case it’s useful :slight_smile:

UPDATE: Fixed it!! It was the “Append Multiple” node that I found was added to one of our widgets that was causing the crash in the UE5 Preview project :slight_smile: (now replaced with the regular append node).

1 Like

Hi. I started using the Victory plugin for getting RGB data from a texture.
I downloaded and installed the “Lemur_hotel” version, which is the only compiled version I could find, because www.ue4code.com is dead and github does not
I’m using UE4.27 on Win64
I tried the node GetPixelFromT2D to get pixels from a texture, but it returns only zero RGBA and the deprecation message “This function will not work until I figure out how to update it to 4.25, if you need it urgently, please post in my ue4 forum thread for this plugin”
Is there a fix for 4.27?

Chris

In fact all T2D functions either don’t work or crash ue4.27
I need to get the pixels coming from a video input texture, so loading from a file (the only thing that works) is not an option…

This is the crash report I get when calling VictoryGetPixelsArrayFromT2D blueprint with a 1024x1024 texture in VectorDisplacementMap mode
The plugin is installed in the project plugin folder, not in the engine plugins.

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000002

UE4Editor_VictoryBPLibrary!UVictoryBPFunctionLibrary::Victory_GetPixelsArrayFromT2D() [X:\Workspaces\V360_Services\Framework\Plugins\VictoryPlugin27\Source\VictoryBPLibrary\Private\VictoryBPFunctionLibrary.cpp:4622]
UE4Editor_VictoryBPLibrary!UVictoryBPFunctionLibrary::execVictory_GetPixelsArrayFromT2D() [X:\Workspaces\V360_Services\Framework\Plugins\VictoryPlugin27\Intermediate\Build\Win64\UE4Editor\Inc\VictoryBPLibrary\VictoryBPFunctionLibrary.gen.cpp:1270]

Hi there! @TheChrisVDB welcome to the UE4 Forums!

The solution to your issue is here:

Same logic applies to the UE4 version (you don’t have to upgrade to UE5, just set your T2Ds to no mip maps and use vectordisplacement, this results in no compression of your texture, so you have a 1 to 1 pixel ratio between your original file and the UE4 file, annnnnd, no crash :heart:

:heart:

Rama