MassUnits

MassUnits

#Overview

name: MassUnits

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of MassUnits is to specify the units of measurement for displaying mass values within the Unreal Engine editor. This setting variable is part of the editor’s project appearance configuration, allowing developers to customize how mass-related information is presented in the user interface.

MassUnits is primarily used by the Unreal Editor subsystem, specifically within the Editor Project Settings module. It’s part of the UEditorProjectAppearanceSettings class, which is responsible for managing various visual and display-related settings for the editor.

The value of this variable is set through the Editor Project Settings interface in the Unreal Engine editor. It can also be modified programmatically through the UEditorProjectAppearanceSettings class.

MassUnits interacts with other unit-related variables such as DistanceUnits, TimeUnits, and AngleUnits. Together, these variables form a comprehensive system for controlling unit display across different physical quantities in the editor.

Developers should be aware that changes to MassUnits will affect how mass values are displayed throughout the editor. This can impact the readability and interpretation of mass-related data in various tools and interfaces within Unreal Engine.

Best practices when using this variable include:

  1. Choosing units that are most appropriate for the scale of your project (e.g., grams for small objects, kilograms for human-sized objects, or metric tons for large structures).
  2. Ensuring consistency with other unit choices in your project to avoid confusion.
  3. Considering the target audience and their familiarity with different mass units when selecting options.
  4. Being mindful of how changes to this setting might affect existing projects or team workflows.
  5. Documenting the chosen units clearly for all team members to ensure consistent interpretation of mass values across the project.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditor.ini:525, section: [/Script/UnrealEd.EditorProjectAppearanceSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/EditorProjectSettings.cpp:89

Scope (from outer to inner):

file
function     void UEditorProjectAppearanceSettings::PostEditChangeProperty

Source code excerpt:

		Settings.SetDisplayUnits(EUnitType::Distance, DistanceUnits);
	}
	else if (Name == GET_MEMBER_NAME_CHECKED(UEditorProjectAppearanceSettings, MassUnits))
	{
		Settings.SetDisplayUnits(EUnitType::Mass, MassUnits);
	}
	else if (Name == GET_MEMBER_NAME_CHECKED(UEditorProjectAppearanceSettings, TimeUnits))
	{
		Settings.SetDisplayUnits(EUnitType::Time, TimeUnits);
	}
	else if (Name == GET_MEMBER_NAME_CHECKED(UEditorProjectAppearanceSettings, AngleUnits))

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/EditorProjectSettings.cpp:159

Scope (from outer to inner):

file
function     void UEditorProjectAppearanceSettings::PostInitProperties

Source code excerpt:

	/** Setup the meta data for the array properties */
	SetupEnumMetaData(GetClass(), GET_MEMBER_NAME_CHECKED(UEditorProjectAppearanceSettings, DistanceUnits), TEXT("Micrometers, Millimeters, Centimeters, Meters, Kilometers, Inches, Feet, Yards, Miles"));
	SetupEnumMetaData(GetClass(), GET_MEMBER_NAME_CHECKED(UEditorProjectAppearanceSettings, MassUnits), TEXT("Micrograms, Milligrams, Grams, Kilograms, MetricTons,	Ounces, Pounds, Stones"));
	SetupEnumMetaData(GetClass(), GET_MEMBER_NAME_CHECKED(UEditorProjectAppearanceSettings, TimeUnits), TEXT("Milliseconds, Seconds, Minutes, Hours, Days, Months, Years"));

	if (UnitDisplay_DEPRECATED != EUnitDisplay::Invalid)
	{
		bDisplayUnits = UnitDisplay_DEPRECATED != EUnitDisplay::None;
	}

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/EditorProjectSettings.cpp:176

Scope (from outer to inner):

file
function     void UEditorProjectAppearanceSettings::PostInitProperties

Source code excerpt:


	Settings.SetDisplayUnits(EUnitType::Distance, DistanceUnits);
	Settings.SetDisplayUnits(EUnitType::Mass, MassUnits);
	Settings.SetDisplayUnits(EUnitType::Time, TimeUnits);
	Settings.SetDisplayUnits(EUnitType::Angle, AngleUnits);
	Settings.SetDisplayUnits(EUnitType::Speed, SpeedUnits);
	Settings.SetDisplayUnits(EUnitType::Temperature, TemperatureUnits);
	Settings.SetDisplayUnits(EUnitType::Force, ForceUnits);

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Public/Settings/EditorProjectSettings.h:78

Scope (from outer to inner):

file
class        class UEditorProjectAppearanceSettings : public UDeveloperSettings

Source code excerpt:


	UPROPERTY(EditAnywhere, config, Category=Units, AdvancedDisplay, meta=(DisplayName="Mass", Tooltip="Choose a set of units in which to display masses."))
	TArray<EUnit> MassUnits;

	UPROPERTY(EditAnywhere, config, Category=Units, AdvancedDisplay, meta=(DisplayName="Time", Tooltip="Choose the units in which to display time."))
	TArray<EUnit> TimeUnits;
	
	UPROPERTY(EditAnywhere, config, Category=Units, AdvancedDisplay, meta=(DisplayName="Angles", Tooltip="Choose the units in which to display angles.", ValidEnumValues="Degrees, Radians"))
	EUnit AngleUnits;