Mass Battle Frameworkv1.20.0

MassBattleBakeTemplatePaths.h

Namespace Function

Source/MassBattleEditor/Public/Settings/MassBattleBakeTemplatePaths.h

概述Overview

插件的出厂默认值,只在一处解析:两个烘焙模板、槽位图集母材质与 sprite 母材质。设置页的构造函数用这里的结果预置对应的选择器,两个模板的烘焙播种也回落到同一个答案——所以「新工程打开工具就看到真实资产,而不是 None」这件事只有一个出处。

The plugin's factory defaults, resolved in one place: the two bake templates, the Slot Atlas master material and the sprite master material. The settings constructor seeds the corresponding pickers from here, and the bake's seed for the two templates falls back to the same answer — so “a fresh project sees real assets in the tools instead of None” has exactly one source.

解析顺序固定为先看插件自带的模板 ini,再用内置资产:ini 里有这个键就用它,文件或键缺失时回落到随插件发布的内置资产。预置只改变选择器显示什么——用户另选资产之前不会写入任何地方,「重置为默认值」返回的也正是这里的结果。

Resolution order is fixed: the plugin's template ini first, the built-in asset second. A key present in the ini wins; when the file or the key is missing, the asset shipped with the plugin is used. Seeding changes only what the pickers display — nothing is written until you pick another asset, and Reset to Defaults returns exactly here.

默认值解析How the defaults resolve

四个键都住在插件自带模板 ini 的同一个设置段里,键名与设置页上的四项一一对应。下表给出「ini 键」与「ini 缺失时的内置回落」——两者都可用时,ini 的值优先。

All four keys live in one settings section of the plugin's template ini, one per settings row. The table gives the ini key and the built-in fallback used when the ini is absent — when both exist, the ini value wins.

ini 键Key设置页上的行Settings row内置回落Built-in fallback
NSTemplate Bake Templates ▸ Niagara System TemplateBake Templates ▸ Niagara System Template /MassBattle/Core/Templates/NS_AgentRenderer_Template.NS_AgentRenderer_Template
RendererTemplate Bake Templates ▸ Renderer TemplateBake Templates ▸ Renderer Template /MassBattle/Core/Templates/BP_AgentRenderer_Template.BP_AgentRenderer_Template_C
SlotAtlasMaster Slot Atlas ▸ Atlas Master MaterialSlot Atlas ▸ Atlas Master Material /MassBattle/Core/Templates/M_SlotAtlasMaster.M_SlotAtlasMaster
SpriteMasterMaterial Sprite ▸ Sprite Master MaterialSprite ▸ Sprite Master Material /MassBattle/Core/Templates/M_SpriteMasterMF.M_SpriteMasterMF

插件随包发布了这份模板 ini,四个键都填了值;把文件或某个键删掉,才会落到表中的内置回落。ini 的内容不是「工程设置」——工程里保存过的值(在 Editor Preferences 里改过的)始终优先于这里的预置。

The plugin ships that template ini with all four keys filled; remove the file or a key and the built-in fallback from the table applies. The ini is not the project's setting — a value saved in the project (changed in Editor Preferences) always wins over this seed.

公开函数Public Functions

PluginIniPath inline FString

返回插件模板 ini 的绝对路径;插件找不到或文件不存在时返回空串。它以插件自己的安装目录为基准,因此工程插件、引擎安装与 Marketplace 安装三种部署方式都指向同一份文件。

Returns the absolute path of the plugin's template ini, or an empty string when the plugin or the file is missing. It is based on the plugin's own install directory, so a project plugin, an engine install and a Marketplace install all resolve to the same file.

Input

无参数。

No parameters.

Output

模板 ini 的绝对路径;文件不存在时为空串。无副作用(只查询路径与文件是否存在)。

The template ini's absolute path, or an empty string when it does not exist. No side effects (path and file existence are only queried).

DefaultNSTemplatePath inline FString

默认 Niagara 模板的对象路径:ini 的 NSTemplate 优先,否则用内置资产。这个模板在每次烘焙时被复制成单位自己的 NS_<name> 系统。

