inspect-glb
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseInspect GLBs
检查GLB资产
Resolve relative to this skill directory and run it before choosing entity
transforms or animation names:
scripts/inspect.mjssh
node <skill-directory>/scripts/inspect.mjs public/models/Character.glb
node <skill-directory>/scripts/inspect.mjs public/models/{Ship,Enemy}_*.glbThe output provides:
- for calculating a uniform scale;
dims - for the model wrapper's local Y position;
groundOffset - for the pivot offset from the geometry centre: a non-zero X or Z means the root's position is not where the model appears, and Y feeds grounding;
center - and
boundsSourcefor proving how and at which pose the bounds were measured;boundsPose - for animated morphs, skins, and incomplete decoding;
requiresRuntimeCheck - ,
nodePaths,clips, andjointsfor animation setup and rig comparison;animationTargets - ,
morphed, andmorphAnimatedfor pose-sensitive assets.skinned
在选择实体变换或动画名称之前,找到相对于此技能目录的并运行它:
scripts/inspect.mjssh
node <skill-directory>/scripts/inspect.mjs public/models/Character.glb
node <skill-directory>/scripts/inspect.mjs public/models/{Ship,Enemy}_*.glb输出内容包括:
- :用于计算统一缩放比例;
dims - :模型包装器的本地Y轴位置;
groundOffset - :从几何体中心到枢轴的偏移量:X或Z值非零表示根节点位置与模型视觉位置不符,Y值用于接地设置;
center - 和
boundsSource:说明边界的测量方式及测量时的姿态;boundsPose - :针对带动画的变形目标、蒙皮及解码不完整的情况;
requiresRuntimeCheck - 、
nodePaths、clips和joints:用于动画设置和骨骼绑定对比;animationTargets - 、
morphed和morphAnimated:用于标记对姿态敏感的资产。skinned
Bounds precision
边界精度
aabbdimscentergroundOffset- means every primitive was decoded and the bounds are exact for
vertices.boundsPose - means at least one primitive could not be decoded, so its bounds fall back to the node-transformed local box. That over-estimates a mesh which does not fill its own box on a node rotated off-axis, by up to 41 percent for a 45-degree yaw.
accessor-minmaxgives the cause.boundsNotes - means some visible default-pose geometry could not be measured; do not calibrate from the reported bounds.
incomplete - means no usable bounds could be recovered.
null
staticdefault-morphbindrequiresRuntimeCheckboundsSourceverticesCarry , , , , and into the asset tuning record.
seats the base in Y; and are the horizontal pivot offset that
must compensate, so a placed root sits where the mesh appears, not where the
authored pivot happens to be. Running the inspector alone is not placement evidence. Its global AABB supports plane grounding and
broad-phase spacing, but cannot locate a non-planar support surface or attachment point. Use an
authored mount point or confirm the support in the running application before placing another model.
boundsSourceaabbdimscentergroundOffsetgroundOffsetcenter.xcenter.zcalibrate-modelaabbdimscentergroundOffset- 表示所有图元已解码,且
vertices对应的边界是精确的;boundsPose - 表示至少有一个图元无法解码,因此其边界退化为经节点变换后的本地包围盒。对于节点绕轴旋转(如偏航45度)且未填满自身包围盒的网格,该值会高估边界,最多偏差41%。
accessor-minmax会给出具体原因;boundsNotes - 表示部分可见的默认姿态几何体无法测量,请不要根据报告的边界进行校准;
incomplete - 表示无法恢复可用的边界。
null
staticdefault-morphbindrequiresRuntimeCheckboundsSourcevertices将、、、和记录到资产调优档案中。用于设置Y轴方向的底座位置;和是水平枢轴偏移量,必须对此进行补偿,才能使放置的根节点与网格视觉位置一致,而非创作时的枢轴位置。仅运行检查器不能作为放置依据。其全局AABB支持平面接地和宽阶段间距,但无法定位非平面支撑面或附着点。在放置其他模型之前,请使用创作的挂载点或在运行的应用中确认支撑面。
boundsSourceaabbdimscentergroundOffsetgroundOffsetcenter.xcenter.zcalibrate-modelExtract from compressed containers
从压缩容器中提取
The bundled inspector decodes plain, interleaved, quantized, and sparse vertex buffers. For Draco,
Meshopt, or external buffers, names the cause. Parse and rewrite a scratch copy with
glTF Transform's lossless command, then inspect that copy rather than shipping it:
boundsNotescopysh
npx --yes @gltf-transform/cli@4.4.2 copy in.glb scratch.glb
node <skill-directory>/scripts/inspect.mjs scratch.glbcopyoptimizeThe Engine has no support, so a meshopt asset will not render as shipped.
If it must appear in the scene, transcode it to an uncompressed GLB the same way — subject to the
project's rules on modifying assets — so it both loads and measures.
EXT_meshopt_compressionThese geometry-fit bounds can intentionally disagree with the Engine's runtime culling AABB.
transforms the declared local box and expands it conservatively for morph
targets, so it can be larger than visible geometry. Place static models from exact inspected bounds;
confirm morph and skin extremes at runtime. A skinned mesh node's own transform is ignored here
because glTF requires it; the Engine resolves to the same result.
MeshInstance.aabbShortlist files first; do not dump an entire asset pack into context. Bounds cannot prove facing.
glTF convention is +Z forward while PlayCanvas entities face -Z, and asset packs vary. Confirm each
directional model once in the running app as the skill describes, and store its
yaw correction with its scale and grounding.
apply-conventionsUse only when vertex or texture statistics justify extra tooling.
npx @gltf-transform/cli inspect附带的检查器可解码普通、交错、量化和稀疏的顶点缓冲区。对于Draco、Meshopt或外部缓冲区,会说明原因。使用glTF Transform的无损命令解析并重写一个临时副本,然后检查该副本(而非直接使用原文件):
boundsNotescopysh
npx --yes @gltf-transform/cli@4.4.2 copy in.glb scratch.glb
node <skill-directory>/scripts/inspect.mjs scratch.glbcopyoptimizePlayCanvas引擎不支持,因此Meshopt压缩的资产无法直接渲染。如果必须在场景中使用,需通过相同方式将其转码为未压缩的GLB(需符合项目修改资产的规则),使其既能加载又能被测量。
EXT_meshopt_compression这些贴合几何体的边界可能会与引擎运行时的剔除AABB有意不同。会变换声明的本地包围盒,并为变形目标保守地扩大范围,因此可能大于可见几何体。静态模型应根据检查得到的精确边界进行放置;变形和蒙皮的极限范围需在运行时确认。此处忽略蒙皮网格节点自身的变换,因为glTF要求如此,引擎也会得到相同结果。
MeshInstance.aabb先筛选文件;不要将整个资产包全部导入。边界无法证明朝向。glTF的惯例是+Z向前,而PlayCanvas实体是-Z向前,不同资产包可能存在差异。按照技能的描述,在运行的应用中确认每个定向模型一次,并将其偏航校正值与缩放和接地设置一起存储。
apply-conventions仅当需要获取顶点或纹理统计信息时,才使用工具。
npx @gltf-transform/cli inspect