SMassBattleAgentCreatorPanel
Source/MassBattleEditor/Public/AgentCreator/SMassBattleAgentCreatorPanel.h
概述Overview
MassBattle Agent Creator 工具窗口:把「源资产 → 生成资产 → 烘焙」整条流水线收进一个可停靠的 Slate 面板。它有两个工具模式——Standard 与 Advanced——两者共用同一个 Generate 按钮;模式由模型来源自动决定(模型源带 assembly 模板时走 Advanced,否则走 Standard),它决定详情视图里出现哪些输入槽、子步骤卡片显示哪一页,以及 Generate 实际执行的步骤序列。Sprite 是逐 LOD 档的渲染模式之一,不是顶层工具模式。
The MassBattle Agent Creator tool window: a dockable Slate panel that holds the whole "source assets to generated assets to bake" pipeline in one place. It has two tool modes — Standard and Advanced — both driven by the same Generate button; the mode is derived automatically from the model source (an assembly template in the model source selects Advanced, anything else Standard), and it decides which input slots the details view shows, which sub-step page is displayed, and what Generate actually runs. Sprite is one of the per-LOD render modes, not a top-level tool mode.
窗口分三层:顶部是操作区(Generate / Clear、四个工具入口、Show Substeps 与子步骤卡),中部是绑定面板状态对象的详情视图(全部输入与生成结果),底部是可拖拽高度的日志区。所有输入即时生效;Generate 真正开始烘焙时会打开 烘焙进度窗口,并在结束时给出成功或失败结论。
The window has three layers: an action area at the top (Generate / Clear, the four tool entries, Show Substeps and the sub-step card), a details view in the middle bound to the panel's state object (all inputs and generated results), and a resizable log dock at the bottom. Every input takes effect immediately; when Generate actually starts baking it opens the bake progress window and reports success or failure when it finishes.
打开方式Opening the Window
窗口是一个可停靠的编辑器工具标签页,两条入口等价;标签已经存在时只会把它聚焦到前台,不会重复开窗。关闭后再次打开只恢复子步骤区的展开状态(按工程记在编辑器配置里);源资产、名称与路径不随窗口记忆,它们在填入单位配置时由配置里存的烘焙配方还原。
The window is a dockable editor tool tab, and the two entry points are equivalent; if the tab already exists it is brought to the front rather than opened twice. Reopening after closing restores only whether the sub-step area was expanded (recorded per project in the editor config); sources, names and paths are not remembered by the window — they come back from the bake recipe stored in a unit config when one is assigned.
| 入口Entry | 操作Action |
|---|---|
| 编辑器主菜单Editor main menu | Window → Tools → Mass Battle Agent Creator。Window → Tools → Mass Battle Agent Creator. |
| 关卡编辑器工具栏Level editor toolbar | 工具栏上的 Mass Battle Agent Creator 按钮(位于 Content 分组之后)。The Mass Battle Agent Creator button on the toolbar (placed after the Content group). |
窗口布局Window Layout
自上而下的控件顺序固定;只有随模式变化的行会隐藏或折叠,其余行常驻。
The top-to-bottom control order is fixed; only mode-dependent rows hide or collapse, while the rest stay in place.
| 区域Region | 内容Content | 行为Behavior |
|---|---|---|
| 生成行Generate row | Generate(绿色,较宽)与 Clear(红色,较窄)。Generate (green, wider) and Clear (red, narrower). | Generate 跑完整管线(真正开始烘焙时打开进度窗);Clear 清空源引用(模型源 ATT 及其动画桶、sprite 图集与材质实例、actor 类)、名称与路径、档位表(回到单条 BoneCS 档)与生成结果引用,并把单位配置清单重置为一条空槽。推导出的 Tool Mode、面板上的烘焙模板与磁盘上的资产保留。Generate runs the full pipeline (opening the progress window once baking actually starts); Clear wipes the source references (the model-source ATT with its anim buckets, the sprite atlas and material instance, and the actor class), the names and paths, the band table (back to one BoneCS band) and the generated-result references, and resets the unit-config list to a single empty slot. The derived tool mode, the panel's bake templates and on-disk assets survive. |
| 模式行Mode row | Show Substeps 复选框(Tool Mode 不是下拉:它由模型来源自动推导)。A Show Substeps checkbox (Tool Mode is not a combo — it is derived from the model source). | Tool Mode 由模型来源自动推导,不在模式行选择;Show Substeps 展开或折叠子步骤卡(默认折叠)。Advanced 下标签与复选框一起隐藏。Tool Mode is derived from the model source and is not selected here; Show Substeps expands or collapses the sub-step card (collapsed by default). Both the label and checkbox hide in Advanced. |
| 子步骤卡Sub-step card | 单张按渲染族显隐的步骤卡(Standard),或一段提示加一行模板状态(Advanced)。One step card gated by render family (Standard), or a hint plus one live template status line (Advanced). | 受 Show Substeps 控制;Advanced 下整卡始终折叠。详见下方「子步骤卡片」。Controlled by Show Substeps; the whole card always stays collapsed in Advanced. See "Sub-step Cards" below. |
| 工具入口行Tool entry row | 四等分的 Assembly、Mesh Prep、Sprite Prep、Tool Box。Four equal-width buttons: Assembly, Mesh Prep, Sprite Prep and Tool Box. | 任何模式下都在同一行、都可见;前三枚打开各自的可停靠工具标签页,Tool Box 是源工具菜单(合并网格、合并材质槽位、合并母材质、规范 LOD、Batch Renamer)。All four sit on one row and stay visible in every mode; the first three open their own dockable tool tabs, and Tool Box is the source-tool menu (merge meshes, merge material slots, merge materials, standardize LOD, Batch Renamer). |
| 详情视图Details view | 面板状态对象的四个分类:0.RenderProfile(单位配置清单、资产名、生成路径)、1.RenderBands(档位表)、2.RenderSources(模型源 ATT、sprite 图集、actor 类)、3.GeneratedAssets(烘焙产物)。The panel state object's four categories: 0.RenderProfile (the unit-config list, asset name and generate path), 1.RenderBands (the band table), 2.RenderSources (the model-source ATT, sprite atlas and actor class) and 3.GeneratedAssets (the bake outputs). |
可编辑区域;分类内的源行与产物行随档位表用到的渲染族显示或隐藏。填入单位配置会载入它存的配方,切换模型源 ATT 会当场重新推导 Tool Mode。The editable area; source and output rows appear or hide with the render families the band table uses. Assigning a unit config loads its stored recipe, and changing the model-source ATT re-derives the tool mode on the spot. |
| 日志区Log dock | 标题为 Log 的控制台风格文本区。A console-style text area titled Log. | 显示最近 20 行,自动滚到最新;向上拖分隔条可增大高度。无内容时显示占位文案。Shows the last 20 lines, auto-scrolled to the newest; drag the splitter up to make it taller. A placeholder shows when empty. |
工具模式Tool Modes
两个模式共享同一套外壳与同一道覆盖预检,但输入与 Generate 序列不同。模式不是面板上的选择:它由模型来源自动推导——模型源带 assembly 模板时走 Advanced,否则走 Standard。Sprite 是逐 LOD 档可选的渲染模式,不是顶层工具模式。
The two modes share the same shell and the same pre-flight overwrite gate, but differ in inputs and the Generate sequence. The mode is not a panel choice: it is derived automatically from the model source — an assembly template selects Advanced, anything else Standard. Sprite is a per-LOD render mode, not a top-level tool mode.
| 模式Mode | 主要输入Primary inputs | Generate 执行Generate runs | 相关入口Related entry |
|---|---|---|---|
Standard |
模型源 ATT(骨骼网格及其八个动画桶,或 sprite 图集)、档位表与逐档渲染模式。The model-source ATT (a skeletal mesh with its eight anim buckets, or a sprite atlas), the band table and the per-band render mode. | 按档位表执行单单位快速路径:网格档转静态网格 + VAT;Sprite 档装配 sprite 渲染器、数据资产与材质实例,不烘像素。The single-unit quickpath driven by the band table: mesh bands convert a static mesh + VAT; sprite bands assemble the sprite renderer, data asset and material instance, with no pixel baking. | Mesh Prep / Sprite Prep(源预填)。Mesh Prep / Sprite Prep (source prep). |
Advanced |
模型源 ATT 上的 Assembly 模板蓝图。The Assembly template Blueprint stored on the model-source ATT. | 一次复合烘焙:按版本烘焙 VAT、重建多部件渲染结构(一个部件一个分支、一个版本一个单网格渲染器)并应用组合配方。One composite bake: per-version VAT bakes, the multi-part render structure (one branch per part, one single-mesh renderer per version) and the combination recipe. | Assembly |
覆盖预检Pre-flight Overwrite Gate
两个模式共用同一道预检:Generate 先扫描输出路径下由本工具生成的资产(名称以当前 AssetName 或 NS_ / Renderer_ / VAT_ / AnimDataTex_ / Mat_ / DA_ / AgentConfig_ / MI_ / SM_ 开头)。若找到,弹出一个阻塞确认窗,按资产类型 × 数量列出;Overwrite 继续原位覆盖,Cancel 直接中止、一个资产都不动。首次烘焙没有已存在资产时不会开窗,直接开跑。
Both modes share one gate: Generate first scans the output path for assets created by this tool (names starting with the current AssetName or with NS_, Renderer_, VAT_, AnimDataTex_, Mat_, DA_, AgentConfig_, MI_ or SM_). If any are found, a blocking confirmation lists them grouped by asset class and count; Overwrite continues the in-place bake, Cancel aborts with nothing touched. A first bake with no existing assets skips the dialog and starts directly.
Standard Standard
Standard 的网格档是一条单骨骼网格的 quickpath,按固定五步执行,每一步之间进度窗刷新:① 把骨骼网格转换为带逐 LOD 段的静态网格,并按母材质创建材质实例;② 复制 Niagara 系统与渲染器蓝图并接好默认值;③ 把预填好的 ATT 绑为 AnimToTex 源,并创建或配置 AgentConfig 数据资产;④ 逐 LOD 创建 VAT 纹理占位;⑤ 逐 LOD 执行 AnimToTexture 烘焙并接线材质槽。部件级产物(静态网格、材质实例、VAT 纹理、AnimDataTex)落在 GeneratePath/P0,单位级产物(NS、渲染器、AgentConfig)留在 GeneratePath 根目录。
Standard's mesh band is the single-skeletal-mesh quickpath; it runs five fixed steps, refreshing the progress window between them: ① convert the skeletal mesh into a static mesh with per-LOD sections and create material instances from the master material; ② duplicate the Niagara system and renderer Blueprint and wire their defaults; ③ bind the prepared ATT as the AnimToTex source and create or configure the AgentConfig data asset; ④ create placeholder VAT textures per LOD; ⑤ run the AnimToTexture bake per LOD and wire the material slots. Part-level products (static mesh, material instances, VAT textures, AnimDataTex) land in GeneratePath/P0; agent-level products (NS, renderer, AgentConfig) stay at the root of GeneratePath.
模型源 ATT 只带骨骼网格或 assembly 模板之一(两者互斥,都在 Mesh Prep 里填写);一旦它带的是模板,工具模式自动成为 Advanced,Generate 走复合烘焙,不会留在 Standard。
The model-source ATT carries either a skeletal mesh or an assembly template, never both (both are authored in Mesh Prep); when it carries a template, the tool mode becomes Advanced automatically and Generate runs the composite bake instead of Standard.
Advanced Advanced
该模式只有一件源输入:模型源 ATT 上存的 assembly 模板蓝图(在 Mesh Prep 填写)。Generate 跑一次复合烘焙——逐版本烘焙 VAT、重建多部件渲染结构(一个部件一个分支、一个版本一个单网格渲染器)、应用组合配方;进度窗只有一个驱动步骤,过程细节全部流进日志。模型源里没有模板、或那份资产上不是模板蓝图时不会打开进度窗,面板日志直接给出提示。
This mode has a single source input: the assembly template Blueprint stored on the model-source ATT (authored in Mesh Prep). Generate runs one composite bake — the per-version VAT bakes, the multi-part render structure (one branch per part, one single-mesh renderer per version), and the combination recipe; the progress window carries a single driving step while the details stream into the log. With no template in the model source, or an asset that does not carry a template Blueprint, no progress window opens and the panel log reports it instead.
Sprite (Atlas) Sprite (Atlas)
Standard 的 Sprite 档:图集装配,不烘焙任何像素。Generate 依次创建 Sprite 渲染器、以图集资产自带的母材质创建 Sprite 材质实例并写入图集与列/行参数(图集没有自带母材质时回落到编辑器偏好里的 Sprite Master Material),再按图集的逐桶帧区间创建并配置 AgentConfig 数据资产。图集本身由美术制作,或用 Sprite Prep 工具烘焙后回填。
Standard's sprite band: atlas assembly, with no pixels baked. Generate creates the sprite renderer, creates the sprite material instance from the atlas asset's own master material and writes the atlas and column/row parameters (falling back to the Sprite Master Material in Editor Preferences when the atlas carries none), then creates and configures the AgentConfig data asset from the atlas's per-bucket frame ranges. The atlas itself is artist-made or baked with Sprite Prep and applied back.
工具入口Tool Entries
入口行是四个等宽按钮,任何模式下都可见;前三枚各自打开可停靠的独立工具标签页,标签已存在时只聚焦,不重复开窗,并在标签生成时让目标窗口绑定当前会话的面板实例或状态,因此回填能直接写进当前会话。Tool Box 是菜单,不是页签,也不写面板状态。
The entry row holds four equal-width buttons, visible in every mode; the first three each open their own dockable tool tab, an existing tab is focused rather than duplicated, and at spawn time the target window binds to the live panel instance or state so applying results writes straight into the current session. Tool Box is a menu, not a tab, and writes no panel state.
| 按钮Button | 可见模式Visible in | 作用Effect |
|---|---|---|
| Assembly | 任何模式Any mode | 打开 Assembly 窗口:配置部件类别与版本、录制组合并在关卡视口预览;保存的模板存入模型源 ATT(Mesh Prep 的 Mesh Asset 槽)后即成为本模式的唯一输入,且必须是 assembly 模板蓝图。Opens the Assembly window: configure part categories and versions, capture combinations and preview them in the level viewport; the saved template becomes this mode's only input once stored on the model-source ATT (Mesh Prep's Mesh Asset slot), and it must be an assembly template Blueprint. |
| Mesh Prep | 任何模式Any mode | 打开 Mesh Prep:挑骨骼网格并把动画分进八个桶,或把 assembly 模板放上同一份 ATT——模型源(网格或模板,二选一)在这里填写。Opens Mesh Prep: pick the skeletal mesh and tag its clips into the eight buckets, or put an assembly template on the same ATT — the model source (mesh or template, one of the two) is authored here. |
| Sprite Prep | 任何模式Any mode | 打开 Sprite Prep:按八个固定动画桶填写有序帧、烘焙成一张网格图集并产出帧区间,再把图集、列/行与帧区间回填到本面板。Opens Sprite Prep: author ordered frames into the eight fixed animation buckets, bake them into one grid atlas with frame ranges, then apply the atlas, columns/rows and frame ranges back into this panel. |
| Tool Box | 任何模式Any mode | 四个源工具加 Batch Renamer 的菜单,按合并流水线排列:Merge Meshes、Merge Mat Slots(以本面板模型源为输入)、Merge Materials、Standardize LOD(两者以空范围打开),最后是 Batch Renamer(空列表,重命名任意资产列表)。没有模型源时菜单照样打开,两个带播种的工具拿到空输入。A menu of four source tools plus the Batch Renamer, in merge-pipeline order: Merge Meshes, Merge Mat Slots (both seeded from this panel's model source), Merge Materials and Standardize LOD (both open empty), then Batch Renamer (an empty list that renames any asset list). The menu opens even with no model source; the two seeded tools simply arrive with empty input. |
配方与烘焙模板Bake Recipe and Bake Templates
详情视图分四个分类:0.RenderProfile(单位配置清单 AgentConfigDataAssets、资产名与生成路径)、1.RenderBands(档位表)、2.RenderSources(模型源 ATT、sprite 图集、actor 类)与 3.GeneratedAssets(烘焙产物)。分类名里的 RenderProfile 只是分组标签,不对应任何 Profile 数据资产。
The details view has four categories: 0.RenderProfile (the unit-config list AgentConfigDataAssets, the asset name and the generate path), 1.RenderBands (the band table), 2.RenderSources (the model-source ATT, the sprite atlas and the actor class) and 3.GeneratedAssets (the bake outputs). The RenderProfile in that category name is only a grouping label — it does not correspond to any profile data asset.
面板使用的两个烘焙模板不来自配置资产,而来自 编辑器偏好 → 插件 → MassBattle → Bake Templates 里的 Niagara System Template 与 Renderer Template。面板构造时把它们播进面板状态;设置页没有保存过值时,它的构造函数已按插件自带默认值预置——先读插件内的 Config/DefaultMassBattleTemplates.ini,没有再回落到内置的 /MassBattle/Core/Templates 资产。两者都解析不出时 Generate 直接拒绝,并在日志里点名尝试过的路径。sprite 母材质与槽位图集母材质也在同一设置页的 Sprite 与 Slot Atlas 分类里;sprite 那项只在图集未自带母材质时作为回落。
The two bake templates the panel bakes with do not come from any config asset; they come from Editor Preferences → Plugins → MassBattle → Bake Templates — the Niagara System Template and the Renderer Template. The panel seeds them onto its state at construction; when nothing has been saved in the settings page, its constructor has already seeded the plugin's shipped defaults — first the plugin's Config/DefaultMassBattleTemplates.ini, else the built-in /MassBattle/Core/Templates assets. If neither resolves, Generate refuses outright and names the paths it tried in the log. The sprite master material and the slot-atlas master material live in the same settings page under the Sprite and Slot Atlas categories; the sprite one is only the fallback used when an atlas carries no master of its own.
面板跨会话记住的是它自己的配置,载体是 0.RenderProfile 清单里的单位配置(AgentConfig)。清单可有一到多条,第一条非空条目是主配置。Generate 成功——产物齐备且已落盘——之后,烘焙配方写进清单里的每一份配置并立即存盘;配方承载资产名、搜索路径、生成路径、工具模式、档位表、ATT 网格源、sprite 图集源与 actor 类;动画与配置字段也一并写进每一份配置,共用同一套美术资产的几份配置因此不会被一次重烘拆成不同的描述。之后把配置填进这份清单,面板会读取主配置里存的配方并还原这套配置;工具模式仍按模型源重新推导。清单为空时,Generate 会按生成路径与资产名新建一份配置并把配方写进去。
What the panel remembers across sessions is its own setup, carried by the unit configs (AgentConfig assets) in the 0.RenderProfile list. The list may hold one or more entries, and the first non-null entry is the primary. After a successful Generate — artifacts complete and written to disk — the bake recipe is written into every listed config and each package is saved immediately; the recipe carries the asset name, search path, generate path, tool mode, band table, ATT mesh source, sprite atlas source and actor class; the animation and config fields are written into every config as well, so several configs sharing one set of art assets cannot be split into different descriptions by one re-bake. Assigning a config back into the list loads the recipe stored in the primary config and restores that setup; the tool mode is still re-derived from the model source. With an empty list, Generate creates a config at the generate path/asset name and records the recipe into it.
配方只记 Creator 的配置,不记网格烘焙输入:光照贴图 UV 通道、VAT UV 通道、采样率与骨骼影响数住在源 ATT 上,sprite 帧率住在源图集上;烘焙直接读源资产,配方既不保存也不还原这些值。配方里的 AssemblyTemplate 字段只是旧数据的迁移快照,权威始终在 ATT 上。界面上只记住一项:Show Substeps 的展开状态,按工程存进编辑器配置;没有别的界面状态会被保存或回填。
The recipe records the creator's setup only — not the mesh bake inputs. The lightmap UV channel, the VAT UV channel, the sample rate and the bone-influence width live on the source ATT, and the sprite FPS lives on the source atlas; the bake reads those assets directly, and the recipe neither stores nor restores them. Its AssemblyTemplate field is only a migration snapshot of older data — the ATT remains the authority. Of the UI itself, only one thing is remembered: whether Show Substeps was expanded, recorded per project in the editor config; no other UI state is saved or applied back.
子步骤卡片Sub-step Cards
子步骤卡是一组逐步骤按钮,默认折叠;勾选 Show Substeps 后在 Standard 下展开(sprite 档也是 Standard 内的逐档模式,没有独立的 sprite 页)。卡片内的行按档位表用到的渲染族显隐:网格族只显示网格步骤,sprite 族只显示图集与材质步骤,共用步骤两种都显示。按钮各自执行对应的单步;Bake Textures 会打开与 Generate 相同的进度窗。Advanced 没有可展开的内容——复合烘焙就是一次 Generate——因此该模式下整张卡片始终折叠,Show Substeps 标签与复选框也一起隐藏。
The sub-step card is a group of per-step buttons, collapsed by default; it expands in Standard once Show Substeps is checked (a sprite band is a per-band mode inside Standard — there is no separate sprite page). Rows follow the render families the band table uses: mesh-family rows show only mesh steps, sprite-family rows only the atlas and material steps, and shared steps show in both. Each button executes its single step; Bake Textures opens the same progress window Generate uses. Advanced has nothing to expand — the composite bake is one Generate — so the whole card stays collapsed there and the Show Substeps label and checkbox hide with it.
Standard 页Standard Page
| 控件Control | 作用Effect |
|---|---|
| Create Static Mesh | 先把源网格的材质槽改成 ATT 里的名字,再把骨骼网格转换为逐 LOD 的静态网格并创建材质实例(网格族)。Renames the source mesh's material slots to the ATT list, then converts the skeletal mesh into a static mesh with per-LOD sections and creates material instances (mesh family). |
| Create NS + Renderer | 复制 NS 模板与渲染器蓝图并接好默认值(网格 / sprite 四边形、Niagara 系统)。Duplicates the NS template and renderer Blueprint and wires their defaults (mesh / sprite quad, Niagara system). |
| Create Agent Config | 把预填好的 ATT 绑为 AnimToTex 源,并创建或更新 AgentConfig 数据资产(动画桶、档位表、配置开关);已指定的配置原位更新。Binds the prepared ATT as the AnimToTex source and creates or updates the AgentConfig data asset (anim buckets, band table, config flags); an already assigned config is updated in place. |
| Create VAT Textures | 逐管线 × 几何级创建 VAT 占位纹理;烘焙写入这些纹理,缺失时直接按 Bake Textures 会自动补建(网格族)。Creates placeholder VAT textures per pipeline and geometry level; the bake fills them, and Bake Textures creates them automatically when missing (mesh family). |
| Bake Textures | 逐管线执行 AnimToTexture 烘焙并接线材质槽,打开与 Generate 相同的进度窗(网格族)。Runs the AnimToTexture bake per pipeline and wires the material slots, opening the same progress window Generate uses (mesh family). |
| Compose Atlas | 把图集资产的逐帧轨道合成一张网格纹理,回写进资产并刷新它的桶区间(sprite 族)。Composites the atlas asset's frame tracks into one grid texture, writes it back into the asset and refreshes its bucket ranges (sprite family). |
| Create Material | 以 sprite 母材质创建材质实例并写入图集、列数与行数参数(sprite 族,需先 Compose Atlas)。Creates a material instance from the sprite master material and writes the atlas, column and row parameters (sprite family; needs Compose Atlas first). |
| Build Renderers | 把烘焙出的网格 / 材质(sprite 则是四边形 / 材质)填进 NS 渲染器槽位并装好槽位桥接;跳过它会导致资产齐备但什么都画不出来。Fills the NS renderer slots with the baked mesh/material (or quad/material for sprites) and installs the slot bridge; skipping it leaves every asset built but nothing drawn. |
网格的 Lightmap UV 通道、VAT UV 通道、采样率与骨骼影响数在 Mesh Prep 里写进源 ATT,sprite 帧率在源图集上;子步骤卡不再提供这些输入。
The lightmap UV channel, VAT UV channel, sample rate and bone-influence width are written into the source ATT in Mesh Prep, and the sprite FPS lives on the source atlas; the sub-step card no longer offers these inputs.
Advanced 页Advanced Page
这一页没有按钮,只有一段操作提示与一行模板实时状态:提示在 Mesh Prep 里把模型源填成骨骼网格或 assembly 模板(二选一),并先在 Assembly 窗口里录制至少一个组合;状态行显示模板名与部件、版本、组合、烘焙组数量,模型源里没有模板或类型不对时会明确说明。所有信息都来自模板本身,改完模板无需重开窗口。
This page has no buttons — only a short hint and one live template status line. The hint asks for the model source in Mesh Prep to be either a skeletal mesh or an assembly template (one of the two) and for at least one combination captured in the Assembly window; the status line shows the template name plus its part, version, combination and bake-group counts, and states plainly when the model source carries no template or the wrong asset type. Everything is read from the template itself, so edited templates need no window reopen.
对外接口Public Surface
面板自身的公开接口很少:构造、每帧回调,以及给 Sprite Prep / Mesh Prep / Assembly 窗口用的实例与状态访问器。
The panel's own public surface is small: construction, a per-frame callback, and the instance/state accessors used by the Sprite Prep, Mesh Prep and Assembly windows.
| 成员Member | 类型Type | 说明Description |
|---|---|---|
Construct | void | 构建整个窗口:创建并持根面板状态对象,播种两个烘焙模板、把档位表重置为一条 BoneCS 档,读取子步骤展开状态,创建详情视图并绑定状态(同时挂上属性变更与撤销/重做回调),装配 Generate/Clear 行、四个工具入口、Show Substeps、子步骤卡、详情视图与日志区,最后同步一次模式页面。Builds the whole window: creates and roots the panel state object, seeds the two bake templates, resets the band table to one BoneCS band, loads whether the sub-step area was expanded, creates the details view and binds the state (hooking property-change and undo/redo callbacks), assembles the Generate/Clear row, the four tool entries, Show Substeps, the sub-step card, the details view and the log dock, and finally syncs the mode page once. |
Tick | virtual void | 每编辑器帧执行:更新日志区的聚焦描边;重算源族标志,掩码变化时强制刷新详情视图并同步模式页面;Tool Mode 变化时同步 UI;动画桶签名变化时重跑校验并刷新详情视图;有新日志行时刷新日志区。Runs every editor frame: refreshes the log dock's focus rim; recomputes the render-family flags and, when that mask changes, force-refreshes the details view and syncs the mode page; syncs the UI when the tool mode changes; re-validates the anim buckets and refreshes the details view when their signature changes; refreshes the log dock when new lines arrive. |
GetActiveInstance | static TSharedPtr<SMassBattleAgentCreatorPanel> | 最后构造的活面板;Sprite Prep / Mesh Prep / Assembly 标签生成时用它绑定当前会话。The most recently constructed live panel; the Sprite Prep, Mesh Prep and Assembly tabs use it to bind to the current session when spawned. |
GetState | UMassBattleAgentCreatorState* | 面板持有的状态对象——Sprite Prep 回填图集、列/行与帧区间时写入这里。The state object held by the panel — Sprite Prep writes the atlas, columns/rows and frame ranges into it. |
RefreshAfterStateChange | void | 外部写入状态后刷新详情视图(Sprite Prep 回填后调用)。Refreshes the details view after external state writes (called by Sprite Prep after applying). |
管线角色Pipeline Role
面板由编辑器模块注册为可停靠工具标签(Window → Tools 分组),工具栏按钮打开的是同一个标签。面板持有本次会话的全部输入与结果;Generate 交给烘焙编排层执行并驱动进度窗口;Sprite Prep、Mesh Prep 与 Assembly 打开各自的可停靠工具标签,目标窗口通过 GetActiveInstance / GetState 绑定当前会话。因此只要面板还开着,这些工具的回填就能直接落到当前会话;面板关闭后,Sprite Prep 会在回填时提示重新打开 Creator。
The panel is registered by the editor module as a dockable tool tab (Window → Tools group), and the toolbar button opens that same tab. The panel owns every input and result for the session; Generate hands off to the bake orchestration layer and drives the progress window; Sprite Prep, Mesh Prep and Assembly open their own dockable tool tabs, and the target window binds to the current session through GetActiveInstance / GetState. As long as the panel stays open, those tools can apply results straight into the current session; with the panel closed, Sprite Prep reports that the creator must be reopened before applying.
补充说明Notes
① 同一时间只允许一个烘焙进度窗。烘焙进行中再次点 Generate 不会排队,也不会叠窗,只在日志里记一行「Generate 已在进行中」。② Clear 只清空面板输入与生成结果引用(单位配置清单回到一条空槽),不删除磁盘上已生成的资产;当前推导出的 Tool Mode 与面板上的烘焙模板保留。③ Batch Renamer 住在 Tool Box 菜单里,以空列表打开——把要改名的资产加进去,同一条规则作用于整张列表。④ 把单位配置填进 0.RenderProfile 清单会载入主配置里存的配方(资产名、路径、档位表、模型源与 actor 类);换模型源 ATT 会当场重新推导 Tool Mode。⑤ 日志数组最多保留 200 行,面板只显示最后 20 行。
① Only one bake progress window may exist at a time. Pressing Generate during a bake neither queues nor stacks another window — it writes a "Generate already running" line to the log. ② Clear wipes the panel's inputs and generated-result references only (the unit-config list returns to a single empty slot); it never deletes generated assets on disk, and the derived tool mode plus the panel's bake templates survive. ③ Batch Renamer lives in the Tool Box menu and opens with an empty list — add the assets to rename and one rule applies to the whole list. ④ Assigning a unit config into the 0.RenderProfile list loads the recipe stored in the primary config (asset name, paths, band table, model source and actor class); changing the model-source ATT re-derives the tool mode on the spot. ⑤ The log keeps at most 200 lines and the panel shows the last 20.