AGENT SKILL

unreal-modeling-attributes

GeometryScript 网格属性操作。当用户要求设置/查询顶点色、Polygroup、材质 ID 时使用。

License 许可
MIT
最近更新
2026-11-12
Stars
★ 3
Forks
1

01 前言 Front Matter

name
unreal-modeling-attributes
description
GeometryScript 网格属性操作。当用户要求设置/查询顶点色、Polygroup、材质 ID 时使用。

03 SKILL.md 正文

建模 — 属性

前置条件:先阅读 unreal-modeling。

库

库 CDO
顶点色 /Script/GeometryScriptingCore.Default__GeometryScriptLibrary_MeshVertexColorFunctions
Polygroup /Script/GeometryScriptingCore.Default__GeometryScriptLibrary_MeshPolygroupFunctions
材质 /Script/GeometryScriptingCore.Default__GeometryScriptLibrary_MeshMaterialFunctions

TargetMesh 为 UDynamicMesh* 路径字符串。Debug 省略。需要 FGeometryScriptMeshSelection 的函数,用 MeshOperationLibrary 桥接。需要 FGeometryScriptColorList 的函数,用 MakeColorList/GetColorListArray 桥接。

顶点色函数

函数 关键参数 说明
SetMeshConstantVertexColor TargetMesh, Color(FLinearColor), Flags, bClearExisting 设置全 mesh 统一顶点色
SetMeshSelectionVertexColor TargetMesh, Selection, Color, Flags, bCreateColorSeam 设置选中区域顶点色
SetMeshPerVertexColors TargetMesh, VertexColorList 批量设置每顶点颜色(列表大小 = MaxVertexID)
GetMeshPerVertexColors TargetMesh out:VertexColorList、bIsValidColorSet、bHasVertexIDGaps、bHasSplitColors
SetMeshTriangleVertexColor TargetMesh, TriangleID, Color, Flags, bDeferChangeNotifications 设置单个三角形顶点色
GetMeshTriangleVertexColors TargetMesh, TriangleID 返回三角形三个角的顶点色
BlurMeshVertexColors TargetMesh, Selection, Options 模糊/平滑顶点色
TransferVertexColorFromMesh TargetMesh, SourceMesh, Options 从另一个 mesh 传输顶点色

FGeometryScriptColorFlags

字段 类型 默认值 说明
bRed bool true 影响 R 通道
bGreen bool true 影响 G 通道
bBlue bool true 影响 B 通道
bAlpha bool true 影响 A 通道

Polygroup 函数

函数 关键参数 说明
SetNumExtendedPolygroupLayers TargetMesh, NumLayers 设置扩展 Polygroup 层数
ClearPolygroups TargetMesh, GroupLayer 清除 Polygroup(全部设为 0)
SetPolygroupForMeshSelection TargetMesh, GroupLayer, Selection, SetPolygroupIDOut 设置选中区域的 Polygroup ID
SetGroupIDForMeshSelection TargetMesh, GroupLayer, Selection, NewGroupID 设置选中区域为指定 Group ID
GetTrianglePolygroupID TargetMesh, GroupLayer, TriangleID 获取三角形的 Polygroup ID
GetAllPolygroupIDs TargetMesh, GroupLayer 获取所有 Polygroup ID 列表
GetPolygroupIDsInMeshSelection TargetMesh, GroupLayer, Selection 获取选中区域内的 Polygroup ID 列表
ComputePolygroupsFromAngleThreshold TargetMesh, GroupLayer, CreaseAngle, MinGroupSize 按角度阈值自动计算 Polygroup
ComputePolygroupsFromPolygonDetection TargetMesh, GroupLayer, bRespectUVSeams, bRespectHardNormals, QuadAdjacencyWeight, MinQuadCount 按多边形检测计算 Polygroup
CopyPolygroupsLayer TargetMesh, FromGroupLayer, ToGroupLayer 复制 Polygroup 层
ConvertComponentsToPolygroups TargetMesh, GroupLayer 将连通分量转为 Polygroup
ConvertUVIslandsToPolygroups TargetMesh, GroupLayer, UVLayer 将 UV 岛转为 Polygroup
DeleteTrianglesInPolygroup TargetMesh, GroupLayer, PolygroupID 删除指定 Polygroup 的三角形