Object path of the default Niagara template: the ini's NSTemplate when present, otherwise the built-in asset. The bake duplicates this template into the unit's own NS_<name> system.

Input

无参数。

No parameters.

Output

默认 Niagara 系统的对象路径;永远非空(有内置回落)。无副作用。

The default Niagara system's object path, never empty (there is a built-in fallback). No side effects.

DefaultRendererTemplatePath inline FString

默认渲染器类的对象路径:ini 的 RendererTemplate 优先,否则用内置蓝图。这个类在每次烘焙时被复制成单位自己的 Renderer_<name> 蓝图。

Object path of the default renderer class: the ini's RendererTemplate when present, otherwise the built-in Blueprint. The bake duplicates this class into the unit's own Renderer_<name> Blueprint.

Input

无参数。

No parameters.

Output

默认渲染器蓝图类(对象路径);永远非空。无副作用。

The default renderer Blueprint class as an object path, never empty. No side effects.

DefaultSlotAtlasMasterPath inline FString

默认槽位图集母材质的对象路径:ini 的 SlotAtlasMaster 优先,否则用内置材质。它是「新工程开箱即可烘焙」的前提——没配置母材质时 Bake Atlas 会拒绝。

Object path of the default Slot Atlas master material: the ini's SlotAtlasMaster when present, otherwise the built-in material. It is what lets a fresh project bake out of the box — Bake Atlas refuses when no master is configured.

Input

无参数。

No parameters.

Output

默认母材质的对象路径;永远非空。无副作用。

The default master material's object path, never empty. No side effects.

DefaultSpriteMasterMaterialPath inline FString

默认 sprite 母材质的对象路径:ini 的 SpriteMasterMaterial 优先,否则用内置材质。它只是回落——图集自带母材质时仍用图集那一份,所以这条预置不会改变已配置图集的烘焙结果。

Object path of the default sprite master material: the ini's SpriteMasterMaterial when present, otherwise the built-in material. It is a fallback only — an atlas that carries its own master keeps using it, so this seed cannot change how an already-configured atlas bakes.

Input

无参数。

No parameters.

Output

默认 sprite 母材质的对象路径;永远非空。无副作用。

The default sprite master material's object path, never empty. No side effects.

管线角色Pipeline Role

这里的四个答案被插件设置的构造函数读取,用来预置那四个选择器;之后所有工具都只读设置里的值。用户能看见的效果:新工程打开 Editor Preferences ▸ Plugins ▸ MassBattle 时,四项已经显示真实资产;烘焙时复制的是同一个模板;把某项改成别的资产会让它保存在工程里,Reset to Defaults 回到这里。

The four answers here are read by the plugin settings constructor to seed those four pickers; every tool afterwards reads the settings value alone. What you observe: in a fresh project, Editor Preferences ▸ Plugins ▸ MassBattle already shows real assets in those four rows; the bake duplicates the same template; picking another asset persists it in the project, and Reset to Defaults returns here.

补充说明Notes

① 预置不写盘:构造设置对象时预置的值只改变选择器显示,除非你另选资产,否则不会写进工程配置。② 两种母材质的失效方式不同:槽位图集母材质整条清空会让 Bake Atlas 拒绝;sprite 母材质只在图集自身也没有母材质时才需要,两边都没有时 sprite 材质实例被跳过(Generate 会记一行),无头烘焙则直接拒绝。③ 模板 ini 只读:工具不会回写这个文件,你在设置页里选的值保存在工程自己的编辑器配置里。

① Seeding writes nothing: the values seeded while the settings object is built only change what the pickers display; unless you pick another asset they never enter the project's config. ② The two masters fail differently: clearing the Slot Atlas master entirely makes Bake Atlas refuse; the sprite master is needed only when the atlas has no master of its own — with neither, the sprite material instance is skipped (Generate logs it) and the headless bake refuses. ③ The template ini is read-only to the tools: nothing writes it back, and what you pick in the settings page is saved in the project's own editor config.