OBJ
OBJ
#Overview
name: OBJ
This variable is created as a Console Variable (cvar).
- type:
Exec
- help:
Sorry: Exec commands have no help
It is referenced in 14
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of OBJ is to handle various operations related to Object files (.obj) in Unreal Engine 5. It serves multiple functions across different subsystems and modules, primarily in the context of importing, exporting, and manipulating 3D geometry data.
This setting variable is utilized by several Unreal Engine subsystems, plugins, and modules, including:
- Enhanced Input Plugin
- Geometry Collection Plugin
- nDisplay Plugin
- UnrealEd (Editor)
- Core UObject system
- Engine runtime
The value of this variable is not set in a single location, but rather used as a keyword or identifier in various contexts throughout the engine code.
OBJ interacts with other variables and systems related to 3D geometry, file I/O, and object manipulation. Some notable interactions include:
- Static mesh and level exporters
- Mesh geometry loaders and containers
- Object file format handling
Developers should be aware of the following when using OBJ:
- It’s used in multiple contexts, so understanding the specific usage in each case is crucial.
- It’s often associated with file operations, particularly for 3D geometry data.
- It’s used in both editor and runtime contexts, so consider the implications for both development and shipping builds.
Best practices when using OBJ include:
- When working with OBJ file imports or exports, ensure proper error handling and validation of the data.
- Be mindful of performance implications when dealing with large OBJ files, especially in runtime scenarios.
- When extending or modifying OBJ-related functionality, maintain consistency with existing usage patterns across the engine.
- Document any custom implementations or extensions to OBJ handling to ensure clarity for other developers.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/InputEditor/Private/InputEditorModule.cpp:85
Scope (from outer to inner):
file
function UInputMappingContext_Factory::UInputMappingContext_Factory
Source code excerpt:
// InputContext
UInputMappingContext_Factory::UInputMappingContext_Factory(const class FObjectInitializer& OBJ) : Super(OBJ) {
SupportedClass = UInputMappingContext::StaticClass();
bEditAfterNew = true;
bCreateNew = true;
}
bool UInputMappingContext_Factory::ConfigureProperties()
#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/InputEditor/Private/InputEditorModule.cpp:160
Scope (from outer to inner):
file
function UInputAction_Factory::UInputAction_Factory
Source code excerpt:
// InputAction
UInputAction_Factory::UInputAction_Factory(const class FObjectInitializer& OBJ)
: Super(OBJ)
{
SupportedClass = UInputAction::StaticClass();
bEditAfterNew = true;
bCreateNew = true;
}
#Loc: <Workspace>/Engine/Plugins/EnhancedInput/Source/InputEditor/Private/InputEditorModule.cpp:217
Scope (from outer to inner):
file
function UPlayerMappableInputConfig_Factory::UPlayerMappableInputConfig_Factory
Source code excerpt:
PRAGMA_DISABLE_DEPRECATION_WARNINGS
// UPlayerMappableInputConfig_Factory
UPlayerMappableInputConfig_Factory::UPlayerMappableInputConfig_Factory(const class FObjectInitializer& OBJ)
: Super(OBJ)
{
SupportedClass = UPlayerMappableInputConfig::StaticClass();
bEditAfterNew = true;
bCreateNew = true;
}
#Loc: <Workspace>/Engine/Plugins/Experimental/GeometryCollectionPlugin/Source/GeometryCollectionNodes/Public/Dataflow/GeometryCollectionDebugNodes.h:110
Scope: file
Source code excerpt:
{
GENERATED_USTRUCT_BODY()
DATAFLOW_NODE_DEFINE_INTERNAL(FMeshToOBJStringDebugDataflowNode, "Convert Mesh to OBJ String", "GeometryCollection|Development", "")
public:
UPROPERTY(meta = (DataflowInput))
TObjectPtr<UDynamicMesh> Mesh;
// Whether to flip the orientation of the triangles in the OBJ output
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayCluster/Private/Render/Containers/DisplayClusterRender_MeshGeometry.cpp:102
Scope (from outer to inner):
file
function bool FDisplayClusterRender_MeshGeometry::LoadFromFile
Source code excerpt:
switch (Format)
{
case EDisplayClusterRender_MeshGeometryFormat::OBJ:
{
FDisplayCluster_MeshGeometryLoaderOBJ LoaderOBJ(*this);
return LoaderOBJ.Load(FullPathFileName);
}
default:
break;
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayCluster/Public/Render/Containers/DisplayClusterRender_MeshGeometry.h:8
Scope: file
Source code excerpt:
enum class EDisplayClusterRender_MeshGeometryFormat : uint8
{
OBJ = 0,
};
enum class EDisplayClusterRender_MeshGeometryCreateType : uint8
{
Passthrough = 0,
};
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayCluster/Public/Render/Containers/DisplayClusterRender_MeshGeometry.h:27
Scope (from outer to inner):
file
class class FDisplayClusterRender_MeshGeometry
Source code excerpt:
public:
// Load geometry from OBJ file
bool LoadFromFile(const FString& FullPathFileName, EDisplayClusterRender_MeshGeometryFormat Format = EDisplayClusterRender_MeshGeometryFormat::OBJ);
// Test purpose: create square geometry
void CreatePassthrough();
public:
TArray<FVector> Vertices;
TArray<FVector> Normal;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorExporters.cpp:1476
Scope (from outer to inner):
file
function ULevelExporterOBJ::ULevelExporterOBJ
Source code excerpt:
bForceFileOperations = true;
PreferredFormatIndex = 0;
FormatExtension.Add(TEXT("OBJ"));
FormatDescription.Add(TEXT("Object File"));
}
bool ULevelExporterOBJ::ExportText(const FExportObjectInnerContext* Context, UObject* Object, const TCHAR* Type, FOutputDevice& FileAr, FFeedbackContext* Warn, uint32 PortFlags)
{
TSet<UMaterialInterface*> GlobalMaterials;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorExporters.cpp:1802
Scope (from outer to inner):
file
function UPolysExporterOBJ::UPolysExporterOBJ
Source code excerpt:
bText = true;
PreferredFormatIndex = 0;
FormatExtension.Add(TEXT("OBJ"));
FormatDescription.Add(TEXT("Object File"));
}
bool UPolysExporterOBJ::ExportText(const FExportObjectInnerContext* Context, UObject* Object, const TCHAR* Type, FOutputDevice& Ar, FFeedbackContext* Warn, uint32 PortFlags)
{
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorExporters.cpp:1860
Scope (from outer to inner):
file
function UStaticMeshExporterOBJ::UStaticMeshExporterOBJ
Source code excerpt:
bText = true;
PreferredFormatIndex = 0;
FormatExtension.Add(TEXT("OBJ"));
FormatDescription.Add(TEXT("Object File"));
}
bool UStaticMeshExporterOBJ::ExportText(const FExportObjectInnerContext* Context, UObject* Object, const TCHAR* Type, FOutputDevice& Ar, FFeedbackContext* Warn, uint32 PortFlags)
{
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorServer.cpp:5676
Scope: file
Source code excerpt:
// General objects
//
else if( FParse::Command(&Str,TEXT("OBJ")) )
{
if( Exec_Obj( Str, Ar ) )
{
return true;
}
}
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/UnrealEdSrv.cpp:648
Scope (from outer to inner):
file
function bool UUnrealEdEngine::Exec
Source code excerpt:
// NOTE: The actual package saving happens in the UEditorEngine::Exec_Obj, but we do the
// thumbnail generation here in UnrealEd
if( FParse::Command(&Str,TEXT("OBJ")) && !IsRunningCommandlet() )
{
Pkg = GeneratePackageThumbnailsIfRequired( Str, Ar, ThumbNamesToUnload );
}
// If we don't have a viewport specified to catch the stat commands, use to the active viewport. If there is a game viewport ignore this as we do not want
if (GStatProcessingViewportClient == NULL && (GameViewport == NULL || GameViewport->IsSimulateInEditorViewport() ) )
#Loc: <Workspace>/Engine/Source/Runtime/CoreUObject/Private/UObject/Obj.cpp:4586
Scope (from outer to inner):
file
function bool StaticExec
Source code excerpt:
return true;
}
else if( FParse::Command(&Str,TEXT("OBJ")) )
{
if( FParse::Command(&Str,TEXT("CYCLES")) )
{
// find all cycles in the reference graph
FFindStronglyConnected IndexSet;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:5172
Scope: file
Source code excerpt:
return HandleTogglegtPsysLODCommand( Cmd, Ar );
}
else if( FParse::Command(&Cmd,TEXT("OBJ")) )
{
return HandleObjCommand( Cmd, Ar );
}
else if( FParse::Command( &Cmd, TEXT("TESTSLATEGAMEUI")) && InWorld && InWorld->IsGameWorld() )
{
return HandleTestslateGameUICommand( Cmd, Ar );