FGeometryScriptGroupLayer

字段 类型 默认值 说明
bDefaultLayer bool true 使用默认层
ExtendedLayerIndex int 0 扩展层索引(当 bDefaultLayer=false 时)

材质函数

函数 关键参数 说明
EnableMaterialIDs TargetMesh 启用材质 ID 属性
SetMaterialIDOnTriangles TargetMesh, TriangleIDList, MaterialID 设置指定三角形的材质 ID
SetMaterialIDForMeshSelection TargetMesh, Selection, MaterialID 设置选中区域的材质 ID
SetAllMeshMaterialIDs TargetMesh, TriangleMaterialIDList 批量设置所有三角形的材质 ID
GetTriangleMaterialID TargetMesh, TriangleID 获取三角形的材质 ID
GetAllTriangleMaterialIDs TargetMesh 获取所有三角形的材质 ID 列表
GetMaterialIDsOfMesh TargetMesh 获取 mesh 中使用的所有材质 ID 集合
RemapMaterialIDs TargetMesh, FromMaterialID, ToMaterialID 重映射材质 ID
SetPolygroupMaterialID TargetMesh, GroupLayer, PolygroupID, MaterialID 按 Polygroup 设置材质 ID
DeleteTrianglesByMaterialID TargetMesh, MaterialID 删除指定材质 ID 的三角形
GetMaxMaterialID TargetMesh 获取最大材质 ID
CompactMaterialIDs TargetMesh 压缩材质 ID(移除未使用的间隙)

JSON 示例

设置全 mesh 统一顶点色(红色):

{"object":"/Script/GeometryScriptingCore.Default__GeometryScriptLibrary_MeshVertexColorFunctions","function":"SetMeshConstantVertexColor","params":{"TargetMesh":"/Engine/Transient.DynamicMesh_0","Color":{"R":1,"G":0,"B":0,"A":1},"Flags":{"bRed":true,"bGreen":true,"bBlue":true,"bAlpha":true},"bClearExisting":true}}

按角度阈值计算 Polygroup(30° 折痕):

{"object":"/Script/GeometryScriptingCore.Default__GeometryScriptLibrary_MeshPolygroupFunctions","function":"ComputePolygroupsFromAngleThreshold","params":{"TargetMesh":"/Engine/Transient.DynamicMesh_0","GroupLayer":{"bDefaultLayer":true,"ExtendedLayerIndex":0},"CreaseAngle":30,"MinGroupSize":2}}

设置材质 ID(将选中区域设为材质 1):

先用 MeshOperationLibrary.SelectTrianglesByIDs 创建选择,然后:

{"object":"/Script/GeometryScriptingCore.Default__GeometryScriptLibrary_MeshMaterialFunctions","function":"SetMaterialIDForMeshSelection","params":{"TargetMesh":"/Engine/Transient.DynamicMesh_0","Selection":"<从桥接函数获取>","MaterialID":1}}

发现

对上述任意 CDO 路径调用 DescribeObject 可查看完整函数列表和参数签名。

04 同仓库更多 Skills

welflau
welflau/ai-dev-system

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

测试与质量前端开发
★ 3
welflau
welflau/ai-dev-system

internal-comms

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

邮件与沟通
★ 3
welflau
welflau/ai-dev-system

web-artifacts-builder

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

前端开发
★ 3
welflau
welflau/ai-dev-system

frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

设计师前端开发视觉设计
★ 3
welflau
welflau/ai-dev-system

algorithmic-art

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.

视觉设计
★ 3
welflau
welflau/ai-dev-system

theme-factory

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

视觉设计
★ 3