three-usd-robot 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +48 -7
  2. package/dist/MeshBinding-DQKXuYNr.d.ts +288 -0
  3. package/dist/{ThreeUsdRobot-BxnCluuK.d.ts → ThreeUsdRobot-C3N6-XBJ.d.ts} +1 -1
  4. package/dist/{ThreeUsdRobotLoader-C-E9uwEe.d.ts → ThreeUsdRobotLoader-D2fEo9_p.d.ts} +11 -3
  5. package/dist/{buildKinematicTree-BCySuZZn.d.ts → buildKinematicTree-iFqaw0Jl.d.ts} +1 -1
  6. package/dist/bytes-CxGRGry_.d.ts +14 -0
  7. package/dist/{chunk-AXPMXEQC.js → chunk-6W4LQVEQ.js} +13 -715
  8. package/dist/chunk-6W4LQVEQ.js.map +1 -0
  9. package/dist/{chunk-5SVRTKS4.js → chunk-7GGSIA6M.js} +18 -11
  10. package/dist/chunk-7GGSIA6M.js.map +1 -0
  11. package/dist/{chunk-BCRRXGNB.js → chunk-CK5MTMYR.js} +6 -4
  12. package/dist/chunk-CK5MTMYR.js.map +1 -0
  13. package/dist/chunk-JGIVJXBU.js +54 -0
  14. package/dist/chunk-JGIVJXBU.js.map +1 -0
  15. package/dist/{chunk-ENWFOYHU.js → chunk-KYBHWDX5.js} +3 -3
  16. package/dist/{chunk-ENWFOYHU.js.map → chunk-KYBHWDX5.js.map} +1 -1
  17. package/dist/chunk-PPPRB6KE.js +963 -0
  18. package/dist/chunk-PPPRB6KE.js.map +1 -0
  19. package/dist/{chunk-LDO5FKQS.js → chunk-YGJ23CG3.js} +4 -53
  20. package/dist/chunk-YGJ23CG3.js.map +1 -0
  21. package/dist/core.d.ts +6 -63
  22. package/dist/core.js +5 -3
  23. package/dist/extras.d.ts +2 -2
  24. package/dist/helpers.d.ts +2 -2
  25. package/dist/helpers.js +3 -2
  26. package/dist/helpers.js.map +1 -1
  27. package/dist/index.d.ts +11 -262
  28. package/dist/index.js +10 -8
  29. package/dist/index.js.map +1 -1
  30. package/dist/nodes.d.ts +49 -0
  31. package/dist/nodes.js +439 -0
  32. package/dist/nodes.js.map +1 -0
  33. package/dist/parseMdl-vfzBGoMr.d.ts +87 -0
  34. package/dist/react.d.ts +6 -4
  35. package/dist/react.js +6 -4
  36. package/dist/react.js.map +1 -1
  37. package/package.json +6 -2
  38. package/dist/bytes-MOJ2oN-u.d.ts +0 -42
  39. package/dist/chunk-5SVRTKS4.js.map +0 -1
  40. package/dist/chunk-AXPMXEQC.js.map +0 -1
  41. package/dist/chunk-BCRRXGNB.js.map +0 -1
  42. package/dist/chunk-LDO5FKQS.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/usd/AssetResolver.ts","../src/usd/mdl/parseMdl.ts","../src/three/MaterialXBinding.ts","../src/three/MaterialBinding.ts"],"names":["result"],"mappings":";;;AAiBO,IAAM,uBAAN,MAAoD;AAAA,EACzD,OAAA,CAAQ,WAAmB,OAAA,EAAyB;AAClD,IAAA,IAAI;AACF,MAAA,OAAO,IAAI,GAAA,CAAI,SAAA,EAAW,OAAA,IAAW,MAAS,CAAA,CAAE,IAAA;AAAA,IAClD,CAAA,CAAA,MAAQ;AACN,MAAA,OAAO,SAAA,CAAU,SAAS,SAAS,CAAA;AAAA,IACrC;AAAA,EACF;AAAA,EAEA,MAAM,UAAU,GAAA,EAA8B;AAC5C,IAAA,MAAM,GAAA,GAAM,MAAM,KAAA,CAAM,GAAG,CAAA;AAC3B,IAAA,IAAI,CAAC,GAAA,CAAI,EAAA,EAAI,MAAM,IAAI,KAAA,CAAM,CAAA,EAAG,GAAA,CAAI,MAAM,CAAA,CAAA,EAAI,GAAA,CAAI,UAAU,CAAA,CAAE,CAAA;AAC9D,IAAA,OAAO,IAAI,IAAA,EAAK;AAAA,EAClB;AAAA,EAEA,MAAM,WAAW,GAAA,EAAkC;AACjD,IAAA,MAAM,GAAA,GAAM,MAAM,KAAA,CAAM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S,WAAA,EAAY,CAAE,IAAA,CAAK,CAAC,MAAM,CAAA,CAAE,WAAA,EAAY,KAAM,QAAQ,CAAA,IAAK,MAAA;AAC7E","file":"chunk-PPPRB6KE.js","sourcesContent":["/**\n * Resolves USD asset paths (from references / payloads / sublayers) to URLs and\n * fetches their text. Composition (`composition.ts`) is I/O-agnostic and goes\n * through an {@link AssetResolver}, so the same engine works in the browser, in\n * Node, or against an in-memory file map in tests.\n */\n\nexport interface AssetResolver {\n /** Resolve an authored asset path against the layer's base URL to an absolute key. */\n resolve(assetPath: string, baseUrl: string): string;\n /** Fetch the text of a resolved asset; rejects if it cannot be read. */\n fetchText(url: string): Promise<string>;\n /** Fetch the raw bytes of a resolved asset (for binary USDC / USDZ). Optional. */\n fetchBytes?(url: string): Promise<Uint8Array>;\n}\n\n/** URL-based resolver using the global `fetch` (browser / Node 18+). */\nexport class DefaultAssetResolver implements AssetResolver {\n resolve(assetPath: string, baseUrl: string): string {\n try {\n return new URL(assetPath, baseUrl || undefined).href;\n } catch {\n return joinPosix(baseUrl, assetPath);\n }\n }\n\n async fetchText(url: string): Promise<string> {\n const res = await fetch(url);\n if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);\n return res.text();\n }\n\n async fetchBytes(url: string): Promise<Uint8Array> {\n const res = await fetch(url);\n if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);\n return new Uint8Array(await res.arrayBuffer());\n }\n}\n\n/**\n * Resolver over an in-memory `{ path: contents }` map (text or bytes), with\n * posix-style joins. Useful for tests and bundled assets.\n */\nexport function createMemoryResolver(files: Record<string, string | Uint8Array>): AssetResolver {\n const decoder = new TextDecoder();\n const encoder = new TextEncoder();\n return {\n resolve(assetPath, baseUrl) {\n return joinPosix(baseUrl, assetPath);\n },\n fetchText(url) {\n const v = files[url];\n if (v === undefined) return Promise.reject(new Error(`asset not found: ${url}`));\n return Promise.resolve(typeof v === \"string\" ? v : decoder.decode(v));\n },\n fetchBytes(url) {\n const v = files[url];\n if (v === undefined) return Promise.reject(new Error(`asset not found: ${url}`));\n return Promise.resolve(typeof v === \"string\" ? encoder.encode(v) : v);\n },\n };\n}\n\n/** Resolve `rel` against `baseUrl` using posix semantics, normalizing `.`/`..`. */\nexport function joinPosix(baseUrl: string, rel: string): string {\n if (rel.startsWith(\"/\")) return normalizePosix(rel);\n const dir = baseUrl.slice(0, baseUrl.lastIndexOf(\"/\") + 1);\n return normalizePosix(dir + rel);\n}\n\nfunction normalizePosix(path: string): string {\n const isAbsolute = path.startsWith(\"/\");\n const out: string[] = [];\n for (const part of path.split(\"/\")) {\n if (part === \"\" || part === \".\") continue;\n if (part === \"..\") out.pop();\n else out.push(part);\n }\n return (isAbsolute ? \"/\" : \"\") + out.join(\"/\");\n}\n","/**\n * Minimal `.mdl` **declaration** parser (M20) — reads material signatures, not\n * the MDL language.\n *\n * USD stores only the *overridden* inputs of an MDL shader; every other\n * parameter value lives in the referenced `.mdl` module. Two declaration\n * shapes carry the values we can recover without executing MDL:\n *\n * - parameter defaults —\n * `export material OmniPBR(color diffuse_color_constant = color(0.2), …)`\n * - wrapper materials (the usual shape of per-asset `Materials/*.mdl`) —\n * `export material Steel(*) = OmniPBR::OmniPBR(diffuse_color_constant: color(…), …);`\n *\n * Only literal values are extracted: numbers, bools, strings, `color(…)` /\n * `floatN(…)` vectors, and `texture_2d(\"path\", ::tex::gamma_*)`. Defaults that\n * are expressions, function calls, or cross-module references are skipped, as\n * are comments and `[[ … ]]` annotation blocks. Executing MDL stays out of\n * scope — this is a fidelity aid, not an interpreter.\n */\n\n/** A literal value read from an MDL declaration. */\nexport type MdlValue = number | boolean | string | number[] | MdlTextureValue;\n\n/** A `texture_2d(\"path\", ::tex::gamma_*)` literal. */\nexport interface MdlTextureValue {\n /** Path as written in the module — relative paths anchor at the `.mdl` file. */\n assetPath: string;\n /** From the gamma argument: `gamma_srgb` → `\"sRGB\"`, `gamma_linear` → `\"raw\"`. */\n sourceColorSpace?: \"sRGB\" | \"raw\";\n}\n\n/** Narrow an {@link MdlValue} to a texture literal. */\nexport function isMdlTexture(value: MdlValue | undefined): value is MdlTextureValue {\n return (\n typeof value === \"object\" && value !== null && !Array.isArray(value) && \"assetPath\" in value\n );\n}\n\n/** One `export material` declaration. */\nexport interface MdlMaterialDecl {\n name: string;\n /** Literal defaults from the declaration's own parameter list (empty for `(*)`). */\n defaults: Map<string, MdlValue>;\n /** Base material of the wrapper form `X(…) = Base(args…)` (last `::` segment). */\n base?: string;\n /** Literal named arguments of the wrapper's base call. */\n args: Map<string, MdlValue>;\n}\n\n/** The exported material declarations of one `.mdl` file. */\nexport interface MdlModule {\n materials: Map<string, MdlMaterialDecl>;\n}\n\n/**\n * Look up the parsed module for an authored `info:mdl:sourceAsset` path.\n * Returning `undefined` means \"module unavailable\" — resolution then falls\n * back to authored USD inputs alone.\n */\nexport type MdlModuleProvider = (assetPath: string) => MdlModule | undefined;\n\n/** Parse the `export material` declarations of an `.mdl` module's source text. */\nexport function parseMdl(text: string): MdlModule {\n const src = stripNoise(text);\n const materials = new Map<string, MdlMaterialDecl>();\n const declRe = /\\bexport\\s+material\\s+([A-Za-z_]\\w*)\\s*\\(/g;\n let match = declRe.exec(src);\n while (match) {\n const open = match.index + match[0].length - 1;\n const close = matchParen(src, open);\n if (close === -1) break;\n const decl: MdlMaterialDecl = {\n name: match[1] as string,\n defaults: parseParamDefaults(src.slice(open + 1, close - 1)),\n args: new Map(),\n };\n let next = close;\n let i = close;\n while (i < src.length && /\\s/.test(src[i] as string)) i++;\n if (src[i] === \"=\") {\n const end = statementEnd(src, i + 1);\n const body = parseWrapperBody(src.slice(i + 1, end));\n if (body.base) decl.base = body.base;\n decl.args = body.args;\n next = end;\n }\n materials.set(decl.name, decl);\n declRe.lastIndex = next;\n match = declRe.exec(src);\n }\n return { materials };\n}\n\nconst NUMBER_RE = /^[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][+-]?\\d+)?[fFdD]?$/;\nconst CALL_RE = /^(?:::)?([A-Za-z_]\\w*(?:::[A-Za-z_]\\w*)*)\\s*\\(/;\nconst VECTOR_RE = /^(?:color|(?:float|double|int)([234]))$/;\nconst IDENTIFIER_RE = /^[A-Za-z_]\\w*$/;\n\n/**\n * Evaluate one MDL literal expression, or `undefined` for anything beyond the\n * supported literal subset (identifiers, arithmetic, function calls, …).\n */\nexport function parseMdlLiteral(src: string): MdlValue | undefined {\n const s = src.trim();\n if (s === \"true\") return true;\n if (s === \"false\") return false;\n if (NUMBER_RE.test(s)) return Number.parseFloat(s.replace(/[fFdD]$/, \"\"));\n if (s.startsWith('\"')) {\n if (skipString(s, 0) !== s.length) return undefined;\n return s.slice(1, -1).replace(/\\\\(.)/g, \"$1\");\n }\n const call = CALL_RE.exec(s);\n if (!call) return undefined;\n const open = call[0].length - 1;\n if (matchParen(s, open) !== s.length) return undefined;\n const name = (call[1] as string).split(\"::\").pop() as string;\n const args = splitTopLevel(s.slice(open + 1, s.length - 1), \",\")\n .map((a) => a.trim())\n .filter((a) => a.length > 0);\n if (name === \"texture_2d\") {\n const path = args[0] === undefined ? undefined : parseMdlLiteral(args[0]);\n // `texture_2d()` (the empty default) carries no path — same as absent.\n if (typeof path !== \"string\" || path.length === 0) return undefined;\n const texture: MdlTextureValue = { assetPath: path };\n const gamma = args.slice(1).join(\",\");\n if (gamma.includes(\"gamma_srgb\")) texture.sourceColorSpace = \"sRGB\";\n else if (gamma.includes(\"gamma_linear\")) texture.sourceColorSpace = \"raw\";\n return texture;\n }\n const vector = VECTOR_RE.exec(name);\n if (vector) {\n const width = vector[1] ? Number(vector[1]) : 3;\n const values = args.map((a) => parseMdlLiteral(a));\n if (values.length === 0 || !values.every((v) => typeof v === \"number\")) return undefined;\n // A single argument broadcasts (`color(0.2)`, `float2(4.0)`).\n if (values.length === 1) return new Array<number>(width).fill(values[0] as number);\n return values.length === width ? (values as number[]) : undefined;\n }\n return undefined;\n}\n\n/** Literal defaults of a parameter list (`type name = literal, …`); `*` ⇒ none. */\nfunction parseParamDefaults(src: string): Map<string, MdlValue> {\n const defaults = new Map<string, MdlValue>();\n const body = src.trim();\n if (body === \"\" || body === \"*\") return defaults;\n for (const param of splitTopLevel(src, \",\")) {\n const assign = topLevelAssign(param);\n if (assign === -1) continue;\n // The name is the last bare token before `=` (`uniform color diffuse_tint`).\n const name = param.slice(0, assign).trim().split(/\\s+/).pop();\n if (!name || !IDENTIFIER_RE.test(name)) continue;\n const value = parseMdlLiteral(param.slice(assign + 1));\n if (value !== undefined) defaults.set(name, value);\n }\n return defaults;\n}\n\n/**\n * Parse the body after `=`: a single `Base(name: value, …)` call yields the\n * wrapper base + args; anything else (a `let … in material(…)` definition, a\n * direct `material(…)`) yields neither.\n */\nfunction parseWrapperBody(src: string): { base?: string; args: Map<string, MdlValue> } {\n const args = new Map<string, MdlValue>();\n const body = src.trim();\n const call = CALL_RE.exec(body);\n if (!call) return { args };\n const open = call[0].length - 1;\n if (matchParen(body, open) !== body.length) return { args };\n const base = (call[1] as string).split(\"::\").pop() as string;\n if (base === \"material\") return { args };\n for (const arg of splitTopLevel(body.slice(open + 1, body.length - 1), \",\")) {\n const colon = topLevelColon(arg);\n if (colon === -1) continue;\n const name = arg.slice(0, colon).trim();\n if (!IDENTIFIER_RE.test(name)) continue;\n const value = parseMdlLiteral(arg.slice(colon + 1));\n if (value !== undefined) args.set(name, value);\n }\n return { base, args };\n}\n\n/** Remove comments and `[[ … ]]` annotation blocks, keeping string literals. */\nfunction stripNoise(src: string): string {\n let out = \"\";\n let i = 0;\n while (i < src.length) {\n const c = src[i];\n if (c === '\"') {\n const end = skipString(src, i);\n out += src.slice(i, end);\n i = end;\n } else if (c === \"/\" && src[i + 1] === \"/\") {\n while (i < src.length && src[i] !== \"\\n\") i++;\n } else if (c === \"/\" && src[i + 1] === \"*\") {\n const end = src.indexOf(\"*/\", i + 2);\n i = end === -1 ? src.length : end + 2;\n out += \" \";\n } else if (c === \"[\" && src[i + 1] === \"[\") {\n i = skipAnnotation(src, i);\n out += \" \";\n } else {\n out += c;\n i++;\n }\n }\n return out;\n}\n\n/** Skip a string literal; `i` is the opening quote. Returns the index after it. */\nfunction skipString(src: string, i: number): number {\n let j = i + 1;\n while (j < src.length) {\n if (src[j] === \"\\\\\") j += 2;\n else if (src[j] === '\"') return j + 1;\n else j++;\n }\n return j;\n}\n\n/** Skip a `[[ … ]]` annotation block (may nest); `i` is the first `[`. */\nfunction skipAnnotation(src: string, i: number): number {\n let depth = 0;\n let j = i;\n while (j < src.length) {\n if (src[j] === '\"') {\n j = skipString(src, j);\n } else if (src[j] === \"[\" && src[j + 1] === \"[\") {\n depth++;\n j += 2;\n } else if (src[j] === \"]\" && src[j + 1] === \"]\") {\n depth--;\n j += 2;\n if (depth === 0) return j;\n } else {\n j++;\n }\n }\n return j;\n}\n\n/** Index just past the `)` matching the `(` at `open`, or `-1`. */\nfunction matchParen(src: string, open: number): number {\n let depth = 0;\n let i = open;\n while (i < src.length) {\n const c = src[i];\n if (c === '\"') {\n i = skipString(src, i);\n continue;\n }\n if (c === \"(\") depth++;\n else if (c === \")\") {\n depth--;\n if (depth === 0) return i + 1;\n }\n i++;\n }\n return -1;\n}\n\nfunction isOpener(c: string): boolean {\n return c === \"(\" || c === \"[\" || c === \"{\";\n}\n\nfunction isCloser(c: string): boolean {\n return c === \")\" || c === \"]\" || c === \"}\";\n}\n\n/** Split on `separator` at bracket depth 0, respecting string literals. */\nfunction splitTopLevel(src: string, separator: string): string[] {\n const parts: string[] = [];\n let depth = 0;\n let start = 0;\n let i = 0;\n while (i < src.length) {\n const c = src[i] as string;\n if (c === '\"') {\n i = skipString(src, i);\n continue;\n }\n if (isOpener(c)) depth++;\n else if (isCloser(c)) depth--;\n else if (c === separator && depth === 0) {\n parts.push(src.slice(start, i));\n start = i + 1;\n }\n i++;\n }\n parts.push(src.slice(start));\n return parts;\n}\n\n/** Depth-0 index of the statement-terminating `;` at/after `from`, else `src.length`. */\nfunction statementEnd(src: string, from: number): number {\n let depth = 0;\n let i = from;\n while (i < src.length) {\n const c = src[i] as string;\n if (c === '\"') {\n i = skipString(src, i);\n continue;\n }\n if (isOpener(c)) depth++;\n else if (isCloser(c)) depth--;\n else if (c === \";\" && depth === 0) return i;\n i++;\n }\n return src.length;\n}\n\n/** Depth-0 index of a single `=` (not `==` / `<=` / `>=` / `!=`), or `-1`. */\nfunction topLevelAssign(src: string): number {\n let depth = 0;\n let i = 0;\n while (i < src.length) {\n const c = src[i] as string;\n if (c === '\"') {\n i = skipString(src, i);\n continue;\n }\n if (isOpener(c)) depth++;\n else if (isCloser(c)) depth--;\n else if (c === \"=\" && depth === 0 && src[i + 1] !== \"=\" && !\"<>!=\".includes(src[i - 1] ?? \"\")) {\n return i;\n }\n i++;\n }\n return -1;\n}\n\n/** Depth-0 index of a single `:` (not the `::` scope operator), or `-1`. */\nfunction topLevelColon(src: string): number {\n let depth = 0;\n let i = 0;\n while (i < src.length) {\n const c = src[i] as string;\n if (c === '\"') {\n i = skipString(src, i);\n continue;\n }\n if (isOpener(c)) depth++;\n else if (isCloser(c)) depth--;\n else if (c === \":\" && depth === 0) {\n if (src[i + 1] === \":\") {\n i += 2;\n continue;\n }\n return i;\n }\n i++;\n }\n return -1;\n}\n","/**\n * MaterialX surface networks (M21): natively-authored UsdShade `ND_*` shader\n * graphs resolved into the same flat PBR parameters as `UsdPreviewSurface` —\n * parameter mapping only, no graph execution. `ND_standard_surface_surfaceshader`\n * inputs map onto `ResolvedMaterial`; `ND_image_*` / `ND_tiledimage_*` (with\n * `ND_texcoord_*` / `ND_geompropvalue_*` UV sources and `ND_normalmap`) become\n * `ResolvedTexture`s; constant-only `ND_multiply_*` / `ND_mix_*` /\n * `ND_convert_*` (plus `ND_constant_*` values and the `ND_dot_*` passthrough)\n * fold to values. Any other node (noise, ramps, …) skips just that channel\n * with a warning — the rest of the material stays intact. External `.mtlx`\n * files are not read, and executing node graphs is out of scope (M22\n * delegates that to three's node materials).\n */\n\nimport { AssetPath, type Vec2, type Vec3 } from \"../parser/ast.js\";\nimport type { Prim } from \"../usd/Prim.js\";\nimport type {\n ResolvedMaterial,\n ResolvedTexture,\n TextureTransform,\n TextureWrap,\n} from \"./MaterialBinding.js\";\n\n/** The Autodesk standard-surface MaterialX nodedef. */\nexport const MTLX_STANDARD_SURFACE = \"ND_standard_surface_surfaceshader\";\n/** The UsdPreviewSurface compatibility nodedef — same input names, so the\n * generic `UsdPreviewSurface` reads in `MaterialBinding.ts` handle it. */\nexport const MTLX_USD_PREVIEW_SURFACE = \"ND_UsdPreviewSurface_surfaceshader\";\n\ntype OnWarn = ((message: string) => void) | undefined;\n\n/** A MaterialX input resolved without executing the graph. */\ntype MtlxResolved =\n | { kind: \"value\"; value: unknown }\n | { kind: \"texture\"; texture: ResolvedTexture };\n\n/** Nodedef default `base_color` — used when only `base` is authored. */\nconst DEFAULT_BASE_COLOR: Vec3 = [0.8, 0.8, 0.8];\n\n/**\n * Read an `ND_standard_surface_surfaceshader` into `result`. Only authored\n * inputs are mapped (unauthored ⇒ three.js defaults), with two nodedef-default\n * exceptions: `base` alone multiplies the default 0.8-gray `base_color`, and\n * `emission` (default weight 0) gates `emission_color`.\n */\nexport function readStandardSurface(shader: Prim, result: ResolvedMaterial, onWarn?: OnWarn): void {\n const input = (name: string) => resolveMtlxInput(shader, name, onWarn);\n\n // `base × base_color` → color. three multiplies material.color into the\n // map, so a textured base_color keeps `base` as a gray multiplier.\n const base = numberOf(input(\"base\"));\n const baseColor = input(\"base_color\");\n if (baseColor?.kind === \"texture\") {\n result.colorTexture = baseColor.texture;\n if (base !== undefined) result.color = [base, base, base];\n } else {\n const color = colorOf(baseColor) ?? (base !== undefined ? DEFAULT_BASE_COLOR : undefined);\n if (color) {\n const weight = base ?? 1;\n result.color = [color[0] * weight, color[1] * weight, color[2] * weight];\n }\n }\n\n const metalness = input(\"metalness\");\n if (metalness?.kind === \"texture\") result.metalnessTexture = metalness.texture;\n const metalnessValue = numberOf(metalness);\n if (metalnessValue !== undefined) result.metalness = metalnessValue;\n\n const roughness = input(\"specular_roughness\");\n if (roughness?.kind === \"texture\") result.roughnessTexture = roughness.texture;\n const roughnessValue = numberOf(roughness);\n if (roughnessValue !== undefined) result.roughness = roughnessValue;\n\n // Physical-promotion inputs (M19 rule: promote only when authored).\n const ior = numberOf(input(\"specular_IOR\"));\n if (ior !== undefined) result.ior = ior;\n const transmission = numberOf(input(\"transmission\"));\n if (transmission !== undefined) result.transmission = transmission;\n const coat = numberOf(input(\"coat\"));\n if (coat !== undefined) {\n result.clearcoat = coat;\n const coatRoughness = numberOf(input(\"coat_roughness\"));\n if (coatRoughness !== undefined) result.clearcoatRoughness = coatRoughness;\n }\n\n // `emission` is a weight gating `emission_color`.\n const emission = numberOf(input(\"emission\"));\n if (emission !== undefined && emission > 0) {\n const emissionColor = input(\"emission_color\");\n if (emissionColor?.kind === \"texture\") result.emissiveTexture = emissionColor.texture;\n result.emissiveColor = colorOf(emissionColor) ?? [1, 1, 1];\n result.emissiveIntensity = emission;\n }\n\n // standard_surface `opacity` is a color3 — three's scalar opacity takes the mean.\n const opacity = input(\"opacity\");\n if (opacity?.kind === \"texture\") result.opacityTexture = opacity.texture;\n const opacityValue = numberOf(opacity) ?? mean3(colorOf(opacity));\n if (opacityValue !== undefined) result.opacity = opacityValue;\n\n const normal = input(\"normal\");\n if (normal?.kind === \"texture\") result.normalTexture = normal.texture;\n}\n\nfunction resolveMtlxInput(shader: Prim, name: string, onWarn: OnWarn): MtlxResolved | undefined {\n return followMtlxInput(shader, name, name, onWarn, 0);\n}\n\n/** Resolve `inputs:<name>` — a connected node (recursively) or an authored value. */\nfunction followMtlxInput(\n prim: Prim,\n name: string,\n channel: string,\n onWarn: OnWarn,\n depth: number,\n): MtlxResolved | undefined {\n const attr = prim.GetAttribute(`inputs:${name}`);\n const connection = attr.GetConnections()[0];\n if (connection) {\n const source = prim.GetStage().GetPrimAtPath(connection.split(\".\")[0] as string);\n return source ? resolveMtlxNode(source, channel, onWarn, depth + 1) : undefined;\n }\n const value = attr.Get();\n return value === undefined ? undefined : { kind: \"value\", value };\n}\n\n/** Fold-recursion guard — real MaterialX graphs are shallow; cycles are authoring errors. */\nconst MAX_NODE_DEPTH = 8;\n\nfunction resolveMtlxNode(\n node: Prim,\n channel: string,\n onWarn: OnWarn,\n depth: number,\n): MtlxResolved | undefined {\n const id = node.GetAttribute(\"info:id\").Get();\n if (typeof id !== \"string\" || depth > MAX_NODE_DEPTH) {\n onWarn?.(`${node.GetPath()}: unresolvable MaterialX node; skipping the \"${channel}\" channel`);\n return undefined;\n }\n if (id.startsWith(\"ND_image_\") || id.startsWith(\"ND_tiledimage_\")) {\n const texture = readMtlxImage(node, id.startsWith(\"ND_tiledimage_\"));\n return texture ? { kind: \"texture\", texture } : undefined;\n }\n if (id.startsWith(\"ND_normalmap\")) {\n const resolved = followMtlxInput(node, \"in\", channel, onWarn, depth);\n if (resolved?.kind !== \"texture\") return resolved;\n const scale = node.GetAttribute(\"inputs:scale\").Get();\n if (typeof scale === \"number\") {\n // ResolvedTexture.scale follows the UsdUVTexture normal convention\n // (2 ≙ identity — MeshBinding halves it into normalScale).\n resolved.texture.scale = [2 * scale, 2 * scale, 2 * scale, 1];\n }\n return resolved;\n }\n if (id.startsWith(\"ND_constant_\")) {\n const value = node.GetAttribute(\"inputs:value\").Get();\n return value === undefined ? undefined : { kind: \"value\", value };\n }\n if (id.startsWith(\"ND_dot_\")) {\n return followMtlxInput(node, \"in\", channel, onWarn, depth);\n }\n if (id.startsWith(\"ND_convert_\")) {\n const resolved = followMtlxInput(node, \"in\", channel, onWarn, depth);\n if (resolved?.kind !== \"value\") return resolved;\n return { kind: \"value\", value: convertMtlxValue(resolved.value, id) };\n }\n if (id.startsWith(\"ND_multiply_\")) {\n const in1 = operand(node, \"in1\", undefined, channel, onWarn, depth);\n const in2 = operand(node, \"in2\", [1], channel, onWarn, depth);\n const value = in1 && in2 ? broadcast([in1, in2], ([a, b]) => a! * b!) : undefined;\n return value ? { kind: \"value\", value: scalarize(value) } : undefined;\n }\n if (id.startsWith(\"ND_mix_\")) {\n const bg = operand(node, \"bg\", [0], channel, onWarn, depth);\n const fg = operand(node, \"fg\", [0], channel, onWarn, depth);\n const mix = operand(node, \"mix\", [0], channel, onWarn, depth);\n const value =\n bg && fg && mix\n ? broadcast([fg, bg, mix], ([f, b, m]) => f! * m! + b! * (1 - m!))\n : undefined;\n return value ? { kind: \"value\", value: scalarize(value) } : undefined;\n }\n onWarn?.(\n `${node.GetPath()}: MaterialX node \"${id}\" needs graph execution; skipping the \"${channel}\" channel`,\n );\n return undefined;\n}\n\n/** MaterialX `uaddressmode`/`vaddressmode` → three-representable wrap modes. */\nconst MTLX_WRAP: Record<string, TextureWrap> = {\n periodic: \"repeat\",\n clamp: \"clamp\",\n mirror: \"mirror\",\n constant: \"black\", // no border-color sampling in three — clamp-to-black is closest\n};\n\n/** Also consumed by the TSL factory in `three-usd-robot/nodes` (M22). */\nexport function readMtlxImage(node: Prim, tiled: boolean): ResolvedTexture | undefined {\n const file = node.GetAttribute(\"inputs:file\").Get();\n if (!(file instanceof AssetPath) || !file.path) return undefined;\n const texture: ResolvedTexture = { path: file.path };\n if (tiled) {\n // `tiledimage` repeats by construction; uvtiling/uvoffset are the transform.\n texture.wrapS = \"repeat\";\n texture.wrapT = \"repeat\";\n const transform: TextureTransform = {};\n const tiling = vec2Of(node.GetAttribute(\"inputs:uvtiling\").Get());\n if (tiling) transform.scale = tiling;\n const offset = vec2Of(node.GetAttribute(\"inputs:uvoffset\").Get());\n if (offset) transform.translation = offset;\n if (transform.scale || transform.translation) texture.transform = transform;\n } else {\n const uaddress = node.GetAttribute(\"inputs:uaddressmode\").Get();\n const wrapS = typeof uaddress === \"string\" ? MTLX_WRAP[uaddress] : undefined;\n if (wrapS) texture.wrapS = wrapS;\n const vaddress = node.GetAttribute(\"inputs:vaddressmode\").Get();\n const wrapT = typeof vaddress === \"string\" ? MTLX_WRAP[vaddress] : undefined;\n if (wrapT) texture.wrapT = wrapT;\n }\n readMtlxTexcoord(node, texture);\n return texture;\n}\n\n/** `inputs:texcoord` source: a UV-set index (`ND_texcoord_*`) or primvar name (`ND_geompropvalue_*`). */\nfunction readMtlxTexcoord(node: Prim, texture: ResolvedTexture): void {\n const connection = node.GetAttribute(\"inputs:texcoord\").GetConnections()[0];\n if (!connection) return;\n const source = node.GetStage().GetPrimAtPath(connection.split(\".\")[0] as string);\n const id = source?.GetAttribute(\"info:id\").Get();\n if (!source || typeof id !== \"string\") return;\n if (id.startsWith(\"ND_texcoord_\")) {\n const index = source.GetAttribute(\"inputs:index\").Get();\n if (typeof index === \"number\" && index > 0) texture.uvChannel = index;\n } else if (id.startsWith(\"ND_geompropvalue_\")) {\n const geomprop = source.GetAttribute(\"inputs:geomprop\").Get();\n if (typeof geomprop === \"string\" && geomprop.length > 0) texture.uvSet = geomprop;\n }\n}\n\n/**\n * A fold node's operand as numbers: an authored constant, a folded upstream\n * value, or `fallback` when unauthored. Textured / unsupported operands make\n * the fold fail (`undefined`) — this is constant folding only.\n */\nfunction operand(\n node: Prim,\n name: string,\n fallback: number[] | undefined,\n channel: string,\n onWarn: OnWarn,\n depth: number,\n): number[] | undefined {\n const attr = node.GetAttribute(`inputs:${name}`);\n if (!attr.GetConnections()[0]) {\n const value = attr.Get();\n return value === undefined ? fallback : numsOf(value);\n }\n const resolved = followMtlxInput(node, name, channel, onWarn, depth);\n if (resolved?.kind === \"value\") return numsOf(resolved.value);\n if (resolved?.kind === \"texture\") {\n onWarn?.(\n `${node.GetPath()}: constant folding cannot take a textured \"${name}\"; skipping the \"${channel}\" channel`,\n );\n }\n return undefined; // unsupported sources have already warned\n}\n\n/** Component counts by MaterialX type-name suffix (`ND_convert_float_color3`). */\nconst MTLX_TYPE_SIZE: Record<string, number> = {\n float: 1,\n integer: 1,\n boolean: 1,\n vector2: 2,\n color3: 3,\n vector3: 3,\n color4: 4,\n vector4: 4,\n};\n\nfunction convertMtlxValue(value: unknown, id: string): unknown {\n const target = id.split(\"_\").pop() ?? \"\";\n const size = MTLX_TYPE_SIZE[target];\n const nums = numsOf(value);\n if (!size || !nums) return value;\n if (size === 1) return nums[0];\n // Broadcast scalars; pad a color4 alpha with 1, anything else with 0.\n return Array.from({ length: size }, (_, i) =>\n i < nums.length\n ? nums[i]\n : nums.length === 1\n ? nums[0]\n : target === \"color4\" && i === 3\n ? 1\n : 0,\n );\n}\n\n/** Componentwise op with single-component broadcast (the `*FA` node variants). */\nfunction broadcast(\n operands: number[][],\n op: (components: (number | undefined)[]) => number,\n): number[] | undefined {\n const length = Math.max(...operands.map((o) => o.length));\n if (operands.some((o) => o.length !== 1 && o.length !== length)) return undefined;\n return Array.from({ length }, (_, i) => op(operands.map((o) => (o.length === 1 ? o[0] : o[i]))));\n}\n\nfunction scalarize(value: number[]): number | number[] {\n return value.length === 1 ? (value[0] as number) : value;\n}\n\nfunction numsOf(value: unknown): number[] | undefined {\n if (typeof value === \"number\") return [value];\n if (Array.isArray(value) && value.length > 0 && value.every((n) => typeof n === \"number\")) {\n return value as number[];\n }\n return undefined;\n}\n\nfunction numberOf(resolved: MtlxResolved | undefined): number | undefined {\n if (resolved?.kind !== \"value\") return undefined;\n const v = resolved.value;\n if (typeof v === \"number\") return v;\n if (Array.isArray(v) && v.length === 1 && typeof v[0] === \"number\") return v[0];\n return undefined;\n}\n\nfunction colorOf(resolved: MtlxResolved | undefined): Vec3 | undefined {\n if (resolved?.kind !== \"value\") return undefined;\n const v = resolved.value;\n if (typeof v === \"number\") return [v, v, v];\n if (Array.isArray(v) && v.length >= 3 && v.every((n) => typeof n === \"number\")) {\n return [v[0], v[1], v[2]] as Vec3;\n }\n return undefined;\n}\n\nfunction mean3(v: Vec3 | undefined): number | undefined {\n return v ? (v[0] + v[1] + v[2]) / 3 : undefined;\n}\n\nfunction vec2Of(value: unknown): Vec2 | undefined {\n return Array.isArray(value) &&\n value.length >= 2 &&\n typeof value[0] === \"number\" &&\n typeof value[1] === \"number\"\n ? [value[0], value[1]]\n : undefined;\n}\n","/**\n * Resolves `UsdShade` material bindings to flat PBR parameters.\n *\n * Follows a prim's (or an ancestor's) `material:binding` to a `Material`, finds\n * its surface `Shader`, and reads constant color/metalness/roughness/opacity/\n * emissive inputs plus the **texture** asset paths for the diffuse, normal,\n * roughness, metallic, occlusion and emissive channels. Handles both\n * `UsdPreviewSurface` (constant inputs or a connected `UsdUVTexture` network)\n * and the Omniverse MDL material families (M20): `OmniPBR` (and derivatives\n * such as `OmniPBR_Opacity`), `OmniPBR_ClearCoat`, `OmniGlass`, and an\n * `OmniSurface(Lite)` constants subset. MDL shaders are identified by\n * `info:mdl:sourceAsset` / `:subIdentifier`; when the referenced `.mdl` module\n * text is available (see `loadMdlModules`), parameter values fall back from\n * authored USD inputs to the module's wrapper arguments and declaration\n * defaults. Executing MDL remains out of scope.\n *\n * MaterialX networks authored natively in UsdShade (M21) resolve here too:\n * `ND_standard_surface_surfaceshader` has a dedicated reader (see\n * `MaterialXBinding.ts`), while the `ND_Usd*` compatibility nodes share\n * `UsdPreviewSurface` input names and reuse the generic reads.\n */\n\nimport { AssetPath, type Vec2, type Vec3 } from \"../parser/ast.js\";\nimport { joinPosix } from \"../usd/AssetResolver.js\";\nimport type { Prim } from \"../usd/Prim.js\";\nimport type { Stage } from \"../usd/Stage.js\";\nimport { type MdlModuleProvider, type MdlValue, isMdlTexture } from \"../usd/mdl/parseMdl.js\";\nimport {\n MTLX_STANDARD_SURFACE,\n MTLX_USD_PREVIEW_SURFACE,\n readStandardSurface,\n} from \"./MaterialXBinding.js\";\n\n/** `UsdUVTexture` wrap mode for one axis (`black` ≈ clamp; three has no border). */\nexport type TextureWrap = \"repeat\" | \"clamp\" | \"mirror\" | \"black\";\n\n/** `UsdTransform2d` applied to the `st` coords feeding a texture. */\nexport type TextureTransform = {\n /** `inputs:translation` (UV offset). */\n translation?: Vec2;\n /** `inputs:rotation` in degrees (CCW about the origin). */\n rotation?: number;\n /** `inputs:scale` (UV tiling). */\n scale?: Vec2;\n};\n\n/** A resolved texture reference plus its `UsdUVTexture` sampler/transform state. */\nexport type ResolvedTexture = {\n /** Authored asset path of the image. */\n path: string;\n wrapS?: TextureWrap;\n wrapT?: TextureWrap;\n /** `UsdTransform2d` on the `st` input, if any. */\n transform?: TextureTransform;\n /** `inputs:scale` — multiplies the sampled value (folded into material factors). */\n scale?: [number, number, number, number];\n /** `inputs:bias` — added to the sampled value. */\n bias?: [number, number, number, number];\n /**\n * UV-set (primvar) name the texture reads, resolved through the `inputs:st`\n * connection to a `UsdPrimvarReader_float2.inputs:varname`. Absent ⇒ `\"st\"`.\n */\n uvSet?: string;\n /**\n * Direct UV channel index (MaterialX `ND_texcoord_*.inputs:index`, M21).\n * Beats `uvSet`; channel N is the mesh's N-th UV set in `meshUvSetNames`\n * order (`st` first, extras sorted).\n */\n uvChannel?: number;\n /** `inputs:sourceColorSpace` — overrides the per-channel colorspace default. */\n sourceColorSpace?: \"raw\" | \"sRGB\" | \"auto\";\n /**\n * Which output the consuming input connects to (`outputs:r` → `\"r\"`, …).\n * three.js samples fixed channels (roughness = G, metalness = B, ao = R);\n * a mismatch is surfaced as a load warning.\n */\n outputChannel?: \"r\" | \"g\" | \"b\" | \"a\" | \"rgb\";\n};\n\nexport type ResolvedMaterial = {\n /** Name of the bound `Material` prim, for round-tripping and debugging. */\n name?: string;\n color?: Vec3;\n opacity?: number;\n metalness?: number;\n roughness?: number;\n emissiveColor?: Vec3;\n /**\n * `inputs:opacityThreshold`. When `> 0`, opacity is a binary mask (alpha\n * clip / cutout); when `0`/absent, sub-unit opacity blends translucently.\n */\n opacityThreshold?: number;\n /** `inputs:ior` — promotes the three material to `MeshPhysicalMaterial`. */\n ior?: number;\n /** `inputs:clearcoat` (physical promotion). */\n clearcoat?: number;\n /** `inputs:clearcoatRoughness` (physical promotion). */\n clearcoatRoughness?: number;\n /** `inputs:specularColor`, only when `inputs:useSpecularWorkflow = 1`. */\n specularColor?: Vec3;\n /** OmniPBR `inputs:emissive_intensity` — multiplies the emissive color. */\n emissiveIntensity?: number;\n /** OmniGlass — `1` marks a transmissive dielectric (physical promotion, M20). */\n transmission?: number;\n /** OmniGlass `inputs:depth` — refraction volume thickness (scene units, M20). */\n thickness?: number;\n /** Diffuse/albedo texture, if any. */\n colorTexture?: ResolvedTexture;\n /** Opacity / alpha texture (may be the same image as `colorTexture`). */\n opacityTexture?: ResolvedTexture;\n /** Tangent-space normal map, if any. */\n normalTexture?: ResolvedTexture;\n /** Roughness map, if any. */\n roughnessTexture?: ResolvedTexture;\n /** Metallic map, if any. */\n metalnessTexture?: ResolvedTexture;\n /** Ambient-occlusion map, if any. */\n occlusionTexture?: ResolvedTexture;\n /** Emissive map, if any. */\n emissiveTexture?: ResolvedTexture;\n /** OmniPBR_ClearCoat `clearcoat_normalmap_texture` (physical promotion, M20). */\n clearcoatNormalTexture?: ResolvedTexture;\n};\n\n// Input names below are bare (no `inputs:` prefix) so the same name reaches\n// both the authored USD attribute and the `.mdl` declaration value.\nconst DIFFUSE_INPUTS = [\n \"diffuseColor\", // UsdPreviewSurface\n \"diffuse_color_constant\", // OmniPBR\n \"diffuse_tint\",\n \"base_color\",\n \"baseColor\",\n];\nconst OPACITY_INPUTS = [\"opacity\", \"opacity_constant\"];\nconst OPACITY_THRESHOLD_INPUTS = [\"opacityThreshold\", \"opacity_threshold\"];\nconst METALLIC_INPUTS = [\"metallic\", \"metallic_constant\"];\nconst ROUGHNESS_INPUTS = [\"roughness\", \"reflection_roughness_constant\"];\nconst EMISSIVE_INPUTS = [\"emissiveColor\", \"emissive_color\"];\n\nconst SURFACE_OUTPUTS = [\"outputs:surface\", \"outputs:mdl:surface\", \"outputs:mtlx:surface\"];\n\n/**\n * Per-channel texture lookup: `surface` names are `UsdPreviewSurface` inputs\n * that connect to a `UsdUVTexture` (we follow the connection to its\n * `inputs:file`); `direct` names are OmniPBR-style MDL asset-valued texture\n * inputs (authored in USD or carried by the `.mdl` declaration).\n */\ntype TextureLookup = { surface: string[]; direct: string[] };\n\nconst TEXTURE_LOOKUPS: Record<\n \"color\" | \"opacity\" | \"normal\" | \"roughness\" | \"metalness\" | \"occlusion\" | \"emissive\",\n TextureLookup\n> = {\n color: {\n surface: [\"diffuseColor\"],\n direct: [\"diffuse_texture\", \"diffuse_color_texture\", \"glass_color_texture\"],\n },\n opacity: {\n surface: [\"opacity\"],\n direct: [\"opacity_texture\", \"opacity_color_texture\"],\n },\n normal: {\n surface: [\"normal\"],\n direct: [\"normalmap_texture\", \"normal_texture\", \"normal_map_texture\"],\n },\n roughness: {\n surface: [\"roughness\"],\n direct: [\"reflectionroughness_texture\", \"roughness_texture\"],\n },\n metalness: {\n surface: [\"metallic\"],\n direct: [\"metallic_texture\"],\n },\n occlusion: {\n surface: [\"occlusion\"],\n direct: [\"ao_texture\", \"occlusion_texture\"],\n },\n emissive: {\n surface: [\"emissiveColor\"],\n direct: [\"emissive_color_texture\", \"emissive_mask_texture\"],\n },\n};\n\nexport type ResolveMaterialOptions = {\n /** Parsed `.mdl` modules for MDL family detection and value fallback (M20). */\n mdl?: MdlModuleProvider;\n /** Receives diagnostics (unknown MDL material families). */\n onWarn?: (message: string) => void;\n};\n\n/** Resolve the bound material's flat parameters for `prim`, or `undefined`. */\nexport function resolveBoundMaterial(\n stage: Stage,\n prim: Prim,\n options: ResolveMaterialOptions = {},\n): ResolvedMaterial | undefined {\n const materialPath = findBinding(prim);\n if (!materialPath) return undefined;\n const material = stage.GetPrimAtPath(materialPath);\n if (!material) return undefined;\n const shader = findSurfaceShader(material);\n if (!shader) return undefined;\n\n // MaterialX (M21): standard_surface gets a dedicated reader; other ND_*\n // surface shaders fall through to the generic best-effort reads (the\n // ND_UsdPreviewSurface compatibility node matches them by construction).\n const infoId = shader.GetAttribute(\"info:id\").Get();\n if (typeof infoId === \"string\" && infoId.startsWith(\"ND_\")) {\n if (infoId === MTLX_STANDARD_SURFACE) {\n const result: ResolvedMaterial = { name: material.GetName() };\n readStandardSurface(shader, result, options.onWarn);\n return result;\n }\n if (infoId !== MTLX_USD_PREVIEW_SURFACE) {\n options.onWarn?.(\n `${material.GetPath()}: unknown MaterialX surface shader \"${infoId}\"; applying the best-effort UsdPreviewSurface mapping`,\n );\n }\n }\n\n const mdlSource = readMdlShaderSource(shader, options.mdl);\n if (mdlSource && !mdlSource.family) {\n options.onWarn?.(\n `${material.GetPath()}: unknown MDL material \"${mdlSource.id}\" (${mdlSource.assetPath}); applying the best-effort OmniPBR mapping`,\n );\n }\n const sv: ShaderValues = { shader };\n if (mdlSource?.values) sv.mdl = mdlSource.values;\n if (mdlSource) sv.mdlAssetPath = mdlSource.assetPath;\n\n const result: ResolvedMaterial = { name: material.GetName() };\n const color = firstColor(sv, DIFFUSE_INPUTS);\n if (color) result.color = color;\n const opacity = firstNumber(sv, OPACITY_INPUTS);\n if (opacity !== undefined) result.opacity = opacity;\n const opacityThreshold = firstNumber(sv, OPACITY_THRESHOLD_INPUTS);\n if (opacityThreshold !== undefined) result.opacityThreshold = opacityThreshold;\n const metalness = firstNumber(sv, METALLIC_INPUTS);\n if (metalness !== undefined) result.metalness = metalness;\n const roughness = firstNumber(sv, ROUGHNESS_INPUTS);\n if (roughness !== undefined) result.roughness = roughness;\n\n const emissive = firstColor(sv, EMISSIVE_INPUTS);\n // OmniPBR gates emission behind `inputs:enable_emission`; UsdPreviewSurface\n // has no such input (undefined ⇒ honoured).\n if (emissive && svBoolean(sv, \"enable_emission\") !== false) {\n result.emissiveColor = emissive;\n const intensity = svNumber(sv, \"emissive_intensity\");\n if (intensity !== undefined) result.emissiveIntensity = intensity;\n }\n\n // UsdPreviewSurface physical inputs — their presence promotes the three\n // material from Standard to Physical.\n const ior = svNumber(sv, \"ior\");\n if (ior !== undefined) result.ior = ior;\n const clearcoat = svNumber(sv, \"clearcoat\");\n if (clearcoat !== undefined) result.clearcoat = clearcoat;\n const clearcoatRoughness = svNumber(sv, \"clearcoatRoughness\");\n if (clearcoatRoughness !== undefined) result.clearcoatRoughness = clearcoatRoughness;\n if (svNumber(sv, \"useSpecularWorkflow\") === 1) {\n const specular = svColor(sv, \"specularColor\");\n if (specular) result.specularColor = specular;\n }\n\n const colorTex = findTexture(sv, TEXTURE_LOOKUPS.color);\n if (colorTex !== undefined) result.colorTexture = colorTex;\n const opacityTex = findTexture(sv, TEXTURE_LOOKUPS.opacity);\n if (opacityTex !== undefined) result.opacityTexture = opacityTex;\n const normal = findTexture(sv, TEXTURE_LOOKUPS.normal);\n if (normal !== undefined) result.normalTexture = normal;\n const roughTex = findTexture(sv, TEXTURE_LOOKUPS.roughness);\n if (roughTex !== undefined) result.roughnessTexture = roughTex;\n const metalTex = findTexture(sv, TEXTURE_LOOKUPS.metalness);\n if (metalTex !== undefined) result.metalnessTexture = metalTex;\n const aoTex = findTexture(sv, TEXTURE_LOOKUPS.occlusion);\n if (aoTex !== undefined) result.occlusionTexture = aoTex;\n const emissiveTex = findTexture(sv, TEXTURE_LOOKUPS.emissive);\n if (emissiveTex !== undefined) result.emissiveTexture = emissiveTex;\n\n // OmniPBR packed ORM: when enabled it replaces the per-channel lookups.\n // Its layout (AO = R, roughness = G, metalness = B) matches what three.js\n // samples, so the channels line up by construction.\n const orm = directTexture(sv, \"ORM_texture\") ?? mdlValueTexture(sv, \"ORM_texture\");\n if (svBoolean(sv, \"enable_ORM_texture\") === true && orm) {\n result.occlusionTexture = { ...orm, outputChannel: \"r\" };\n result.roughnessTexture = { ...orm, outputChannel: \"g\" };\n result.metalnessTexture = { ...orm, outputChannel: \"b\" };\n }\n\n // Family-specific parameter names on top of the generic reads (M20).\n switch (mdlSource?.family) {\n case \"glass\":\n readOmniGlass(sv, result);\n break;\n case \"clearcoat\":\n readOmniClearCoat(sv, result);\n break;\n case \"surface\":\n readOmniSurface(sv, result);\n break;\n default:\n break; // \"pbr\" and unknown families are covered by the generic reads\n }\n\n return result;\n}\n\n/**\n * The `Shader` prim driving `prim`'s bound material surface, or `undefined`.\n * Follows the same binding/surface-output resolution as\n * {@link resolveBoundMaterial} — exposed for custom material factories (M22)\n * that need the raw shader network rather than the flattened parameters.\n */\nexport function findBoundSurfaceShader(stage: Stage, prim: Prim): Prim | undefined {\n const materialPath = findBinding(prim);\n if (!materialPath) return undefined;\n const material = stage.GetPrimAtPath(materialPath);\n if (!material) return undefined;\n return findSurfaceShader(material);\n}\n\n/** Omniverse MDL material family driving the family-specific parameter reads. */\ntype OmniMdlFamily = \"pbr\" | \"clearcoat\" | \"glass\" | \"surface\";\n\nfunction classifyOmniMdl(name: string | undefined): OmniMdlFamily | undefined {\n if (!name) return undefined;\n if (name.startsWith(\"OmniGlass\")) return \"glass\";\n if (name.startsWith(\"OmniPBR_ClearCoat\")) return \"clearcoat\";\n if (name.startsWith(\"OmniPBR\")) return \"pbr\"; // OmniPBR_Opacity & co. fall back here\n if (name.startsWith(\"OmniSurface\")) return \"surface\";\n return undefined;\n}\n\ntype MdlShaderSource = {\n /** Authored `info:mdl:sourceAsset` path. */\n assetPath: string;\n /** Material name inside the module (`subIdentifier`, else the file stem). */\n id: string;\n family?: OmniMdlFamily;\n /** Declaration defaults overlaid with wrapper-call arguments. */\n values?: Map<string, MdlValue>;\n};\n\n/**\n * Identify an MDL shader (`info:mdl:sourceAsset` + `:subIdentifier`) and merge\n * its `.mdl` declaration values when the module is available. A wrapper\n * declaration (`export material X(*) = OmniPBR(...)`) also resolves the family\n * through its base material.\n */\nfunction readMdlShaderSource(\n shader: Prim,\n provider: MdlModuleProvider | undefined,\n): MdlShaderSource | undefined {\n const asset = shader.GetAttribute(\"info:mdl:sourceAsset\").Get();\n if (!(asset instanceof AssetPath) || !asset.path) return undefined;\n const sub = shader.GetAttribute(\"info:mdl:sourceAsset:subIdentifier\").Get();\n const stem = (asset.path.split(\"/\").pop() ?? \"\").replace(/\\.mdl$/i, \"\");\n const id = typeof sub === \"string\" && sub.length > 0 ? sub : stem;\n const decl = provider?.(asset.path)?.materials.get(id);\n const family = classifyOmniMdl(decl?.base) ?? classifyOmniMdl(id) ?? classifyOmniMdl(stem);\n const source: MdlShaderSource = { assetPath: asset.path, id };\n if (family) source.family = family;\n if (decl && (decl.defaults.size > 0 || decl.args.size > 0)) {\n // Wrapper args beat the declaration's own defaults; authored USD inputs\n // beat both (enforced by the accessors, which try USD first).\n source.values = new Map([...decl.defaults, ...decl.args]);\n }\n return source;\n}\n\n/**\n * `OmniGlass` — a transmissive dielectric. Canonical MDL defaults are baked in\n * (`glass_ior` 1.491, smooth, colorless) so an input-less glass shader still\n * reads as glass instead of the gray mesh fallback.\n */\nfunction readOmniGlass(sv: ShaderValues, result: ResolvedMaterial): void {\n result.transmission = 1;\n result.metalness = 0;\n result.color = svColor(sv, \"glass_color\") ?? [1, 1, 1];\n result.ior = svNumber(sv, \"glass_ior\") ?? 1.491;\n result.roughness = svNumber(sv, \"frosting_roughness\") ?? 0;\n const depth = svNumber(sv, \"depth\");\n if (svBoolean(sv, \"thin_walled\") !== true && depth !== undefined) result.thickness = depth;\n const cutout = svNumber(sv, \"cutout_opacity\");\n if (cutout !== undefined && cutout < 1) result.opacity = cutout;\n}\n\n/**\n * `OmniPBR_ClearCoat` — OmniPBR plus a lacquer layer. The generic reads cover\n * the OmniPBR base; this adds three's clearcoat (weight 1 unless explicitly\n * disabled — the coat's presence is the material's point).\n */\nfunction readOmniClearCoat(sv: ShaderValues, result: ResolvedMaterial): void {\n if (svBoolean(sv, \"enable_clearcoat\") === false) return;\n result.clearcoat = 1;\n const roughness = svNumber(sv, \"clearcoat_reflection_roughness\");\n if (roughness !== undefined) result.clearcoatRoughness = roughness;\n const normal =\n directTexture(sv, \"clearcoat_normalmap_texture\") ??\n mdlValueTexture(sv, \"clearcoat_normalmap_texture\");\n if (normal && svBoolean(sv, \"enable_clearcoat_normalmap_texture\") !== false) {\n result.clearcoatNormalTexture = normal;\n }\n}\n\n/**\n * `OmniSurface` / `OmniSurfaceLite` — constants-only subset of the ~100-input\n * Standard-Surface-style material. Texture-driven inputs are shader-graph\n * connections in real assets and stay out of scope; unsupported inputs are\n * ignored.\n */\nfunction readOmniSurface(sv: ShaderValues, result: ResolvedMaterial): void {\n const color = svColor(sv, \"diffuse_reflection_color\");\n if (color) result.color = color;\n const metalness = svNumber(sv, \"metalness\");\n if (metalness !== undefined) result.metalness = metalness;\n const roughness = svNumber(sv, \"specular_reflection_roughness\");\n if (roughness !== undefined) result.roughness = roughness;\n const ior = svNumber(sv, \"specular_reflection_ior\");\n if (ior !== undefined) result.ior = ior;\n const coat = svNumber(sv, \"coat_weight\");\n if (coat !== undefined && coat > 0) {\n result.clearcoat = coat;\n const coatRoughness = svNumber(sv, \"coat_roughness\");\n if (coatRoughness !== undefined) result.clearcoatRoughness = coatRoughness;\n }\n const emissionWeight = svNumber(sv, \"emission_weight\");\n const emissionColor = svColor(sv, \"emission_color\");\n if (emissionWeight !== undefined && emissionWeight > 0 && emissionColor) {\n result.emissiveColor = emissionColor;\n result.emissiveIntensity = emissionWeight;\n }\n if (svBoolean(sv, \"enable_opacity\") === true) {\n const opacity = svNumber(sv, \"geometry_opacity\");\n if (opacity !== undefined) result.opacity = opacity;\n }\n}\n\n/**\n * Shader parameter view (M20): each accessor tries the authored USD input\n * (`inputs:<name>`) first, then the merged `.mdl` declaration values.\n */\ntype ShaderValues = {\n shader: Prim;\n mdl?: ReadonlyMap<string, MdlValue>;\n /** Authored module path — anchors module-relative texture paths. */\n mdlAssetPath?: string;\n};\n\nfunction authored(sv: ShaderValues, name: string): unknown {\n return sv.shader.GetAttribute(`inputs:${name}`).Get();\n}\n\nfunction asNumber(v: unknown): number | undefined {\n return typeof v === \"number\" ? v : undefined;\n}\n\nfunction asBoolean(v: unknown): boolean | undefined {\n return typeof v === \"boolean\" ? v : undefined;\n}\n\nfunction asVec(v: unknown, length: number): number[] | undefined {\n if (Array.isArray(v) && v.length >= length && v.every((n) => typeof n === \"number\")) {\n return (v as number[]).slice(0, length);\n }\n return undefined;\n}\n\nfunction svNumber(sv: ShaderValues, name: string): number | undefined {\n return asNumber(authored(sv, name)) ?? asNumber(sv.mdl?.get(name));\n}\n\nfunction svBoolean(sv: ShaderValues, name: string): boolean | undefined {\n return asBoolean(authored(sv, name)) ?? asBoolean(sv.mdl?.get(name));\n}\n\nfunction svColor(sv: ShaderValues, name: string): Vec3 | undefined {\n const v = asVec(authored(sv, name), 3) ?? asVec(sv.mdl?.get(name), 3);\n return v ? (v as Vec3) : undefined;\n}\n\nfunction svVec2(sv: ShaderValues, name: string): Vec2 | undefined {\n const v = asVec(authored(sv, name), 2) ?? asVec(sv.mdl?.get(name), 2);\n return v ? (v as Vec2) : undefined;\n}\n\n/** First authored value across `names`, then the first `.mdl` value. */\nfunction firstNumber(sv: ShaderValues, names: string[]): number | undefined {\n for (const name of names) {\n const v = asNumber(authored(sv, name));\n if (v !== undefined) return v;\n }\n for (const name of names) {\n const v = asNumber(sv.mdl?.get(name));\n if (v !== undefined) return v;\n }\n return undefined;\n}\n\nfunction firstColor(sv: ShaderValues, names: string[]): Vec3 | undefined {\n for (const name of names) {\n const v = asVec(authored(sv, name), 3);\n if (v) return v as Vec3;\n }\n for (const name of names) {\n const v = asVec(sv.mdl?.get(name), 3);\n if (v) return v as Vec3;\n }\n return undefined;\n}\n\n/** An authored direct asset input (`inputs:<name> = @path@`) as a texture. */\nfunction directTexture(sv: ShaderValues, name: string): ResolvedTexture | undefined {\n const v = authored(sv, name);\n if (v instanceof AssetPath && v.path) return withMdlTransform(sv, { path: v.path });\n return undefined;\n}\n\n/** A `texture_2d` literal from the `.mdl` declaration as a texture. */\nfunction mdlValueTexture(sv: ShaderValues, name: string): ResolvedTexture | undefined {\n const v = sv.mdl?.get(name);\n if (!isMdlTexture(v)) return undefined;\n const texture: ResolvedTexture = { path: resolveMdlRelative(sv.mdlAssetPath, v.assetPath) };\n if (v.sourceColorSpace) texture.sourceColorSpace = v.sourceColorSpace;\n return withMdlTransform(sv, texture);\n}\n\n/**\n * Texture paths inside a `.mdl` file are relative to the **module**, not the\n * USD layer — rebase them onto the module's authored path so the texture\n * provider (which resolves against the layer) finds them.\n */\nfunction resolveMdlRelative(modulePath: string | undefined, path: string): string {\n if (!modulePath || path.startsWith(\"/\") || /^[a-z][a-z0-9+.-]*:/i.test(path)) return path;\n return joinPosix(modulePath, path);\n}\n\nfunction withMdlTransform(sv: ShaderValues, texture: ResolvedTexture): ResolvedTexture {\n const transform = mdlTextureTransform(sv);\n return transform ? { ...texture, transform } : texture;\n}\n\n/**\n * Resolve a channel's texture, in authoring-strength order: an authored\n * OmniPBR direct asset input, then a `UsdPreviewSurface` input's connection to\n * a `UsdUVTexture` (path + sampler/transform state + connected output\n * channel), then a `texture_2d` value from the `.mdl` declaration.\n */\nfunction findTexture(sv: ShaderValues, lookup: TextureLookup): ResolvedTexture | undefined {\n for (const name of lookup.direct) {\n const texture = directTexture(sv, name);\n if (texture) return texture;\n }\n for (const name of lookup.surface) {\n const conn = sv.shader.GetAttribute(`inputs:${name}`).GetConnections()[0];\n if (!conn) continue;\n const texPrim = sv.shader.GetStage().GetPrimAtPath(conn.split(\".\")[0] as string);\n if (!texPrim) continue;\n const file = texPrim.GetAttribute(\"inputs:file\").Get();\n if (file instanceof AssetPath && file.path) {\n const tex = readUvTexture(texPrim, file.path);\n const channel = outputChannelOf(conn);\n if (channel) tex.outputChannel = channel;\n return tex;\n }\n }\n for (const name of lookup.direct) {\n const texture = mdlValueTexture(sv, name);\n if (texture) return texture;\n }\n return undefined;\n}\n\n/** The `outputs:*` suffix of a connection path, normalized to a channel tag. */\nfunction outputChannelOf(connection: string): ResolvedTexture[\"outputChannel\"] | undefined {\n const m = /\\.outputs:(\\w+)$/.exec(connection);\n switch (m?.[1]) {\n case \"r\":\n case \"g\":\n case \"b\":\n case \"a\":\n return m[1];\n case \"rgb\":\n case \"rgba\":\n return \"rgb\";\n default:\n return undefined;\n }\n}\n\n/**\n * OmniPBR MDL shader-level UV transform (`inputs:texture_translate` /\n * `texture_rotate` / `texture_scale`) — applies to the shader's textures.\n * Values may come from authored inputs or the `.mdl` declaration.\n */\nfunction mdlTextureTransform(sv: ShaderValues): TextureTransform | undefined {\n const transform: TextureTransform = {};\n const translation = svVec2(sv, \"texture_translate\");\n if (translation) transform.translation = translation;\n const scale = svVec2(sv, \"texture_scale\");\n if (scale) transform.scale = scale;\n const rotation = svNumber(sv, \"texture_rotate\");\n if (rotation !== undefined) transform.rotation = rotation;\n return Object.keys(transform).length > 0 ? transform : undefined;\n}\n\nconst WRAP_VALUES = new Set([\"repeat\", \"clamp\", \"mirror\", \"black\"]);\n\n/** Read a `UsdUVTexture` prim's wrap modes, scale/bias, colorspace, and `st` chain. */\nfunction readUvTexture(texPrim: Prim, path: string): ResolvedTexture {\n const tex: ResolvedTexture = { path };\n\n const wrapS = texPrim.GetAttribute(\"inputs:wrapS\").Get();\n if (typeof wrapS === \"string\" && WRAP_VALUES.has(wrapS)) tex.wrapS = wrapS as TextureWrap;\n const wrapT = texPrim.GetAttribute(\"inputs:wrapT\").Get();\n if (typeof wrapT === \"string\" && WRAP_VALUES.has(wrapT)) tex.wrapT = wrapT as TextureWrap;\n\n const scale = numArray(texPrim, \"inputs:scale\", 4);\n if (scale) tex.scale = scale as [number, number, number, number];\n const bias = numArray(texPrim, \"inputs:bias\", 4);\n if (bias) tex.bias = bias as [number, number, number, number];\n\n const sourceColorSpace = texPrim.GetAttribute(\"inputs:sourceColorSpace\").Get();\n if (sourceColorSpace === \"raw\" || sourceColorSpace === \"sRGB\" || sourceColorSpace === \"auto\") {\n tex.sourceColorSpace = sourceColorSpace;\n }\n\n const st = readStChain(texPrim);\n if (st.transform) tex.transform = st.transform;\n if (st.uvSet) tex.uvSet = st.uvSet;\n return tex;\n}\n\n/** Follow a shader input's connection to its source prim. */\nfunction connectedPrim(prim: Prim, input: string): Prim | null {\n const conn = prim.GetAttribute(input).GetConnections()[0];\n if (!conn) return null;\n return prim.GetStage().GetPrimAtPath(conn.split(\".\")[0] as string);\n}\n\n// The MaterialX `ND_Usd*` compatibility nodes mirror the native node inputs.\nconst TRANSFORM2D_IDS = new Set([\"UsdTransform2d\", \"ND_UsdTransform2d\"]);\nconst PRIMVAR_READER_IDS = new Set([\"UsdPrimvarReader_float2\", \"ND_UsdPrimvarReader_vector2\"]);\n\n/**\n * Walk the `inputs:st` chain: an optional `UsdTransform2d` (translate /\n * rotate / scale) feeding from a `UsdPrimvarReader_float2`, whose\n * `inputs:varname` names the UV set the texture samples.\n */\nfunction readStChain(texPrim: Prim): { transform?: TextureTransform; uvSet?: string } {\n const out: { transform?: TextureTransform; uvSet?: string } = {};\n let node = connectedPrim(texPrim, \"inputs:st\");\n if (node && TRANSFORM2D_IDS.has(node.GetAttribute(\"info:id\").Get() as string)) {\n const transform: TextureTransform = {};\n const translation = numArray(node, \"inputs:translation\", 2);\n if (translation) transform.translation = translation as Vec2;\n const scale = numArray(node, \"inputs:scale\", 2);\n if (scale) transform.scale = scale as Vec2;\n const rotation = node.GetAttribute(\"inputs:rotation\").Get();\n if (typeof rotation === \"number\") transform.rotation = rotation;\n if (Object.keys(transform).length > 0) out.transform = transform;\n node = connectedPrim(node, \"inputs:in\");\n }\n if (node && PRIMVAR_READER_IDS.has(node.GetAttribute(\"info:id\").Get() as string)) {\n const varname = node.GetAttribute(\"inputs:varname\").Get();\n if (typeof varname === \"string\" && varname.length > 0) out.uvSet = varname;\n }\n return out;\n}\n\n/** Read a numeric attribute as a fixed-length array, or `undefined`. */\nfunction numArray(prim: Prim, name: string, length: number): number[] | undefined {\n return asVec(prim.GetAttribute(name).Get(), length);\n}\n\n/**\n * Resolve the bound material path for `prim` (UsdShade semantics, preview\n * rendering): at each prim, `material:binding:preview` beats the all-purpose\n * `material:binding`. Walking rootward, the nearest binding wins — unless an\n * ancestor authors `bindMaterialAs = \"strongerThanDescendants\"`, which\n * overrides everything below it (topmost such binding is final).\n */\nfunction findBinding(prim: Prim): string | undefined {\n let chosen: string | undefined;\n let p: Prim | null = prim;\n while (p) {\n for (const name of [\"material:binding:preview\", \"material:binding\"]) {\n const rel = p.GetRelationship(name);\n const target = rel.GetTargets()[0];\n if (!target) continue;\n const stronger = rel.GetMetadata(\"bindMaterialAs\") === \"strongerThanDescendants\";\n if (chosen === undefined || stronger) chosen = target;\n break; // preview found — don't let the all-purpose binding of the same prim override\n }\n p = p.GetParent();\n }\n return chosen;\n}\n\nfunction findSurfaceShader(material: Prim): Prim | undefined {\n // Prefer the shader connected to a surface output.\n for (const out of SURFACE_OUTPUTS) {\n const conn = material.GetAttribute(out).GetConnections()[0];\n if (conn) {\n const shaderPath = conn.split(\".\")[0] as string;\n const shader = material.GetStage().GetPrimAtPath(shaderPath);\n if (shader) return shader;\n }\n }\n // Fallback: the first child Shader prim.\n return material.GetChildren().find((c) => c.GetTypeName() === \"Shader\") ?? undefined;\n}\n"]}
@@ -1,53 +1,4 @@
1
- // src/parser/ast.ts
2
- var Quat = class _Quat {
3
- constructor(real, imaginary) {
4
- this.real = real;
5
- this.imaginary = imaginary;
6
- }
7
- real;
8
- imaginary;
9
- /** Components in Three.js order `[x, y, z, w]`. */
10
- toXYZW() {
11
- return [this.imaginary[0], this.imaginary[1], this.imaginary[2], this.real];
12
- }
13
- static identity() {
14
- return new _Quat(1, [0, 0, 0]);
15
- }
16
- };
17
- var UsdMatrix = class _UsdMatrix {
18
- constructor(values, dim) {
19
- this.values = values;
20
- this.dim = dim;
21
- }
22
- values;
23
- dim;
24
- static identity4() {
25
- return new _UsdMatrix([
26
- 1,
27
- 0,
28
- 0,
29
- 0,
30
- 0,
31
- 1,
32
- 0,
33
- 0,
34
- 0,
35
- 0,
36
- 1,
37
- 0,
38
- 0,
39
- 0,
40
- 0,
41
- 1
42
- ], 4);
43
- }
44
- };
45
- var AssetPath = class {
46
- constructor(path) {
47
- this.path = path;
48
- }
49
- path;
50
- };
1
+ import { UsdMatrix, Quat } from './chunk-JGIVJXBU.js';
51
2
 
52
3
  // src/kinematics/transforms.ts
53
4
  var DEG2RAD = Math.PI / 180;
@@ -437,6 +388,6 @@ function channelFromSamples(samples) {
437
388
  return { times, values };
438
389
  }
439
390
 
440
- export { AssetPath, DEG2RAD, Quat, RAD2DEG, UsdMatrix, channelFromSamples, decomposeJointRelative, decomposeRigid, fromUsdMatrix, getTranslation, identity4, interpolate, invert, makeEuler, makeRotationFromQuat, makeRotationX, makeRotationY, makeRotationZ, makeScale, makeTranslation, multiply, multiplyAll, nearestAngleBranch, toUsdMatrix };
441
- //# sourceMappingURL=chunk-LDO5FKQS.js.map
442
- //# sourceMappingURL=chunk-LDO5FKQS.js.map
391
+ export { DEG2RAD, RAD2DEG, channelFromSamples, decomposeJointRelative, decomposeRigid, fromUsdMatrix, getTranslation, identity4, interpolate, invert, makeEuler, makeRotationFromQuat, makeRotationX, makeRotationY, makeRotationZ, makeScale, makeTranslation, multiply, multiplyAll, nearestAngleBranch, toUsdMatrix };
392
+ //# sourceMappingURL=chunk-YGJ23CG3.js.map
393
+ //# sourceMappingURL=chunk-YGJ23CG3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/kinematics/transforms.ts","../src/kinematics/jointResiduals.ts","../src/kinematics/sampling.ts"],"names":[],"mappings":";;;AAsBO,IAAM,OAAA,GAAU,KAAK,EAAA,GAAK;AAC1B,IAAM,OAAA,GAAU,MAAM,IAAA,CAAK;AAE3B,SAAS,SAAA,GAAkB;AAEhC,EAAA,OAAO;AAAA,IACL,CAAA;AAAA,IAAG,CAAA;AAAA,IAAG,CAAA;AAAA,IAAG,CAAA;AAAA,IACT,CAAA;AAAA,IAAG,CAAA;AAAA,IAAG,CAAA;AAAA,IAAG,CAAA;AAAA,IACT,CAAA;AAAA,IAAG,CAAA;AAAA,IAAG,CAAA;AAAA,IAAG,CAAA;AAAA,IACT,CAAA;AAAA,IAAG,CAAA;AAAA,IAAG,CAAA;AAAA,IAAG;AAAA,GACX;AACF;AAGO,SAAS,QAAA,CAAS,GAAS,CAAA,EAAe;AAC/C,EAAA,MAAM,GAAA,GAAM,CAAA,CAAE,CAAC,CAAA,EACb,MAAM,CAAA,CAAE,CAAC,CAAA,EACT,GAAA,GAAM,CAAA,CAAE,CAAC,CAAA,EACT,GAAA,GAAM,EAAE,CAAC,CAAA;AACX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AAA,MAAM,KAAA,GAAQ,CAAC,GAAG,OAAA,CAAQ,IAAA,EAAM,CAAA,CAAE,IAAA,CAAK,CAAC,CAAA,EAAG,CAAA,KAAM,CAAA,GAAI,CAAC,CAAA;AACtD,EAAA,MAAM,MAAA,GAAS,MAAM,GAAA,CAAI,CAAC,MAAM,OAAA,CAAQ,GAAA,CAAI,CAAC,CAAA,IAAK,CAAC,CAAA;AACnD,EAAA,OAAO,EAAE,OAAO,MAAA,EAAO;AACzB","file":"chunk-YGJ23CG3.js","sourcesContent":["/**\n * Minimal 4×4 matrix math, Three.js-independent.\n *\n * ## Convention\n *\n * A {@link Mat4} is a flat 16-element array in **column-major** order — the\n * exact layout of `THREE.Matrix4.elements`, so a `Mat4` can be handed to\n * `matrix4.fromArray(m)` with no transposition. Transforms use the\n * column-vector convention `v' = M · v`; the translation lives at indices\n * `[12, 13, 14]`.\n *\n * Conveniently, OpenUSD stores `GfMatrix4d` **row-major** with a row-vector\n * convention (`v' = v · M`). The two raw 16-number arrays for the *same*\n * transform are therefore bit-identical, which is why {@link fromUsdMatrix} is\n * a plain copy. See the module test for a worked example.\n */\n\nimport { Quat, UsdMatrix, type Vec3 } from \"../parser/ast.js\";\n\n/** Column-major 4×4 matrix (Three.js `elements` layout). */\nexport type Mat4 = number[];\n\nexport const DEG2RAD = Math.PI / 180;\nexport const RAD2DEG = 180 / Math.PI;\n\nexport function identity4(): Mat4 {\n // biome-ignore format: matrix layout\n return [\n 1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1,\n ];\n}\n\n/** Matrix product `a · b` (column-major), matching `THREE.Matrix4.multiplyMatrices`. */\nexport function multiply(a: Mat4, b: Mat4): Mat4 {\n const a11 = a[0]!,\n a21 = a[1]!,\n a31 = a[2]!,\n a41 = a[3]!;\n const a12 = a[4]!,\n a22 = a[5]!,\n a32 = a[6]!,\n a42 = a[7]!;\n const a13 = a[8]!,\n a23 = a[9]!,\n a33 = a[10]!,\n a43 = a[11]!;\n const a14 = a[12]!,\n a24 = a[13]!,\n a34 = a[14]!,\n a44 = a[15]!;\n\n const b11 = b[0]!,\n b21 = b[1]!,\n b31 = b[2]!,\n b41 = b[3]!;\n const b12 = b[4]!,\n b22 = b[5]!,\n b32 = b[6]!,\n b42 = b[7]!;\n const b13 = b[8]!,\n b23 = b[9]!,\n b33 = b[10]!,\n b43 = b[11]!;\n const b14 = b[12]!,\n b24 = b[13]!,\n b34 = b[14]!,\n b44 = b[15]!;\n\n return [\n a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41,\n a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41,\n a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41,\n a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41,\n\n a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42,\n a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42,\n a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42,\n a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42,\n\n a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43,\n a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43,\n a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43,\n a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43,\n\n a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44,\n a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44,\n a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44,\n a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44,\n ];\n}\n\n/** Product of a list of matrices, left-to-right (`m[0] · m[1] · …`). */\nexport function multiplyAll(matrices: Mat4[]): Mat4 {\n let m = identity4();\n for (const next of matrices) m = multiply(m, next);\n return m;\n}\n\n/** Inverse (column-major), matching `THREE.Matrix4.invert`. Throws if singular. */\nexport function invert(m: Mat4): Mat4 {\n const n11 = m[0]!,\n n21 = m[1]!,\n n31 = m[2]!,\n n41 = m[3]!;\n const n12 = m[4]!,\n n22 = m[5]!,\n n32 = m[6]!,\n n42 = m[7]!;\n const n13 = m[8]!,\n n23 = m[9]!,\n n33 = m[10]!,\n n43 = m[11]!;\n const n14 = m[12]!,\n n24 = m[13]!,\n n34 = m[14]!,\n n44 = m[15]!;\n\n const t11 =\n n23 * n34 * n42 -\n n24 * n33 * n42 +\n n24 * n32 * n43 -\n n22 * n34 * n43 -\n n23 * n32 * n44 +\n n22 * n33 * n44;\n const t12 =\n n14 * n33 * n42 -\n n13 * n34 * n42 -\n n14 * n32 * n43 +\n n12 * n34 * n43 +\n n13 * n32 * n44 -\n n12 * n33 * n44;\n const t13 =\n n13 * n24 * n42 -\n n14 * n23 * n42 +\n n14 * n22 * n43 -\n n12 * n24 * n43 -\n n13 * n22 * n44 +\n n12 * n23 * n44;\n const t14 =\n n14 * n23 * n32 -\n n13 * n24 * n32 -\n n14 * n22 * n33 +\n n12 * n24 * n33 +\n n13 * n22 * n34 -\n n12 * n23 * n34;\n\n const det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n if (det === 0) throw new Error(\"cannot invert a singular matrix\");\n const idet = 1 / det;\n\n return [\n t11 * idet,\n (n24 * n33 * n41 -\n n23 * n34 * n41 -\n n24 * n31 * n43 +\n n21 * n34 * n43 +\n n23 * n31 * n44 -\n n21 * n33 * n44) *\n idet,\n (n22 * n34 * n41 -\n n24 * n32 * n41 +\n n24 * n31 * n42 -\n n21 * n34 * n42 -\n n22 * n31 * n44 +\n n21 * n32 * n44) *\n idet,\n (n23 * n32 * n41 -\n n22 * n33 * n41 -\n n23 * n31 * n42 +\n n21 * n33 * n42 +\n n22 * n31 * n43 -\n n21 * n32 * n43) *\n idet,\n\n t12 * idet,\n (n13 * n34 * n41 -\n n14 * n33 * n41 +\n n14 * n31 * n43 -\n n11 * n34 * n43 -\n n13 * n31 * n44 +\n n11 * n33 * n44) *\n idet,\n (n14 * n32 * n41 -\n n12 * n34 * n41 -\n n14 * n31 * n42 +\n n11 * n34 * n42 +\n n12 * n31 * n44 -\n n11 * n32 * n44) *\n idet,\n (n12 * n33 * n41 -\n n13 * n32 * n41 +\n n13 * n31 * n42 -\n n11 * n33 * n42 -\n n12 * n31 * n43 +\n n11 * n32 * n43) *\n idet,\n\n t13 * idet,\n (n14 * n23 * n41 -\n n13 * n24 * n41 -\n n14 * n21 * n43 +\n n11 * n24 * n43 +\n n13 * n21 * n44 -\n n11 * n23 * n44) *\n idet,\n (n12 * n24 * n41 -\n n14 * n22 * n41 +\n n14 * n21 * n42 -\n n11 * n24 * n42 -\n n12 * n21 * n44 +\n n11 * n22 * n44) *\n idet,\n (n13 * n22 * n41 -\n n12 * n23 * n41 -\n n13 * n21 * n42 +\n n11 * n23 * n42 +\n n12 * n21 * n43 -\n n11 * n22 * n43) *\n idet,\n\n t14 * idet,\n (n13 * n24 * n31 -\n n14 * n23 * n31 +\n n14 * n21 * n33 -\n n11 * n24 * n33 -\n n13 * n21 * n34 +\n n11 * n23 * n34) *\n idet,\n (n14 * n22 * n31 -\n n12 * n24 * n31 -\n n14 * n21 * n32 +\n n11 * n24 * n32 +\n n12 * n21 * n34 -\n n11 * n22 * n34) *\n idet,\n (n12 * n23 * n31 -\n n13 * n22 * n31 +\n n13 * n21 * n32 -\n n11 * n23 * n32 -\n n12 * n21 * n33 +\n n11 * n22 * n33) *\n idet,\n ];\n}\n\nexport function makeTranslation([x, y, z]: Vec3): Mat4 {\n // biome-ignore format: matrix layout\n return [\n 1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n x, y, z, 1,\n ];\n}\n\nexport function makeScale([x, y, z]: Vec3): Mat4 {\n // biome-ignore format: matrix layout\n return [\n x, 0, 0, 0,\n 0, y, 0, 0,\n 0, 0, z, 0,\n 0, 0, 0, 1,\n ];\n}\n\nexport function makeRotationX(rad: number): Mat4 {\n const c = Math.cos(rad);\n const s = Math.sin(rad);\n // biome-ignore format: matrix layout\n return [\n 1, 0, 0, 0,\n 0, c, s, 0,\n 0, -s, c, 0,\n 0, 0, 0, 1,\n ];\n}\n\nexport function makeRotationY(rad: number): Mat4 {\n const c = Math.cos(rad);\n const s = Math.sin(rad);\n // biome-ignore format: matrix layout\n return [\n c, 0, -s, 0,\n 0, 1, 0, 0,\n s, 0, c, 0,\n 0, 0, 0, 1,\n ];\n}\n\nexport function makeRotationZ(rad: number): Mat4 {\n const c = Math.cos(rad);\n const s = Math.sin(rad);\n // biome-ignore format: matrix layout\n return [\n c, s, 0, 0,\n -s, c, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1,\n ];\n}\n\n/** Rotation matrix from a (normalized) quaternion, matching `THREE.Matrix4.compose`. */\nexport function makeRotationFromQuat(q: Quat): Mat4 {\n let x = q.imaginary[0];\n let y = q.imaginary[1];\n let z = q.imaginary[2];\n let w = q.real;\n const len = Math.hypot(x, y, z, w);\n if (len > 0 && Math.abs(len - 1) > 1e-9) {\n x /= len;\n y /= len;\n z /= len;\n w /= len;\n }\n\n const x2 = x + x,\n y2 = y + y,\n z2 = z + z;\n const xx = x * x2,\n xy = x * y2,\n xz = x * z2;\n const yy = y * y2,\n yz = y * z2,\n zz = z * z2;\n const wx = w * x2,\n wy = w * y2,\n wz = w * z2;\n\n // biome-ignore format: matrix layout\n return [\n 1 - (yy + zz), xy + wz, xz - wy, 0,\n xy - wz, 1 - (xx + zz), yz + wx, 0,\n xz + wy, yz - wx, 1 - (xx + yy), 0,\n 0, 0, 0, 1,\n ];\n}\n\n/**\n * Euler rotation matrix for the given axis order (e.g. `\"XYZ\"`), with per-axis\n * angles in **radians** indexed by axis (`angles[0]`=X, `[1]`=Y, `[2]`=Z).\n *\n * Follows OpenUSD's `rotate<ORDER>` semantics: the first listed axis is applied\n * first to the geometry, so `\"XYZ\"` yields `Rz · Ry · Rx` in column-vector form.\n */\nexport function makeEuler(angles: Vec3, order: string): Mat4 {\n const perAxis: Record<string, Mat4> = {\n X: makeRotationX(angles[0]),\n Y: makeRotationY(angles[1]),\n Z: makeRotationZ(angles[2]),\n };\n let m = identity4();\n for (let i = order.length - 1; i >= 0; i--) {\n const axis = perAxis[order[i]!];\n if (!axis)\n throw new Error(\n `invalid euler axis ${JSON.stringify(order[i])} in order ${JSON.stringify(order)}`,\n );\n m = multiply(m, axis);\n }\n return m;\n}\n\n/**\n * Copy a USD matrix into a {@link Mat4}. USD's row-major storage is identical to\n * Three.js column-major elements for the same transform (see module docs), so\n * this is a straight copy after a dimension check.\n */\nexport function fromUsdMatrix(m: UsdMatrix): Mat4 {\n if (m.dim !== 4 || m.values.length !== 16) {\n throw new Error(`expected a 4x4 matrix but got dim=${m.dim}, length=${m.values.length}`);\n }\n return [...m.values];\n}\n\n/** Extract the translation component `[x, y, z]` from a {@link Mat4}. */\nexport function getTranslation(m: Mat4): Vec3 {\n return [m[12]!, m[13]!, m[14]!];\n}\n\n/** Copy a {@link Mat4} into a USD `matrix4d` — same flat layout (see module docs). */\nexport function toUsdMatrix(m: Mat4): UsdMatrix {\n if (m.length !== 16) {\n throw new Error(`expected 16 matrix elements but got ${m.length}`);\n }\n return new UsdMatrix([...m], 4);\n}\n\n/**\n * Decompose a rigid transform into translation + orientation (M13 export).\n *\n * The rotation basis is orthonormalized (Gram-Schmidt, right-handed) before\n * quaternion extraction; `rigid` reports whether the input already was rigid\n * within tolerance, so callers can warn that scale/shear/reflection was\n * discarded.\n */\nexport function decomposeRigid(m: Mat4): { position: Vec3; orientation: Quat; rigid: boolean } {\n const position: Vec3 = [m[12]!, m[13]!, m[14]!];\n\n // Rotation-block basis columns.\n const b0: Vec3 = [m[0]!, m[1]!, m[2]!];\n const b1: Vec3 = [m[4]!, m[5]!, m[6]!];\n const b2: Vec3 = [m[8]!, m[9]!, m[10]!];\n\n const EPS = 1e-6;\n const rigid =\n Math.abs(norm(b0) - 1) < EPS &&\n Math.abs(norm(b1) - 1) < EPS &&\n Math.abs(norm(b2) - 1) < EPS &&\n Math.abs(dot(b0, b1)) < EPS &&\n Math.abs(dot(b1, b2)) < EPS &&\n Math.abs(dot(b0, b2)) < EPS &&\n dot(cross(b0, b1), b2) > 0; // right-handed (no reflection)\n\n const c0 = normalizeVec(b0);\n const c1 = normalizeVec(subVec(b1, scaleVec(c0, dot(c0, b1))));\n const c2 = cross(c0, c1);\n\n // Row-major rotation entries from the orthonormal columns.\n const r11 = c0[0],\n r12 = c1[0],\n r13 = c2[0];\n const r21 = c0[1],\n r22 = c1[1],\n r23 = c2[1];\n const r31 = c0[2],\n r32 = c1[2],\n r33 = c2[2];\n\n // Matrix → quaternion (Shepperd's method, as in THREE.Quaternion.setFromRotationMatrix).\n const trace = r11 + r22 + r33;\n let w: number;\n let x: number;\n let y: number;\n let z: number;\n if (trace > 0) {\n const s = 0.5 / Math.sqrt(trace + 1);\n w = 0.25 / s;\n x = (r32 - r23) * s;\n y = (r13 - r31) * s;\n z = (r21 - r12) * s;\n } else if (r11 > r22 && r11 > r33) {\n const s = 2 * Math.sqrt(1 + r11 - r22 - r33);\n w = (r32 - r23) / s;\n x = 0.25 * s;\n y = (r12 + r21) / s;\n z = (r13 + r31) / s;\n } else if (r22 > r33) {\n const s = 2 * Math.sqrt(1 + r22 - r11 - r33);\n w = (r13 - r31) / s;\n x = (r12 + r21) / s;\n y = 0.25 * s;\n z = (r23 + r32) / s;\n } else {\n const s = 2 * Math.sqrt(1 + r33 - r11 - r22);\n w = (r21 - r12) / s;\n x = (r13 + r31) / s;\n y = (r23 + r32) / s;\n z = 0.25 * s;\n }\n\n return { position, orientation: new Quat(w, [x, y, z]), rigid };\n}\n\n// --- small Vec3 helpers for decomposeRigid ---------------------------------\n\nfunction dot(a: Vec3, b: Vec3): number {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nfunction norm(v: Vec3): number {\n return Math.hypot(v[0], v[1], v[2]);\n}\n\nfunction subVec(a: Vec3, b: Vec3): Vec3 {\n return [a[0] - b[0], a[1] - b[1], a[2] - b[2]];\n}\n\nfunction scaleVec(v: Vec3, s: number): Vec3 {\n return [v[0] * s, v[1] * s, v[2] * s];\n}\n\nfunction normalizeVec(v: Vec3): Vec3 {\n const n = norm(v);\n return n > 0 ? scaleVec(v, 1 / n) : [1, 0, 0];\n}\n\nfunction cross(a: Vec3, b: Vec3): Vec3 {\n return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];\n}\n","/**\n * Closed-form decomposition of a joint's observed parent→child transform\n * against its ideal single-DOF model (baked-playback diagnostics, M23).\n *\n * A UsdPhysics joint constrains child body1 to parent body0 through its two\n * authored frames: `inv(Wp) · Wc = F0 · M(q) · inv(F1)`, where `M(q)` rotates\n * about the joint axis (revolute / continuous), slides along it (prismatic),\n * or is identity (fixed). Observed world transforms therefore yield\n *\n * D = inv(F0) · inv(Wp) · Wc · F1\n *\n * which equals `M(q)` exactly for a constraint-consistent pose. This module\n * extracts `q` from `D` and reports what remains as residuals: translation at\n * the joint anchor (`anchorError`, stage linear units) and rotation off the\n * DOF (`axisError`, radians — the swing of a swing–twist split for revolute\n * joints). Inputs must be rigid stage-space transforms, before any\n * `metersPerUnit` or up-axis normalization.\n */\n\nimport { type Mat4, decomposeRigid, invert, multiplyAll } from \"./transforms.js\";\n\n/** The slice of a joint description the decomposition needs (structurally satisfied by `JointDescription`). */\nexport type JointDofInput = {\n type: \"fixed\" | \"revolute\" | \"continuous\" | \"prismatic\";\n /** Axis token as authored (`physics:axis`). */\n axis: \"X\" | \"Y\" | \"Z\";\n /** Joint frame in the parent (body0) local space. */\n jointFrame0: Mat4;\n /** Joint frame in the child (body1) local space. */\n jointFrame1: Mat4;\n};\n\nexport type JointRelativeDecomposition = {\n /** Joint value along the DOF (radians / stage length units; `0` for fixed). */\n q: number;\n /** Translation residual at the joint anchor (stage linear units). */\n anchorError: number;\n /** Rotation residual off the DOF (radians). */\n axisError: number;\n};\n\nconst AXIS_INDEX = { X: 0, Y: 1, Z: 2 } as const;\n\n/** Decompose `inv(Wp)·Wc` against the joint's single-DOF model (see module docs). */\nexport function decomposeJointRelative(\n joint: JointDofInput,\n parentWorld: Mat4,\n childWorld: Mat4,\n): JointRelativeDecomposition {\n const d = multiplyAll([\n invert(joint.jointFrame0),\n invert(parentWorld),\n childWorld,\n joint.jointFrame1,\n ]);\n const t: [number, number, number] = [d[12]!, d[13]!, d[14]!];\n\n // Principal-branch (w ≥ 0) unit quaternion of D's rotation block.\n const { orientation } = decomposeRigid(d);\n const sign = orientation.real < 0 ? -1 : 1;\n const w = sign * orientation.real;\n const vx = sign * orientation.imaginary[0];\n const vy = sign * orientation.imaginary[1];\n const vz = sign * orientation.imaginary[2];\n const rotationAngle = 2 * Math.atan2(Math.hypot(vx, vy, vz), w);\n\n const i = AXIS_INDEX[joint.axis];\n if (joint.type === \"prismatic\") {\n const anchor = Math.hypot(i === 0 ? 0 : t[0], i === 1 ? 0 : t[1], i === 2 ? 0 : t[2]);\n return { q: t[i], anchorError: anchor, axisError: rotationAngle };\n }\n if (joint.type === \"fixed\") {\n return { q: 0, anchorError: Math.hypot(...t), axisError: rotationAngle };\n }\n\n // Revolute / continuous — swing–twist about the axis: the twist is the joint\n // value, the swing is the violation. With d normalized and w ≥ 0 the twist\n // is (w, proj·axis)/‖(w, proj)‖ and cos(swing/2) = ‖(w, proj)‖.\n const proj = i === 0 ? vx : i === 1 ? vy : vz;\n const twistNorm = Math.hypot(w, proj);\n const q = twistNorm > 1e-12 ? 2 * Math.atan2(proj, w) : 0;\n const swing = 2 * Math.atan2(Math.sqrt(Math.max(0, 1 - twistNorm * twistNorm)), twistNorm);\n return { q, anchorError: Math.hypot(...t), axisError: swing };\n}\n\n/**\n * Move `q` to the 2πk branch nearest `previous` — frame-to-frame continuity\n * past ±π for revolute/continuous joints (`opts.previous` of\n * `jointValuesFromLinkTransforms`).\n */\nexport function nearestAngleBranch(q: number, previous: number): number {\n const TWO_PI = 2 * Math.PI;\n return q + TWO_PI * Math.round((previous - q) / TWO_PI);\n}\n","/**\n * Time-sample interpolation for animated values (e.g. joint trajectories).\n *\n * USD time samples are keyed by time code. We linearly interpolate between the\n * two bracketing samples and hold the endpoints outside the authored range\n * (matching USD's held extrapolation).\n */\n\n/** A sorted time-sampled scalar channel. */\nexport type SampleChannel = {\n /** Sample times, ascending. */\n times: number[];\n /** Sample values, parallel to {@link times} (SI units). */\n values: number[];\n};\n\n/** Linearly sample `channel` at time `t` (held outside the range). */\nexport function interpolate(channel: SampleChannel, t: number): number {\n const { times, values } = channel;\n const n = times.length;\n if (n === 0) return 0;\n if (t <= times[0]!) return values[0]!;\n if (t >= times[n - 1]!) return values[n - 1]!;\n\n // Binary search for the first sample time > t.\n let lo = 0;\n let hi = n - 1;\n while (lo < hi) {\n const mid = (lo + hi) >> 1;\n if (times[mid]! <= t) lo = mid + 1;\n else hi = mid;\n }\n const i = lo - 1; // times[i] <= t < times[i+1]\n const t0 = times[i]!;\n const t1 = times[i + 1]!;\n const span = t1 - t0;\n const f = span > 0 ? (t - t0) / span : 0;\n return values[i]! + (values[i + 1]! - values[i]!) * f;\n}\n\n/** Build a sorted {@link SampleChannel} from `(time → value)` pairs via `map`. */\nexport function channelFromSamples(samples: Map<number, number>): SampleChannel {\n const times = [...samples.keys()].sort((a, b) => a - b);\n const values = times.map((t) => samples.get(t) ?? 0);\n return { times, values };\n}\n"]}
package/dist/core.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { U as UsdaFile, b as Vec3, V as Vec2, M as Mat4, L as LinkDescription, S as Stage, R as RobotDescription, P as Prim, x as UsdValue, J as JointType, A as Axis, s as SdfPath, d as LinkInertialDescription } from './buildKinematicTree-BCySuZZn.js';
2
- export { e as AssetPath, f as Attribute, g as AttributeSpec, B as BuildTreeOptions, C as CompositionArc, D as DEFAULT_METERS_PER_UNIT, h as DEG2RAD, a as JointDescription, c as JointDriveDescription, i as KinematicNode, K as KinematicTree, j as Layer, k as ListOp, l as MetadataMap, m as PrimSpec, n as PropertySpec, Q as Quat, o as RAD2DEG, p as Relationship, q as RelationshipSpec, r as SampleChannel, t as Specifier, T as TreeEdge, u as UpAxis, v as UsdDictionary, w as UsdMatrix, y as Variability, z as Vec4, E as buildKinematicTree, F as channelFromSamples, G as decomposeRigid, H as fromUsdMatrix, I as getTranslation, N as identity4, O as interpolate, W as invert, X as makeEuler, Y as makeRotationFromQuat, Z as makeRotationX, _ as makeRotationY, $ as makeRotationZ, a0 as makeScale, a1 as makeTranslation, a2 as multiply, a3 as multiplyAll, a4 as toUsdMatrix } from './buildKinematicTree-BCySuZZn.js';
3
- import { A as AssetResolver } from './bytes-MOJ2oN-u.js';
4
- export { B as BinarySource, D as DefaultAssetResolver, U as UsdSource, c as createMemoryResolver, j as joinPosix, t as toBytes } from './bytes-MOJ2oN-u.js';
1
+ import { U as UsdaFile, y as Vec3, x as Vec2, M as Mat4, i as LinkDescription, S as Stage, R as RobotDescription, P as Prim, w as UsdValue, f as JointType, A as Axis, r as SdfPath, L as LinkInertialDescription } from './buildKinematicTree-iFqaw0Jl.js';
2
+ export { a as AssetPath, b as Attribute, c as AttributeSpec, B as BuildTreeOptions, C as CompositionArc, D as DEFAULT_METERS_PER_UNIT, d as DEG2RAD, e as JointDescription, J as JointDriveDescription, g as KinematicNode, K as KinematicTree, h as Layer, j as ListOp, k as MetadataMap, l as PrimSpec, m as PropertySpec, Q as Quat, n as RAD2DEG, o as Relationship, p as RelationshipSpec, q as SampleChannel, s as Specifier, T as TreeEdge, t as UpAxis, u as UsdDictionary, v as UsdMatrix, V as Variability, z as Vec4, E as buildKinematicTree, F as channelFromSamples, G as decomposeRigid, H as fromUsdMatrix, I as getTranslation, N as identity4, O as interpolate, W as invert, X as makeEuler, Y as makeRotationFromQuat, Z as makeRotationX, _ as makeRotationY, $ as makeRotationZ, a0 as makeScale, a1 as makeTranslation, a2 as multiply, a3 as multiplyAll, a4 as toUsdMatrix } from './buildKinematicTree-iFqaw0Jl.js';
3
+ import { A as AssetResolver, b as MdlModuleProvider } from './parseMdl-vfzBGoMr.js';
4
+ export { D as DefaultAssetResolver, M as MdlMaterialDecl, a as MdlModule, c as MdlTextureValue, d as MdlValue, e as createMemoryResolver, i as isMdlTexture, j as joinPosix, p as parseMdl, f as parseMdlLiteral } from './parseMdl-vfzBGoMr.js';
5
+ export { B as BinarySource, U as UsdSource, t as toBytes } from './bytes-CxGRGry_.js';
5
6
 
6
7
  /** Package identity. Kept in one place so every entry point can re-export it. */
7
8
  declare const PACKAGE_NAME = "three-usd-robot";
@@ -247,64 +248,6 @@ declare function composeLayer(text: string, baseUrl: string, resolver: AssetReso
247
248
  /** Compose an already-parsed layer (used by the binary-crate path too). */
248
249
  declare function composeFile(file: UsdaFile, baseUrl: string, resolver: AssetResolver, options?: ComposeOptions, stack?: ReadonlySet<string>, cache?: LayerCache): Promise<UsdaFile>;
249
250
 
250
- /**
251
- * Minimal `.mdl` **declaration** parser (M20) — reads material signatures, not
252
- * the MDL language.
253
- *
254
- * USD stores only the *overridden* inputs of an MDL shader; every other
255
- * parameter value lives in the referenced `.mdl` module. Two declaration
256
- * shapes carry the values we can recover without executing MDL:
257
- *
258
- * - parameter defaults —
259
- * `export material OmniPBR(color diffuse_color_constant = color(0.2), …)`
260
- * - wrapper materials (the usual shape of per-asset `Materials/*.mdl`) —
261
- * `export material Steel(*) = OmniPBR::OmniPBR(diffuse_color_constant: color(…), …);`
262
- *
263
- * Only literal values are extracted: numbers, bools, strings, `color(…)` /
264
- * `floatN(…)` vectors, and `texture_2d("path", ::tex::gamma_*)`. Defaults that
265
- * are expressions, function calls, or cross-module references are skipped, as
266
- * are comments and `[[ … ]]` annotation blocks. Executing MDL stays out of
267
- * scope — this is a fidelity aid, not an interpreter.
268
- */
269
- /** A literal value read from an MDL declaration. */
270
- type MdlValue = number | boolean | string | number[] | MdlTextureValue;
271
- /** A `texture_2d("path", ::tex::gamma_*)` literal. */
272
- interface MdlTextureValue {
273
- /** Path as written in the module — relative paths anchor at the `.mdl` file. */
274
- assetPath: string;
275
- /** From the gamma argument: `gamma_srgb` → `"sRGB"`, `gamma_linear` → `"raw"`. */
276
- sourceColorSpace?: "sRGB" | "raw";
277
- }
278
- /** Narrow an {@link MdlValue} to a texture literal. */
279
- declare function isMdlTexture(value: MdlValue | undefined): value is MdlTextureValue;
280
- /** One `export material` declaration. */
281
- interface MdlMaterialDecl {
282
- name: string;
283
- /** Literal defaults from the declaration's own parameter list (empty for `(*)`). */
284
- defaults: Map<string, MdlValue>;
285
- /** Base material of the wrapper form `X(…) = Base(args…)` (last `::` segment). */
286
- base?: string;
287
- /** Literal named arguments of the wrapper's base call. */
288
- args: Map<string, MdlValue>;
289
- }
290
- /** The exported material declarations of one `.mdl` file. */
291
- interface MdlModule {
292
- materials: Map<string, MdlMaterialDecl>;
293
- }
294
- /**
295
- * Look up the parsed module for an authored `info:mdl:sourceAsset` path.
296
- * Returning `undefined` means "module unavailable" — resolution then falls
297
- * back to authored USD inputs alone.
298
- */
299
- type MdlModuleProvider = (assetPath: string) => MdlModule | undefined;
300
- /** Parse the `export material` declarations of an `.mdl` module's source text. */
301
- declare function parseMdl(text: string): MdlModule;
302
- /**
303
- * Evaluate one MDL literal expression, or `undefined` for anything beyond the
304
- * supported literal subset (identifiers, arithmetic, function calls, …).
305
- */
306
- declare function parseMdlLiteral(src: string): MdlValue | undefined;
307
-
308
251
  /**
309
252
  * Prefetches and parses the `.mdl` modules referenced by a stage's MDL shaders.
310
253
  *
@@ -675,4 +618,4 @@ declare function getJointStatePosition(prim: Prim, kind: "angular" | "linear"):
675
618
  /** Read `UsdPhysicsMassAPI` properties, or `undefined` when none are authored (M16). */
676
619
  declare function getMassProperties(prim: Prim): LinkInertialDescription | undefined;
677
620
 
678
- export { ARTICULATION_ROOT_API, AssetResolver, Axis, COLLISION_API, type CollisionApproximation, type ComposeOptions, CrateReader, type ExportMaterial, type ExportMesh, type ExportPhysicsMaterial, type ExportRobotOptions, type ExtractOptions, type JointDofInput, type JointRelativeDecomposition, JointType, LinkDescription, LinkInertialDescription, MASS_API, MESH_COLLISION_API, Mat4, type MdlMaterialDecl, type MdlModule, type MdlModuleProvider, type MdlTextureValue, type MdlValue, PACKAGE_NAME, PHYSICS_MATERIAL_API, ParseError, Prim, RIGID_BODY_API, type ResolvedXform, RobotDescription, type RobotGeometryProvider, SdfPath, Stage, type TextureChannel, TokenizeError, UsdValue, UsdaFile, type UsdzPackage, VERSION, type ValidateRobotOptions, type ValidationIssue, type ValidationSeverity, Vec2, Vec3, collectMdlAssetPaths, composeFile, composeLayer, computeLocalTransform, computeWorldTransform, crateToUsdaFile, decomposeJointRelative, driveKindFor, exportRobotUsda, extractRobotDescription, gatherGprimDescendants, gatherMeshDescendants, getJointAxis, getJointBodies, getJointDrive, getJointLimits, getJointLocalFrame, getJointStatePosition, getJointType, getMassProperties, hasArticulationRootAPI, hasCollisionAPI, hasRigidBodyAPI, isBasisCurves, isMdlTexture, isMesh, isPoints, isRenderableGprim, isScope, isSolidGprim, isUnsupportedGprim, isXform, isZip, iterDescendants, jointValueFromSI, jointValueToSI, loadMdlModules, nearestAngleBranch, normalizeJointLimits, openUsdz, parseMdl, parseMdlLiteral, parseOpType, parseUsda, refineJointType, serializeUsda, stageGeometryProvider, tokenize, validateRobotDescription, writeUsdz };
621
+ export { ARTICULATION_ROOT_API, AssetResolver, Axis, COLLISION_API, type CollisionApproximation, type ComposeOptions, CrateReader, type ExportMaterial, type ExportMesh, type ExportPhysicsMaterial, type ExportRobotOptions, type ExtractOptions, type JointDofInput, type JointRelativeDecomposition, JointType, LinkDescription, LinkInertialDescription, MASS_API, MESH_COLLISION_API, Mat4, MdlModuleProvider, PACKAGE_NAME, PHYSICS_MATERIAL_API, ParseError, Prim, RIGID_BODY_API, type ResolvedXform, RobotDescription, type RobotGeometryProvider, SdfPath, Stage, type TextureChannel, TokenizeError, UsdValue, UsdaFile, type UsdzPackage, VERSION, type ValidateRobotOptions, type ValidationIssue, type ValidationSeverity, Vec2, Vec3, collectMdlAssetPaths, composeFile, composeLayer, computeLocalTransform, computeWorldTransform, crateToUsdaFile, decomposeJointRelative, driveKindFor, exportRobotUsda, extractRobotDescription, gatherGprimDescendants, gatherMeshDescendants, getJointAxis, getJointBodies, getJointDrive, getJointLimits, getJointLocalFrame, getJointStatePosition, getJointType, getMassProperties, hasArticulationRootAPI, hasCollisionAPI, hasRigidBodyAPI, isBasisCurves, isMesh, isPoints, isRenderableGprim, isScope, isSolidGprim, isUnsupportedGprim, isXform, isZip, iterDescendants, jointValueFromSI, jointValueToSI, loadMdlModules, nearestAngleBranch, normalizeJointLimits, openUsdz, parseOpType, parseUsda, refineJointType, serializeUsda, stageGeometryProvider, tokenize, validateRobotDescription, writeUsdz };
package/dist/core.js CHANGED
@@ -1,5 +1,7 @@
1
- export { PACKAGE_NAME, VERSION, exportRobotUsda, stageGeometryProvider, validateRobotDescription, writeUsdz } from './chunk-BCRRXGNB.js';
2
- export { ARTICULATION_ROOT_API, Attribute, COLLISION_API, CrateReader, DEFAULT_METERS_PER_UNIT, DefaultAssetResolver, Layer, MASS_API, MESH_COLLISION_API, PHYSICS_MATERIAL_API, ParseError, Prim, RIGID_BODY_API, Relationship, Stage, TokenizeError, buildKinematicTree, collectMdlAssetPaths, composeFile, composeLayer, computeLocalTransform, computeWorldTransform, crateToUsdaFile, createMemoryResolver, driveKindFor, extractRobotDescription, gatherGprimDescendants, gatherMeshDescendants, getJointAxis, getJointBodies, getJointDrive, getJointLimits, getJointLocalFrame, getJointStatePosition, getJointType, getMassProperties, hasArticulationRootAPI, hasCollisionAPI, hasRigidBodyAPI, isBasisCurves, isMdlTexture, isMesh, isPoints, isRenderableGprim, isScope, isSolidGprim, isUnsupportedGprim, isXform, isZip, iterDescendants, joinPosix, jointValueFromSI, jointValueToSI, loadMdlModules, normalizeJointLimits, openUsdz, parseMdl, parseMdlLiteral, parseOpType, parseUsda, refineJointType, serializeUsda, toBytes, tokenize } from './chunk-AXPMXEQC.js';
3
- export { AssetPath, DEG2RAD, Quat, RAD2DEG, UsdMatrix, channelFromSamples, decomposeJointRelative, decomposeRigid, fromUsdMatrix, getTranslation, identity4, interpolate, invert, makeEuler, makeRotationFromQuat, makeRotationX, makeRotationY, makeRotationZ, makeScale, makeTranslation, multiply, multiplyAll, nearestAngleBranch, toUsdMatrix } from './chunk-LDO5FKQS.js';
1
+ export { PACKAGE_NAME, VERSION, exportRobotUsda, stageGeometryProvider, validateRobotDescription, writeUsdz } from './chunk-CK5MTMYR.js';
2
+ export { ARTICULATION_ROOT_API, Attribute, COLLISION_API, CrateReader, DEFAULT_METERS_PER_UNIT, Layer, MASS_API, MESH_COLLISION_API, PHYSICS_MATERIAL_API, ParseError, Prim, RIGID_BODY_API, Relationship, Stage, TokenizeError, buildKinematicTree, collectMdlAssetPaths, composeFile, composeLayer, computeLocalTransform, computeWorldTransform, crateToUsdaFile, driveKindFor, extractRobotDescription, gatherGprimDescendants, gatherMeshDescendants, getJointAxis, getJointBodies, getJointDrive, getJointLimits, getJointLocalFrame, getJointStatePosition, getJointType, getMassProperties, hasArticulationRootAPI, hasCollisionAPI, hasRigidBodyAPI, isBasisCurves, isMesh, isPoints, isRenderableGprim, isScope, isSolidGprim, isUnsupportedGprim, isXform, isZip, iterDescendants, jointValueFromSI, jointValueToSI, loadMdlModules, normalizeJointLimits, openUsdz, parseOpType, parseUsda, refineJointType, serializeUsda, toBytes, tokenize } from './chunk-6W4LQVEQ.js';
3
+ export { DEG2RAD, RAD2DEG, channelFromSamples, decomposeJointRelative, decomposeRigid, fromUsdMatrix, getTranslation, identity4, interpolate, invert, makeEuler, makeRotationFromQuat, makeRotationX, makeRotationY, makeRotationZ, makeScale, makeTranslation, multiply, multiplyAll, nearestAngleBranch, toUsdMatrix } from './chunk-YGJ23CG3.js';
4
+ export { DefaultAssetResolver, createMemoryResolver, isMdlTexture, joinPosix, parseMdl, parseMdlLiteral } from './chunk-PPPRB6KE.js';
5
+ export { AssetPath, Quat, UsdMatrix } from './chunk-JGIVJXBU.js';
4
6
  //# sourceMappingURL=core.js.map
5
7
  //# sourceMappingURL=core.js.map
package/dist/extras.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { T as ThreeUsdRobot } from './ThreeUsdRobot-BxnCluuK.js';
1
+ import { T as ThreeUsdRobot } from './ThreeUsdRobot-C3N6-XBJ.js';
2
2
  import 'three';
3
- import './buildKinematicTree-BCySuZZn.js';
3
+ import './buildKinematicTree-iFqaw0Jl.js';
4
4
 
5
5
  /**
6
6
  * `three-usd-robot/extras`
package/dist/helpers.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as THREE from 'three';
2
- import { T as ThreeUsdRobot, J as JointObject } from './ThreeUsdRobot-BxnCluuK.js';
3
- import './buildKinematicTree-BCySuZZn.js';
2
+ import { T as ThreeUsdRobot, J as JointObject } from './ThreeUsdRobot-C3N6-XBJ.js';
3
+ import './buildKinematicTree-iFqaw0Jl.js';
4
4
 
5
5
  /**
6
6
  * Per-link appearance helpers: highlight (tint), material replacement, and
package/dist/helpers.js CHANGED
@@ -1,5 +1,6 @@
1
- import { ThreeUsdRobot } from './chunk-ENWFOYHU.js';
2
- import './chunk-LDO5FKQS.js';
1
+ import { ThreeUsdRobot } from './chunk-KYBHWDX5.js';
2
+ import './chunk-YGJ23CG3.js';
3
+ import './chunk-JGIVJXBU.js';
3
4
  import * as THREE3 from 'three';
4
5
 
5
6
  var savedMaterials = /* @__PURE__ */ new WeakMap();