USD Editor
Description and Goals
This skill guides safe, minimal edits to USD ASCII (.usda) files and the proper use of official USD command-line tools. It focuses on preserving stage structure, using correct specifiers and property types, and avoiding composition mistakes while making targeted changes.
Goals
- - Make precise edits without disrupting existing USD composition
- Preserve file formatting and authoring style
- Use correct prim specifiers, property types, and relationships
- Avoid common USD pitfalls (wrong paths, missing xformOpOrder, broken connections)
- Guide safe manipulation and inspection of USD assets using the command-line tools
What This Skill Should Do
When asked to modify a .usda file, this skill should:
- 1. Inspect the stage structure - Identify root prims, scopes, and relevant paths.
- Choose the correct specifier - Use
over for edits to existing prims, def for new prims. - Edit only what is necessary - Preserve unrelated content and formatting.
- Respect composition - Avoid changing subLayers, references, or variants unless asked.
- Validate connections and paths - Ensure
SdfPath targets are valid and type-compatible.
If the change is material- or shader-related for RealityKit, prefer the shadergraph-editor skill for node-specific guidance.
Quick Start Workflow
- 1. Locate the prim path you need to edit (search by prim name or
SdfPath). - Determine whether you should
over an existing prim or def a new one. - Apply the smallest possible change (attribute value, relationship target, or child prim).
- If adding transforms, update
xformOpOrder to match your new ops. - Re-check any paths or connections you touched.
Information About the Skill
Core Concepts
Stage and Layer
A USD stage is composed of one or more layers. A .usda file is a single ASCII layer that can sublayer or reference others.
Prim and Specifier
A prim is a scene graph node. Specifiers control behavior:
def creates,
over modifies,
class defines a reusable template.
Properties
Attributes store typed data; relationships (
rel) point to other prims.
Composition Arc
Mechanisms like sublayers, references, and payloads that bring other USD data into the stage.
SdfPath
A path to a prim or property, written like
</Root/Child> or
</Root/Mat.outputs:surface>.
List Editing
USD list ops (
prepend,
append,
delete,
add) modify lists without replacing them.
Variants
Variant sets provide alternative content branches for a prim.
Time Samples
Animated or time-varying data stored in
timeSamples dictionaries.
Reference Tables
When adding or editing prims, attributes, or relationships. |
|
composition-variants | When touching sublayers, references, payloads, or variant sets. |
|
transforms-units | When editing transforms, xformOps, or stage units/up axis metadata. |
|
time-samples | When modifying animated/time-sampled properties. |
|
command-line-tools | When you need a quick reference for common USD command-line tools. |
|
usdcat | When converting, flattening, or inspecting USD files. |
|
usdchecker | When validating USD or USDZ assets, including RealityKit-focused checks. |
|
usdrecord | When rendering images from USD files. |
|
usdtree | When inspecting the prim hierarchy of a USD file. |
|
usdzip | When creating or inspecting USDZ packages. |
|
usdedit | When you need the official text-editing workflow for a USD-readable file. |
Implementation Patterns
Override an Existing Prim
CODEBLOCK0
Add a Simple Xform with Translate
CODEBLOCK1
Bind a Material Relationship
CODEBLOCK2
Pitfalls and Checks
- - Don't replace a prim with
def when you only need an over. - Keep
xformOpOrder consistent with the ops you add or remove. - Verify
SdfPath targets exist and match the expected property type. - Avoid editing composition arcs unless explicitly requested.
- Preserve existing formatting and comments to minimize diff noise.
USD编辑器
描述与目标
本技能指导对USD ASCII (.usda)文件进行安全、最小化的编辑,以及正确使用官方USD命令行工具。它专注于在实施针对性修改时,保持场景结构、使用正确的说明符和属性类型,并避免合成错误。
目标
- - 进行精确编辑,不破坏现有的USD合成结构
- 保留文件格式和创作风格
- 使用正确的prim说明符、属性类型和关系
- 避免常见的USD陷阱(错误路径、缺失xformOpOrder、断裂的连接)
- 指导使用命令行工具安全操作和检查USD资产
本技能应执行的操作
当被要求修改.usda文件时,本技能应:
- 1. 检查场景结构 - 识别根prim、作用域和相关路径。
- 选择正确的说明符 - 对现有prim的编辑使用over,对新prim使用def。
- 仅编辑必要内容 - 保留不相关的内容和格式。
- 尊重合成结构 - 除非被要求,否则避免更改子层、引用或变体。
- 验证连接和路径 - 确保SdfPath目标有效且类型兼容。
如果修改涉及RealityKit的材质或着色器,建议使用shadergraph-editor技能获取节点特定的指导。
快速入门工作流程
- 1. 定位需要编辑的prim路径(按prim名称或SdfPath搜索)。
- 确定应对现有prim使用over还是对新prim使用def。
- 应用最小可能的更改(属性值、关系目标或子prim)。
- 如果添加变换,更新xformOpOrder以匹配新的操作。
- 重新检查所有接触过的路径或连接。
关于本技能的信息
核心概念
场景与层
USD场景由一个或多个层组成。.usda文件是一个单独的ASCII层,可以子层化或引用其他层。
Prim与说明符
Prim是场景图节点。说明符控制行为:def创建,over修改,class定义可重用模板。
属性
属性存储类型化数据;关系(rel)指向其他prim。
合成弧
子层、引用和负载等机制,将其他USD数据引入场景。
SdfPath
指向prim或属性的路径,写法如或。
列表编辑
USD列表操作(prepend、append、delete、add)在不替换整个列表的情况下修改列表。
变体
变体集为prim提供替代内容分支。
时间样本
存储在timeSamples字典中的动画或随时间变化的数据。
参考表
添加或编辑prim、属性或关系时。 |
|
composition-variants | 涉及子层、引用、负载或变体集时。 |
|
transforms-units | 编辑变换、xformOps或场景单位/上轴元数据时。 |
|
time-samples | 修改动画/时间采样属性时。 |
|
command-line-tools | 需要常用USD命令行工具的快速参考时。 |
|
usdcat | 转换、展平或检查USD文件时。 |
|
usdchecker | 验证USD或USDZ资产时,包括针对RealityKit的检查。 |
|
usdrecord | 从USD文件渲染图像时。 |
|
usdtree | 检查USD文件的prim层级结构时。 |
|
usdzip | 创建或检查USDZ包时。 |
|
usdedit | 需要对USD可读文件使用官方文本编辑工作流程时。 |
实现模式
覆盖现有Prim
usda
over Mesh
{
token visibility = invisible
}
添加带平移的简单Xform
usda
def Xform Pivot
{
double3 xformOp:translate = (0.0, 0.1, 0.0)
uniform token[] xformOpOrder = [xformOp:translate]
}
绑定材质关系
usda
rel material:binding =
陷阱与检查
- - 当只需要over时,不要用def替换prim。
- 保持xformOpOrder与添加或删除的操作一致。
- 验证SdfPath目标存在且与预期的属性类型匹配。
- 除非明确要求,否则避免编辑合成弧。
- 保留现有格式和注释,以最小化差异噪声。