UntrackRenderAsset

UntrackRenderAsset

#Overview

name: UntrackRenderAsset

This variable is created as a Console Variable (cvar).

It is referenced in 6 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of UntrackRenderAsset is to remove a specific render asset (such as a texture or mesh) from the list of tracked assets in Unreal Engine’s content streaming system.

This setting variable is primarily used in the content streaming subsystem of Unreal Engine, specifically within the rendering and asset management modules. Based on the callsites, it’s mainly referenced in the ContentStreaming.cpp and StreamingManagerTexture.cpp files, which are part of the Engine’s runtime.

The value of this variable is not set directly, as it’s a function rather than a variable. Instead, it’s a boolean function that takes an asset name as a parameter and returns true if the asset was successfully removed from tracking.

UntrackRenderAsset interacts with other functions and variables in the content streaming system, such as:

  1. GTrackedRenderAssetNames: A global array that stores the names of tracked render assets.
  2. TrackRenderAsset: A complementary function that adds assets to the tracking list.
  3. ListTrackedRenderAssets: A function that lists all currently tracked assets.

Developers should be aware of the following when using UntrackRenderAsset:

  1. It’s part of the content streaming system, which affects performance and memory usage.
  2. The function works with asset names, so ensure the correct and full asset name is provided.
  3. Untracking an asset may affect how it’s loaded and managed in memory.

Best practices when using UntrackRenderAsset include:

  1. Use it judiciously, as tracking assets is generally beneficial for performance.
  2. Ensure you have a good reason to untrack an asset, such as manual management or debugging.
  3. Keep track of which assets you’ve untracked to avoid confusion in asset management.
  4. Use in conjunction with other streaming management tools and functions for a comprehensive approach to asset streaming.
  5. Be aware of the performance implications of frequently tracking and untracking assets.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ContentStreaming.cpp:182

Scope (from outer to inner):

file
function     bool UntrackRenderAsset

Source code excerpt:

 * @return				true if the name was removed
 */
bool UntrackRenderAsset( const FString& AssetName )
{
	if ( GConfig && AssetName.Len() > 0 )
	{
		int32 TrackedAssetIndex = 0;
		for ( ; TrackedAssetIndex < GTrackedRenderAssetNames.Num(); ++TrackedAssetIndex)
		{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ContentStreaming.cpp:208

Scope (from outer to inner):

file
function     bool UntrackTexture

Source code excerpt:

bool UntrackTexture(const FString& TextureName)
{
	return UntrackRenderAsset(TextureName);
}

/**
 * Lists all currently tracked texture/mesh names in the specified log.
 *
 * @param Ar			Desired output log

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ContentStreaming.cpp:335

Scope (from outer to inner):

file
function     bool UntrackRenderAsset

Source code excerpt:

	return TrackRenderAsset(TextureName);
}
bool UntrackRenderAsset(const FString& AssetName)
{
	return false;
}
bool UntrackTexture( const FString& TextureName )
{
	return UntrackRenderAsset(TextureName);
}
void ListTrackedRenderAssets(FOutputDevice& Ar, int32 NumAssets)
{
}
void ListTrackedTextures( FOutputDevice& Ar, int32 NumTextures )
{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/StreamingManagerTexture.cpp:91

Scope: file

Source code excerpt:


bool TrackRenderAsset( const FString& AssetName );
bool UntrackRenderAsset( const FString& AssetName );
void ListTrackedRenderAssets( FOutputDevice& Ar, int32 NumTextures );

/**
 * Helper function to clamp the mesh to camera distance
 */
FORCEINLINE float ClampMeshToCameraDistanceSquared(float MeshToCameraDistanceSquared)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/StreamingManagerTexture.cpp:2498

Scope (from outer to inner):

file
function     bool FRenderAssetStreamingManager::HandleUntrackRenderAssetCommand

Source code excerpt:


	FString AssetName(FParse::Token(Cmd, 0));
	if (UntrackRenderAsset(AssetName))
	{
		Ar.Logf(TEXT("Textures or meshes containing \"%s\" are no longer tracked."), *AssetName);
	}
	return true;
}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/StreamingManagerTexture.cpp:2949

Scope (from outer to inner):

file
function     bool FRenderAssetStreamingManager::Exec

Source code excerpt:

	}
	else if (FParse::Command(&Cmd,TEXT("UntrackTexture"))
		|| FParse::Command(&Cmd, TEXT("UntrackRenderAsset")))
	{
		return HandleUntrackRenderAssetCommand( Cmd, Ar );
	}
	else if (FParse::Command(&Cmd,TEXT("StreamOut")))
	{
		return HandleStreamOutCommand( Cmd, Ar );