Rama's Extra Blueprint Nodes for UE5, No C++ Required!

Hi , thanks for the awesome work on this awesome plugin! Any idea on if/when those nodes are coming over to UE5? I’m especially interested in Save Game Object Get All Save Slot File Names, since I’m following a tutorial that uses it and without it I’m kinda stuck trying to figure out how to proceed. Thanks again!

Hi !
Could you make a node that gets a pixel color at a coordinate from a sprite? I see you have one that gets pixel color from a texture but I have a huge sprite atlas with 120 sprites and i would like to get pixel information from only 1 sprite in that sprite atlas. Currently all the information in the sprite asset is protected and there are no blueprints to even get the sprites offset in the texture. Thanks!

The sprite atlas is originally just an image right, can you import it as a texture2D and then get the pixels that way?

I wonder if Epic does any compression or changes to the sprite atlas on import that would make the values not match between your original picture and the imported atlas.

(let me know your thoughts on this!)

~

Oooh that is a node I can add when I do 5.2 update!


Self-Note for Upgrade: To include the node to check if a process is running

:heart:

2 Likes

:zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap:
:zap::zap::zap: The Joy of UE5 Is Growing :zap::zap::zap:

:zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap:

:zap: Save Any Dynamic Mesh as a New Static Mesh Asset in Editor Builds :zap:

(17 min video showing you exactly how to use the new content included with Victory Plugin!)


(Dynamic Mesh Actor + Spline Component + Victory Plugin = New Static Mesh Asset!)

Dear Community,

I’ve added a new node to Victory Plugin so you can easily save out as a new Static Mesh Asset, any Dynamic Mesh you create using any of your own custom logic in constructor script to make really fancy shapes!

Yes!!!

So you really can :star2: make your own modelling tools :star2: inside of Unreal Engine, using BP constructor script, and then make new Static Mesh Assets that will ship with your game!

Create Your Own Static Mesh Asset Modeling Tools!
EX: Dynamic Mesh + Spline Component Modeling Tool

I show you an example of what I mean in the video, creating a Spline Mesh Modeling Tool in BP, a BP which you can find in the Content Folder of the Victory Plugin, along with the example assets!

Please note this BP node is Editor Only, I explain more in the video!

:zap: The Relevant C++ Code :zap:

Because I let you choose any asset path with your game’s content folder for your new Static Mesh Asset, create the folder structure for you, handle the case of if the asset path is already in use, there is some extra file handling code, but the rest is the utilization of the new MeshModelingToolset plugin that exists in UE5!

:heart: Thank You Epic Devs! :heart:

//~~~ CreateStaticMeshAssetFromDynamicMesh ~~~
#include "GeometryFramework/Public/Components/DynamicMeshComponent.h"

//Runtime
//Engine\Plugins\Runtime\MeshModelingToolset\Source\ModelingComponents\Public\ModelingObjectsCreationAPI.h
#include "ModelingObjectsCreationAPI.h"
 
//Editor
#if WITH_EDITOR
	//"ModelingComponentsEditorOnly" in build.cs ♥ 
	#include "AssetUtils/CreateStaticMeshUtil.h"
#endif
//~~~~ End CreateStaticMeshAssetFromDynamicMesh ~~~

