NEW

NEW

#Overview

name: NEW

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of NEW is to handle object creation and initialization in the Unreal Editor. It appears to be a command-line or console command used within the editor for various operations.

This setting variable is primarily used in the UnrealEd module, which is part of the Unreal Engine’s editor subsystem. Specifically, it’s referenced in the EditorServer.cpp file, which suggests it’s related to editor-specific functionality.

The value of this variable is not set directly in the provided code snippets. Instead, it’s used as a command that triggers different actions depending on the context:

  1. In the SafeExec function, it’s used for generalized object importing with specific flags.
  2. In another context, it’s used to create a new, empty brush.
  3. In the HandleMapCommand function, it appears to be a deprecated command.

There don’t appear to be other variables directly interacting with NEW based on the provided code snippets. However, it does interact with other commands and flags, such as STANDALONE.

Developers should be aware that:

  1. The NEW command has different behaviors in different contexts within the editor.
  2. One usage of NEW (in HandleMapCommand) is marked as deprecated, suggesting it may be removed in future versions.
  3. When used for object importing, it sets specific object flags (RF_Public|RF_Standalone).

Best practices when using this variable:

  1. Be aware of the context in which NEW is being used, as its behavior changes.
  2. Consider using more modern alternatives for the deprecated usage in HandleMapCommand.
  3. When using NEW for object importing, ensure that the RF_Public and RF_Standalone flags are appropriate for your use case.
  4. Be cautious when modifying or extending functionality related to NEW, as it appears to be a core editor command with multiple uses.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorServer.cpp:324

Scope (from outer to inner):

file
function     bool UEditorEngine::SafeExec

Source code excerpt:

		return true;
	}
	else if( FParse::Command(&Str,TEXT("NEW")) )
	{
		// Generalized object importing.
		EObjectFlags Flags = RF_Public|RF_Standalone;
		if( FParse::Command(&Str,TEXT("STANDALONE")) )
		{
			Flags = RF_Public|RF_Standalone;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorServer.cpp:913

Scope: file

Source code excerpt:

		}
	}
	else if( FParse::Command (&Str,TEXT("NEW")) )
	{
		const FScopedTransaction Transaction( NSLOCTEXT("UnrealEd", "BrushNew", "Brush New") );
		WorldBrush->Brush->Modify(false);
		WorldBrush->Brush->Polys->Element.Empty();
		RedrawLevelEditingViewports();
		return true;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorServer.cpp:6097

Scope (from outer to inner):

file
function     bool UEditorEngine::HandleMapCommand

Source code excerpt:

		return Map_Rebuild( InWorld, Str, Ar );
	}
	else if( FParse::Command (&Str,TEXT("NEW")) )
	{
		return CommandIsDeprecated( TEXT("NEW"), Ar );
	}
	else if( FParse::Command( &Str, TEXT("LOAD") ) )
	{
		return Map_Load( Str, Ar );