UStaticMesh* UVictoryBPFunctionLibrary::CreateStaticMeshAssetFromDynamicMesh( 
	FString ContentFolderPath,
	UDynamicMeshComponent* DynamicMeshComp, 
	FString& Status, 
	FString& NewAssetFilePath, 
	bool& Success
){
	NewAssetFilePath = "";
	
	#if WITH_EDITOR
		
	//Comp?
	if(!DynamicMeshComp || !DynamicMeshComp->GetDynamicMesh())
	{
		Status = "No valid Dynamic Mesh Component was supplied!";
		Success = false;
		return nullptr;
	}
	
	//No Triangles?
	if(DynamicMeshComp->GetDynamicMesh()->IsEmpty())
	{
		Status = "Dynamic Mesh has no triangles!";
		Success = false;
		return nullptr;
	}
	
	//Make sure to remove extension if user added it ♥ 
	
	//File without any extension
	ContentFolderPath.ReplaceInline(TEXT(".uasset"),TEXT(""));
	  
	//~~~ Create possibly numbered new filename, if supplied exists! ♥ 
	FString FinalRelativePath = "";
	bool FolderTreeCreated = UVictoryBPFunctionLibrary::GenerateUniqueContentRelativeFileName(ContentFolderPath + ".uasset",FinalRelativePath,NewAssetFilePath);
	  
	if(!FolderTreeCreated)
	{
		Status = "Could not create the specified directory tree";
		Success = false;
		return false;
	}
	
	//Remove ext before sending to AssetUtils
	//// Path is now Relative with no extension, possibly with 1,2,3 added for each create event in editor! <3 
	FinalRelativePath.ReplaceInline(TEXT(".uasset"),TEXT(""));
	
	//~~~ End of file path input handling ♥  ~~~
	
	//Create Mesh Base Params
	FCreateMeshObjectParams CreateMeshParams;
	
	CreateMeshParams.BaseName 		= FinalRelativePath;
	
	//~~~ Materials ~~~
	DynamicMeshComp->ValidateMaterialSlots();
	
	for(int32 v = 0; v < DynamicMeshComp->GetNumMaterials() ; v++)
	{
		CreateMeshParams.Materials.Add(DynamicMeshComp->GetMaterial(v));
	}
	 
	//Set from FDynamicMesh3 (the actual mesh herself, not from a MeshDescription)
	CreateMeshParams.SetMesh(DynamicMeshComp->GetMesh());
	
	//Ensure Set to DynamicMesh
	CreateMeshParams.MeshType = ECreateMeshObjectSourceMeshType::DynamicMesh;
	
	//~~~
	//~~~
	//~~~
	
	//~~~~~~~~~~~~~~~~~
	// Code from UE_5.0\Engine\Plugins\Runtime\MeshModelingToolset\Source\ModelingComponentsEditorOnly\PublicEditorModelingObjectsCreationAPI.cpp
	
	//Static Mesh!
	//CreateMeshObjectResult = EditorCreateMeshAPI->CreateStaticMeshAsset(CreateMeshParams);
	
	//Static Asset Options
	UE::AssetUtils::FStaticMeshAssetOptions AssetOptions;
	AssetOptions.NewAssetPath = "/Game/" + CreateMeshParams.BaseName;
	 
	//Ensure no // 
	FPaths::RemoveDuplicateSlashes(AssetOptions.NewAssetPath);
	 
	AssetOptions.NumSourceModels = 1;
	AssetOptions.NumMaterialSlots = CreateMeshParams.Materials.Num();
	
	//Got rid of FilterMaterials part <3 
	AssetOptions.AssetMaterials = (CreateMeshParams.AssetMaterials.Num() == AssetOptions.NumMaterialSlots) 
		? CreateMeshParams.AssetMaterials 
		: CreateMeshParams.Materials;

	AssetOptions.bEnableRecomputeNormals 	= CreateMeshParams.bEnableRecomputeNormals;
	AssetOptions.bEnableRecomputeTangents 	= CreateMeshParams.bEnableRecomputeTangents;
	AssetOptions.bGenerateNaniteEnabledMesh = CreateMeshParams.bEnableNanite;
	AssetOptions.NaniteProxyTrianglePercent = CreateMeshParams.NaniteProxyTrianglePercent;

	AssetOptions.bCreatePhysicsBody 		= CreateMeshParams.bEnableCollision;
	AssetOptions.CollisionType 				= CreateMeshParams.CollisionMode;

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	//Dynamic Mesh! ♥ 
	FDynamicMesh3* DynamicMesh = &CreateMeshParams.DynamicMesh.GetValue();
	AssetOptions.SourceMeshes.DynamicMeshes.Add(DynamicMesh);
	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	
	//Static Mesh Result
	UE::AssetUtils::FStaticMeshResults ResultData;
	 
	//==========
	//CREATE!!!
	UE::AssetUtils::ECreateStaticMeshResult AssetResult = UE::AssetUtils::CreateStaticMeshAsset(AssetOptions, ResultData);
	//==========
 
	if (AssetResult != UE::AssetUtils::ECreateStaticMeshResult::Ok)
	{
		Status = "UE::AssetUtils::ECreateStaticMeshResult is ECreateModelingObjectResult::Failed_AssetCreationFailed";
		Success = false;
		return false;
	}
  
	// End of code from PublicEditorModelingObjectsCreationAPI.cpp
	//~~~~~~~~~~~~~~~~~
	
	Status = "Victory!";
	Success = true;
	return ResultData.StaticMesh;
	#endif
	
	Status = "This node is for Editor Builds only, but does create static mesh assets that can ship with your packaged game! ♥ ";
	Success = false;
	return nullptr;
}


bool UVictoryBPFunctionLibrary::GenerateUniqueContentRelativeFileName(FString ContentRelativeFilePath, FString& ContentRelativeNewFileName, FString& AbsolutePath, bool CreateFolderTree)
{
	//UE User-Input Assistance (inline) ♥ 
	FPaths::NormalizeFilename(ContentRelativeFilePath);
	FPaths::RemoveDuplicateSlashes(ContentRelativeFilePath);
	
	FString AbsContentPath = FPaths::ConvertRelativePathToFull(FPaths::ProjectContentDir());
	
	//Extension
	FString FileExt		=  FPaths::GetExtension(ContentRelativeFilePath, true); //include .
	
	//File without any extension
	FString AssetFile 	= FPaths::GetBaseFilename(ContentRelativeFilePath);
	
	//Everything but the file
	FString BasePath 	= FPaths::GetPath(ContentRelativeFilePath);
	
	
	if(ContentRelativeFilePath.Contains("/"))
	{	
		//Absolute Path
		BasePath = AbsContentPath + BasePath; 
		 
		if(CreateFolderTree)
		{
			//Folder?
			if(!FPlatformFileManager::Get().GetPlatformFile().CreateDirectoryTree(*BasePath))
			{ 
				//Info out to user about what was attempted
				AbsolutePath = BasePath;
				return false;
				//~~~~~~~~~~~~~~~~~~~~~~
			}
		}
	}
	
	//~~~
	// Make path with extension
	if(BasePath != "")
	{
		AbsolutePath = BasePath + "/" + AssetFile;
	}
	else
	{
		AbsolutePath = AbsContentPath + AssetFile;
	}
	 
	//Check if file exists already, increment int as needed, ♥ 
	 
	//Absolute Path + File, Still No Extension yet
	BasePath 		= AbsolutePath;
	  
	int32 FileNameInt 	= 1;
	AbsolutePath 		= BasePath + FileExt;
	while(FPlatformFileManager::Get().GetPlatformFile().FileExists( *AbsolutePath))
	{
		FileNameInt++;
		AbsolutePath = BasePath + FString::FromInt(FileNameInt) + FileExt;
	}
	
	FString Left;
	
	//Make Relative
	AbsolutePath.Split(TEXT("/Content/"),&Left,&ContentRelativeNewFileName);
	
	return true;
}

:sparkling_heart: Have Fun Creating Static Mesh Assets Using Your Own Custom Modeling Tools :sparkling_heart:

And Modeling to Your Creative Heart’s Content in the Level Viewport! :sparkling_heart:

:heart:

PS: You will want to enable this plugin for use with the new content in the Victory Plugin Content Folder:

(The content demoed in the video is zipped inside Victory Plugin Content Folder so you can make sure you have Geometry Script Plugin enabled first)

1 Like

I whitelisted Mac platform to try and see if it’s compatible as I was able to use the previous version of the plugin when I was developing in UE 4.26, but now in UE 5.1 I’m getting this Linker error when trying to compile the project:

Undefined symbols for architecture x86_64: “UE::Geometry::FDynamicMesh3::~FDynamicMesh3()”, referenced from: FCreateMeshObjectParams::~FCreateMeshObjectParams() in VictoryBPFunctionLibrary.cpp.o

Anyone has gone through this before and could land me a hand?
Is it even compatible in first place?

Hello,
I have two questions :
First of all, is there a way to know that a .bat is finished ? I was thinking adding an exit but the pipe continue to print empty string.
And something else, actually my .bat is generating some TTS wav, si i was wondering if i can load in runtime the .wav with one of your add-on.
Thanks a lot

:zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap:
:zap: Victory Plugin 5.2 Is Live! :zap::zap:
:zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap::zap:

Dear Community,

:rose: Here now I present unto Thee, :rose:

:tulip: Victory Plugin 5.2 For UE! :tulip:

:heart:

Rama

PS: Download link is in t he Original Post for this Thread!

3 Likes

:clap: :clap: :clap:

1 Like

Hello, could this plugin get the location information of all vertices of the skeletal mesh corresponding to each frame of an animation sequence ?

THANK YOU!

Can I suggest a blueprint node ?
IT would be nice to expose UGameViewportClient::Lost/ReceiveFocus

Right now I’m figuring out if is possible to mute the game sound when the game lost focus (ALT+tab). Looks like I can only do this in C++. =/

2 Likes

Rama, your C++ code is beautiful! :sparkling_heart: But your philosophical code is also beautiful! :sparkling_heart: So you are a wonderful person yourself! I read the whole thread with pleasure! :cupid:
Is it possible to use the Get Static Mesh Vertex Locations function to change the position of the vertexes or only the entire model?

1 Like

Hey guys,

If you want VictoryBPLibrary to compile and package on linux:

change

#include "HAL/PlatformFilemanager.h"

to

#include "HAL/PlatformFileManager.h"

Line 27 of VictoryBPFunctionLibrary and don’t forget to add Linux to the PlaftformAllowList in the VictoryBPLibrary.uplugin

Is there a list of deprecated functions (and more importantly, their replacements) for the switch to 4 to 5? Not sure if it got buried in the thread but some of us are later to the party than others…

The source code is in my plugin, you can review the .h and see which nodes are present in the UE5 version.

If there are nodes you need from UE4 please let me know!

My intention was to trim out nodes ppl were not using, finding out which are needed, to keep the library compact.

Hee hee, thank you!

You could modify individual vertex positions after obtaining them, but please note that in UE5 this node does not work in a packaged game. I am investigating ways to obtain vertex data in packaged game context.

You’re Welcome!

:heart:

Rama

Rama,Victory Plugin 5.2 version missing a lot of things,for example: insert child as.Can add to plugin?

I’m having issues with the “Read from text file” Blueprints not working in 5.2.

To anyone that’s willing to help with this issue, is there a way to compile this plugin for Mac? I’ve been unable to successfully compile this plugin for Mac as Xcode ends up giving an error, even in blank projects.

I’ve modified the VictoryBPLibrary.uplugin to include Mac as a supported platform but haven’t had success with it running. First it’ll give an error of: cannot initialize return object of type ‘UStaticMesh *’ with an rvalue of type ‘bool’ on line 286 and 366. I change their return values to nullptr. But then I’m greeted with /Users/Shared/Epic Games/UE_5.2/clang:1:1 linker command failed with exit code 1 (use -v to see invocation)

Thing is I can’t see the log due to it failing the build so quickly that Xcode doesn’t log it.

To anyone that experienced a similar issue and was able to find a solution, can you please share your solution? Or is this a case of this plugin being exclusively for Windows and Linux?

Edit: The error specifically is: Undefined symbols for architecture arm64:
“UE::Geometry::FDynamicMesh3::~FDynamicMesh3()”, referenced from:
FCreateMeshObjectParams::~FCreateMeshObjectParams() in Module.VictoryBPLibrary.cpp.o

Edit: Fixed! I had to remove all references of DynamicMesh3, create mesh etc. Just keep chipping away at removing these until the errors are gone, this is more of an engine error rather than plugin. Great work Rama!

I was just wondering what color blind mode this is on :rofl: my TV hurts. Just saying pics and vids using the default color scheme would probably work better for those users.

Thank you, You’re welcome, and I am glad you got it working!!!

:heart:

Rama