weft-usd 0.1.0__tar.gz

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 (91) hide show
  1. weft_usd-0.1.0/LICENSE +201 -0
  2. weft_usd-0.1.0/NOTICE +7 -0
  3. weft_usd-0.1.0/PKG-INFO +238 -0
  4. weft_usd-0.1.0/README.md +208 -0
  5. weft_usd-0.1.0/absent/__init__.py +22 -0
  6. weft_usd-0.1.0/absent/__main__.py +98 -0
  7. weft_usd-0.1.0/absent/detect.py +357 -0
  8. weft_usd-0.1.0/deps/__init__.py +19 -0
  9. weft_usd-0.1.0/deps/__main__.py +358 -0
  10. weft_usd-0.1.0/deps/graph.py +388 -0
  11. weft_usd-0.1.0/deps/walk.py +216 -0
  12. weft_usd-0.1.0/pyproject.toml +56 -0
  13. weft_usd-0.1.0/setup.cfg +4 -0
  14. weft_usd-0.1.0/tests/test_absent.py +419 -0
  15. weft_usd-0.1.0/tests/test_alab_pull.py +159 -0
  16. weft_usd-0.1.0/tests/test_ask_grammar.py +53 -0
  17. weft_usd-0.1.0/tests/test_ask_resolve.py +308 -0
  18. weft_usd-0.1.0/tests/test_chunker.py +52 -0
  19. weft_usd-0.1.0/tests/test_cli_bare.py +26 -0
  20. weft_usd-0.1.0/tests/test_cli_pull.py +136 -0
  21. weft_usd-0.1.0/tests/test_compose.py +228 -0
  22. weft_usd-0.1.0/tests/test_compose_eval.py +130 -0
  23. weft_usd-0.1.0/tests/test_contracts.py +120 -0
  24. weft_usd-0.1.0/tests/test_correctness.py +281 -0
  25. weft_usd-0.1.0/tests/test_data.py +176 -0
  26. weft_usd-0.1.0/tests/test_deps.py +625 -0
  27. weft_usd-0.1.0/tests/test_derive_real.py +181 -0
  28. weft_usd-0.1.0/tests/test_drift.py +307 -0
  29. weft_usd-0.1.0/tests/test_extract.py +395 -0
  30. weft_usd-0.1.0/tests/test_extractors.py +42 -0
  31. weft_usd-0.1.0/tests/test_follow.py +43 -0
  32. weft_usd-0.1.0/tests/test_generators.py +73 -0
  33. weft_usd-0.1.0/tests/test_kept.py +153 -0
  34. weft_usd-0.1.0/tests/test_kinds.py +292 -0
  35. weft_usd-0.1.0/tests/test_ledger.py +162 -0
  36. weft_usd-0.1.0/tests/test_loom.py +300 -0
  37. weft_usd-0.1.0/tests/test_manifest.py +106 -0
  38. weft_usd-0.1.0/tests/test_pull.py +202 -0
  39. weft_usd-0.1.0/tests/test_pull_soundness.py +160 -0
  40. weft_usd-0.1.0/tests/test_pull_worlds.py +173 -0
  41. weft_usd-0.1.0/tests/test_pullcache.py +85 -0
  42. weft_usd-0.1.0/tests/test_pxr.py +137 -0
  43. weft_usd-0.1.0/tests/test_query.py +172 -0
  44. weft_usd-0.1.0/tests/test_reeval.py +195 -0
  45. weft_usd-0.1.0/tests/test_rels.py +48 -0
  46. weft_usd-0.1.0/tests/test_slice.py +166 -0
  47. weft_usd-0.1.0/tests/test_slice_prim.py +217 -0
  48. weft_usd-0.1.0/tests/test_slice_references.py +135 -0
  49. weft_usd-0.1.0/tests/test_slice_rules.py +188 -0
  50. weft_usd-0.1.0/tests/test_store.py +86 -0
  51. weft_usd-0.1.0/tests/test_threadgraph.py +350 -0
  52. weft_usd-0.1.0/tests/test_usda.py +84 -0
  53. weft_usd-0.1.0/tests/test_usdview_core.py +420 -0
  54. weft_usd-0.1.0/tests/test_walk_completeness.py +81 -0
  55. weft_usd-0.1.0/weft/__init__.py +11 -0
  56. weft_usd-0.1.0/weft/__main__.py +4 -0
  57. weft_usd-0.1.0/weft/ask.py +334 -0
  58. weft_usd-0.1.0/weft/chunker.py +221 -0
  59. weft_usd-0.1.0/weft/cli.py +1362 -0
  60. weft_usd-0.1.0/weft/compose.py +174 -0
  61. weft_usd-0.1.0/weft/contracts.py +542 -0
  62. weft_usd-0.1.0/weft/data.py +259 -0
  63. weft_usd-0.1.0/weft/drift.py +473 -0
  64. weft_usd-0.1.0/weft/extract.py +566 -0
  65. weft_usd-0.1.0/weft/follow.py +66 -0
  66. weft_usd-0.1.0/weft/generators/__init__.py +240 -0
  67. weft_usd-0.1.0/weft/generators/vehicle.py +135 -0
  68. weft_usd-0.1.0/weft/kept.py +135 -0
  69. weft_usd-0.1.0/weft/kinds.py +400 -0
  70. weft_usd-0.1.0/weft/ledger.py +693 -0
  71. weft_usd-0.1.0/weft/loom/__init__.py +11 -0
  72. weft_usd-0.1.0/weft/loom/app.html +551 -0
  73. weft_usd-0.1.0/weft/loom/server.py +446 -0
  74. weft_usd-0.1.0/weft/loom/viewer_template.html +1222 -0
  75. weft_usd-0.1.0/weft/manifest.py +164 -0
  76. weft_usd-0.1.0/weft/pull.py +580 -0
  77. weft_usd-0.1.0/weft/pullcache.py +133 -0
  78. weft_usd-0.1.0/weft/query.py +245 -0
  79. weft_usd-0.1.0/weft/reeval.py +220 -0
  80. weft_usd-0.1.0/weft/registry.py +74 -0
  81. weft_usd-0.1.0/weft/relkinds.py +447 -0
  82. weft_usd-0.1.0/weft/slice.py +845 -0
  83. weft_usd-0.1.0/weft/store.py +330 -0
  84. weft_usd-0.1.0/weft/threadgraph.py +117 -0
  85. weft_usd-0.1.0/weft/usda.py +332 -0
  86. weft_usd-0.1.0/weft_usd.egg-info/PKG-INFO +238 -0
  87. weft_usd-0.1.0/weft_usd.egg-info/SOURCES.txt +89 -0
  88. weft_usd-0.1.0/weft_usd.egg-info/dependency_links.txt +1 -0
  89. weft_usd-0.1.0/weft_usd.egg-info/entry_points.txt +3 -0
  90. weft_usd-0.1.0/weft_usd.egg-info/requires.txt +12 -0
  91. weft_usd-0.1.0/weft_usd.egg-info/top_level.txt +3 -0
weft_usd-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or Derivative
95
+ Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Ashraf Ghoniem
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
weft_usd-0.1.0/NOTICE ADDED
@@ -0,0 +1,7 @@
1
+ weft
2
+ Copyright 2026 Ashraf Ghoniem
3
+
4
+ This product includes software developed as the weft project
5
+ (https://github.com/distancetozero/weft).
6
+
7
+ Licensed under the Apache License, Version 2.0 (see LICENSE).
@@ -0,0 +1,238 @@
1
+ Metadata-Version: 2.4
2
+ Name: weft-usd
3
+ Version: 0.1.0
4
+ Summary: weft: see a USD stage as data -- derive relationships, query surgically, certify slices. Pull the thread, not the world.
5
+ Author: Ashraf Ghoniem
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/distancetozero/weft
8
+ Project-URL: Repository, https://github.com/distancetozero/weft
9
+ Project-URL: Issues, https://github.com/distancetozero/weft/issues
10
+ Keywords: usd,openusd,pixar,3d,vfx,scene-description,data,aousd
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
16
+ Requires-Python: >=3.9
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ License-File: NOTICE
20
+ Provides-Extra: fast
21
+ Requires-Dist: numpy>=1.24; extra == "fast"
22
+ Provides-Extra: usd
23
+ Requires-Dist: usd-core>=24.0; extra == "usd"
24
+ Provides-Extra: dev
25
+ Requires-Dist: numpy>=1.24; extra == "dev"
26
+ Requires-Dist: usd-core>=24.0; extra == "dev"
27
+ Requires-Dist: pytest>=7; extra == "dev"
28
+ Requires-Dist: jinja2>=3; extra == "dev"
29
+ Dynamic: license-file
30
+
31
+ # weft
32
+
33
+ Pull the thread, not the world.
34
+
35
+ ```sh
36
+ pip install "weft-usd[usd]" # once published; until then, from a clone:
37
+ pip install -e ".[usd]" # [usd] pulls usd-core; the core runs dep-free
38
+
39
+ weft rels myscene.usda # what relationships are in here, natively?
40
+ weft data myscene.usda # the whole stage as a table, nothing loaded
41
+ weft pull 'material:…' --context myscene.usda --follow material:binding:full
42
+ ```
43
+
44
+ Opening a USD stage means loading everything and drilling down. weft
45
+ inverts that: stand at any point — a name, an identity, an attribute, a
46
+ place — and pull the threads you care about. A thread is any relationship:
47
+ a material binding, a mount contract, `electrical:feeds`, or a kind your
48
+ team defines. Hierarchy is just one thread on the spool.
49
+
50
+ ```
51
+ $ weft pull 'where:finish=translucent' --context lab.usda --mask-out pull.mask
52
+ $ usdrecord --mask "$(tr '\n' ',' < pull.mask)" lab.usda out.png
53
+ ```
54
+
55
+ Twenty-six pieces of glassware render, floating at their exact production
56
+ transforms, from a scene that was never loaded. No path appeared in the
57
+ question. Run as written against [Animal Logic's
58
+ ALab](https://dpel.aswf.io/alab/) — real production geometry, not a
59
+ fixture — in [`examples/alab/README.md`](examples/alab/README.md#pulling-at-prim-level).
60
+
61
+ ## Addresses
62
+
63
+ ```
64
+ weft pull id:hero-car # identity — no path, survives restructures
65
+ weft pull id:occ:weld-47 # one placement, restructure-proof
66
+ weft pull role:propSocket # by contract role
67
+ weft pull 'where:finish=translucent' # by attribute
68
+ weft pull 'near:id:rack-R42,5' # within 5 units of a thing, by name
69
+ weft pull bottle01 --follow up:electrical:feeds*8 # trace upstream, 8 hops
70
+ weft pull path:/root/shelf01/bottle_0004 # location — the fallback, not the default
71
+ ```
72
+
73
+ Three rules keep pulls trustworthy:
74
+
75
+ - **What you didn't pull is declared, never silently absent** — every
76
+ boundary is counted by kind, and omissions are classed *inert* (a grey
77
+ material) or *meaning-changing* (a physics joint that would silently
78
+ re-anchor to the world).
79
+ - **Every answer carries a receipt** — seeds, follow rules, cost, and a
80
+ digest; a pull is verifiable by recompute-and-compare.
81
+ - **Compatibility is measured, not asserted** — a republish is checked
82
+ against every consumer's own declared tolerance, not just the provider's
83
+ promise.
84
+
85
+ ## USD as data
86
+
87
+ Point weft at a stage you didn't build and *see it as data* — no authoring, no
88
+ schema changes, no load:
89
+
90
+ ```
91
+ weft rels shot.usda # the native relationship kinds, with counts
92
+ weft data shot.usda # prims x columns: type, bbox, centroid, ...
93
+ weft data shot.usda --select 'where:bbox_volume>1e6' --load \
94
+ --columns point_count,poly_count,byte_cost
95
+ ```
96
+
97
+ Most of that data is **derived, not authored** — weft reads what USD already
98
+ encodes: hierarchy, `UsdCollectionAPI`, and material bindings resolved per
99
+ *purpose* (`full`/`preview`) and inheritance. On ALab that surfaces ~13,600
100
+ material relationships and 114 collections for free. Relationships authored
101
+ anywhere — a native `rel electrical:feeds`, a `UsdPhysics` joint, your team's
102
+ own — are followed (`--follow`), sliced, and certified with **no declaration**;
103
+ weft consumes what your DCC authored rather than asking you to author again. A
104
+ `weft__kinds` block is an optional annotation (a lens, an omission class), not a
105
+ place relationships get made.
106
+
107
+ ## Runs on any USD file, today
108
+
109
+ No server, no schema changes, no buy-in:
110
+
111
+ ```
112
+ $ weft pull 'chemistry_bottle01*' --context shot.usda --follow Mount
113
+ $ weft who 'name:glass' --context shot.usda # what depends on this prim?
114
+ $ python -m deps breaks ./assets hub.usda # what breaks if I republish?
115
+ $ python -m absent shot.usda # what silently resolves to nothing?
116
+ ```
117
+
118
+ `deps` sees edges no stock USD API reports (bindings, connections, class
119
+ arcs) and answers the reverse question USD can't. `absent` finds the
120
+ silences USD ships with — stale overrides, bindings to deactivated
121
+ materials — that none of its 28 validators catch.
122
+
123
+ ## usdview plugin
124
+
125
+ The same `pull`/`who` reasoning, live in the viewer: a "Weft" menu adds
126
+ **Ask…** (resolve a seed against the open stage and select the results),
127
+ **Solo threads** (pull the current selection's threads and deactivate
128
+ everything outside the mask — a *view solo*, not a population mask), **Restore
129
+ world** (undo it), and **Who depends on this?** (incoming edges onto the
130
+ selection, browsable by depth). A docked receipt panel shows the last pull's
131
+ resolutions, members, and boundary, with buttons to copy the member mask or
132
+ save a full manifest.
133
+
134
+ ```
135
+ $ export PXR_PLUGINPATH_NAME=/path/to/weft/extras/usdview:$PXR_PLUGINPATH_NAME
136
+ $ export PYTHONPATH=/path/to/weft/extras/usdview:/path/to/weft:$PYTHONPATH
137
+ $ usdview shot.usda
138
+ ```
139
+
140
+ Both `PXR_PLUGINPATH_NAME` (so libplug finds `extras/usdview/plugInfo.json`)
141
+ and `PYTHONPATH` (so `import weftViewer` — its declared module name —
142
+ resolves) need `extras/usdview` itself, since the plugin's `__init__.py`
143
+ lives one level inside it, in `extras/usdview/weftViewer/`; `PYTHONPATH`
144
+ additionally needs the weft repo root, since the plugin imports `weft.ask`
145
+ and `weft.pull` directly against the live stage. Code, not memory: a python
146
+ usdview plugin is loaded with a plain `import <Name>` off `PYTHONPATH`
147
+ (`pxr/base/plug/plugin.cpp`, `PlugPlugin::_Load()`), so `plugInfo.json`'s own
148
+ directory plays no part in the import — only in libplug's discovery of the
149
+ JSON file itself, via `PXR_PLUGINPATH_NAME`
150
+ (`pxr/usdImaging/usdviewq/plugin.py`'s `loadPlugins()`).
151
+
152
+ ## The engine
153
+
154
+ For teams that want ground truth, not just queries: a content-addressed
155
+ store, immutable revisions, channels, and baselines — with a promotion gate
156
+ that re-evaluates consumers.
157
+
158
+ Proven on [Animal Logic's ALab](https://dpel.aswf.io/alab/) (437 real
159
+ placements, contracts derived, not hand-written): a shelf moved 0.7 cm
160
+ passes the provider's 1 cm promise and is **refused by 19 consumers** whose
161
+ own tolerances are tighter — each named, with what it tolerates. Seeding one
162
+ bottle with `--follow Mount` pulls 2 assets instead of 165; the other 163
163
+ threads are declared at the boundary.
164
+
165
+ ```
166
+ $ weft save car car.usda -m "first pass" # immutable, deduped
167
+ $ weft promote car v002 --to approved # gated: measured compatibility
168
+ $ weft select 'chassis*' --follow Mount # a slice, priced before loading
169
+ ```
170
+
171
+ Teams share *ways of seeing* as versioned content: rule sets (which threads
172
+ to follow), edge extractors (your soft-reference conventions become real
173
+ edges), and omission classes — the vocabulary is yours; the machinery
174
+ stays fixed.
175
+
176
+ ## Measured
177
+
178
+ All from real runs, not projections:
179
+
180
+ - Seeding one bottle pulls 2 assets instead of 165 — the other 163 are
181
+ declared at the boundary, not silently dropped.
182
+ - The translucent pull's 26-placement mask is asserted byte-identical to a
183
+ hand-built reference in the acceptance suite.
184
+ - A 0.7 cm republish, inside the provider's own 1 cm promise, is refused by
185
+ 19 consumers — each named, with its own tolerance.
186
+ - 4,296 production layers walked in 1.75 s (23 ms incremental).
187
+ - The whole scene is addressable in ~126 ms without loading it.
188
+ - 25× storage dedup at 64 KiB chunks.
189
+
190
+ And on ALab opened whole (47,401 composed prims, 14.5 M points), from
191
+ [`docs/superpowers/specs/2026-10-05-alab-benchmarks.md`](docs/superpowers/specs/2026-10-05-alab-benchmarks.md):
192
+
193
+ - Pulling one asset vs. loading everything: **0.9 % of the prims, 0.25 % of the
194
+ geometry — ~3× faster, ~2× lighter.** The win scales with slice size and
195
+ crosses to a loss near ~99 %, exactly where it should.
196
+ - Query the whole scene as a table in **0.15 s, 125 MB, zero geometry loaded.**
197
+ - A repeated pull of an unchanged context is cached: **0.11 s → 0.003 s (~77×).**
198
+
199
+ ## Status
200
+
201
+ A working prototype, tested against real production USD (365 tests, CI on a
202
+ no-deps "bare" env and a full `usd-core` env), with no outside users yet. The
203
+ design docs came first; where measurement disagreed with design, the docs
204
+ record the correction — see `docs/superpowers/specs/` for the full design trail,
205
+ including an adversarial review that scoped weft to **consuming and certifying**
206
+ USD rather than authoring it. The core runs with zero dependencies; `usd-core`
207
+ unlocks the USD-facing tools. Apache-2.0; contributions welcome.
208
+
209
+ ## Reading
210
+
211
+ [`docs/index.html`](docs/index.html) is the single-page design brief.
212
+ The rest, in reading order:
213
+
214
+ | | |
215
+ |---|---|
216
+ | [`docs/01-overview.md`](docs/01-overview.md) | thesis and cross-industry mapping |
217
+ | [`docs/02-architecture.md`](docs/02-architecture.md) | the resolution layer and USD integration points |
218
+ | [`docs/03-versioning.md`](docs/03-versioning.md) | revisions, channels, baselines |
219
+ | [`docs/04-contracts.md`](docs/04-contracts.md) | generators, archetypes, tolerances |
220
+ | [`docs/05-contexts.md`](docs/05-contexts.md) | claims and approval |
221
+ | [`docs/06-storage.md`](docs/06-storage.md) | stores, layout, Merkle hierarchy |
222
+ | [`docs/07-adoption.md`](docs/07-adoption.md) | the rung ladder; comparisons to USD / Omniverse / Fabric |
223
+ | [`docs/09-usd-audit.md`](docs/09-usd-audit.md) | what USD already holds, what is genuinely absent |
224
+ | [`docs/08-open-questions.md`](docs/08-open-questions.md) | what is still undecided |
225
+ | [`docs/10-slices.md`](docs/10-slices.md) | the slice interaction model |
226
+ | [`specs/weftContracts/schema.usda`](specs/weftContracts/schema.usda) | codeless API schemas for the contract archetypes |
227
+
228
+ The design documents predate the rename and say "JIT-SD" throughout — same
229
+ project.
230
+
231
+ ## Commitments
232
+
233
+ - Versions are acts of intent; the only mutable thing is a channel pointer.
234
+ - Couple to contracts, not names — prim paths are an output, not a
235
+ precondition.
236
+ - Identity is metadata, never an address. Time is an index, never an
237
+ address.
238
+ - Every rung works solo and offline; no rung requires a higher one.
@@ -0,0 +1,208 @@
1
+ # weft
2
+
3
+ Pull the thread, not the world.
4
+
5
+ ```sh
6
+ pip install "weft-usd[usd]" # once published; until then, from a clone:
7
+ pip install -e ".[usd]" # [usd] pulls usd-core; the core runs dep-free
8
+
9
+ weft rels myscene.usda # what relationships are in here, natively?
10
+ weft data myscene.usda # the whole stage as a table, nothing loaded
11
+ weft pull 'material:…' --context myscene.usda --follow material:binding:full
12
+ ```
13
+
14
+ Opening a USD stage means loading everything and drilling down. weft
15
+ inverts that: stand at any point — a name, an identity, an attribute, a
16
+ place — and pull the threads you care about. A thread is any relationship:
17
+ a material binding, a mount contract, `electrical:feeds`, or a kind your
18
+ team defines. Hierarchy is just one thread on the spool.
19
+
20
+ ```
21
+ $ weft pull 'where:finish=translucent' --context lab.usda --mask-out pull.mask
22
+ $ usdrecord --mask "$(tr '\n' ',' < pull.mask)" lab.usda out.png
23
+ ```
24
+
25
+ Twenty-six pieces of glassware render, floating at their exact production
26
+ transforms, from a scene that was never loaded. No path appeared in the
27
+ question. Run as written against [Animal Logic's
28
+ ALab](https://dpel.aswf.io/alab/) — real production geometry, not a
29
+ fixture — in [`examples/alab/README.md`](examples/alab/README.md#pulling-at-prim-level).
30
+
31
+ ## Addresses
32
+
33
+ ```
34
+ weft pull id:hero-car # identity — no path, survives restructures
35
+ weft pull id:occ:weld-47 # one placement, restructure-proof
36
+ weft pull role:propSocket # by contract role
37
+ weft pull 'where:finish=translucent' # by attribute
38
+ weft pull 'near:id:rack-R42,5' # within 5 units of a thing, by name
39
+ weft pull bottle01 --follow up:electrical:feeds*8 # trace upstream, 8 hops
40
+ weft pull path:/root/shelf01/bottle_0004 # location — the fallback, not the default
41
+ ```
42
+
43
+ Three rules keep pulls trustworthy:
44
+
45
+ - **What you didn't pull is declared, never silently absent** — every
46
+ boundary is counted by kind, and omissions are classed *inert* (a grey
47
+ material) or *meaning-changing* (a physics joint that would silently
48
+ re-anchor to the world).
49
+ - **Every answer carries a receipt** — seeds, follow rules, cost, and a
50
+ digest; a pull is verifiable by recompute-and-compare.
51
+ - **Compatibility is measured, not asserted** — a republish is checked
52
+ against every consumer's own declared tolerance, not just the provider's
53
+ promise.
54
+
55
+ ## USD as data
56
+
57
+ Point weft at a stage you didn't build and *see it as data* — no authoring, no
58
+ schema changes, no load:
59
+
60
+ ```
61
+ weft rels shot.usda # the native relationship kinds, with counts
62
+ weft data shot.usda # prims x columns: type, bbox, centroid, ...
63
+ weft data shot.usda --select 'where:bbox_volume>1e6' --load \
64
+ --columns point_count,poly_count,byte_cost
65
+ ```
66
+
67
+ Most of that data is **derived, not authored** — weft reads what USD already
68
+ encodes: hierarchy, `UsdCollectionAPI`, and material bindings resolved per
69
+ *purpose* (`full`/`preview`) and inheritance. On ALab that surfaces ~13,600
70
+ material relationships and 114 collections for free. Relationships authored
71
+ anywhere — a native `rel electrical:feeds`, a `UsdPhysics` joint, your team's
72
+ own — are followed (`--follow`), sliced, and certified with **no declaration**;
73
+ weft consumes what your DCC authored rather than asking you to author again. A
74
+ `weft__kinds` block is an optional annotation (a lens, an omission class), not a
75
+ place relationships get made.
76
+
77
+ ## Runs on any USD file, today
78
+
79
+ No server, no schema changes, no buy-in:
80
+
81
+ ```
82
+ $ weft pull 'chemistry_bottle01*' --context shot.usda --follow Mount
83
+ $ weft who 'name:glass' --context shot.usda # what depends on this prim?
84
+ $ python -m deps breaks ./assets hub.usda # what breaks if I republish?
85
+ $ python -m absent shot.usda # what silently resolves to nothing?
86
+ ```
87
+
88
+ `deps` sees edges no stock USD API reports (bindings, connections, class
89
+ arcs) and answers the reverse question USD can't. `absent` finds the
90
+ silences USD ships with — stale overrides, bindings to deactivated
91
+ materials — that none of its 28 validators catch.
92
+
93
+ ## usdview plugin
94
+
95
+ The same `pull`/`who` reasoning, live in the viewer: a "Weft" menu adds
96
+ **Ask…** (resolve a seed against the open stage and select the results),
97
+ **Solo threads** (pull the current selection's threads and deactivate
98
+ everything outside the mask — a *view solo*, not a population mask), **Restore
99
+ world** (undo it), and **Who depends on this?** (incoming edges onto the
100
+ selection, browsable by depth). A docked receipt panel shows the last pull's
101
+ resolutions, members, and boundary, with buttons to copy the member mask or
102
+ save a full manifest.
103
+
104
+ ```
105
+ $ export PXR_PLUGINPATH_NAME=/path/to/weft/extras/usdview:$PXR_PLUGINPATH_NAME
106
+ $ export PYTHONPATH=/path/to/weft/extras/usdview:/path/to/weft:$PYTHONPATH
107
+ $ usdview shot.usda
108
+ ```
109
+
110
+ Both `PXR_PLUGINPATH_NAME` (so libplug finds `extras/usdview/plugInfo.json`)
111
+ and `PYTHONPATH` (so `import weftViewer` — its declared module name —
112
+ resolves) need `extras/usdview` itself, since the plugin's `__init__.py`
113
+ lives one level inside it, in `extras/usdview/weftViewer/`; `PYTHONPATH`
114
+ additionally needs the weft repo root, since the plugin imports `weft.ask`
115
+ and `weft.pull` directly against the live stage. Code, not memory: a python
116
+ usdview plugin is loaded with a plain `import <Name>` off `PYTHONPATH`
117
+ (`pxr/base/plug/plugin.cpp`, `PlugPlugin::_Load()`), so `plugInfo.json`'s own
118
+ directory plays no part in the import — only in libplug's discovery of the
119
+ JSON file itself, via `PXR_PLUGINPATH_NAME`
120
+ (`pxr/usdImaging/usdviewq/plugin.py`'s `loadPlugins()`).
121
+
122
+ ## The engine
123
+
124
+ For teams that want ground truth, not just queries: a content-addressed
125
+ store, immutable revisions, channels, and baselines — with a promotion gate
126
+ that re-evaluates consumers.
127
+
128
+ Proven on [Animal Logic's ALab](https://dpel.aswf.io/alab/) (437 real
129
+ placements, contracts derived, not hand-written): a shelf moved 0.7 cm
130
+ passes the provider's 1 cm promise and is **refused by 19 consumers** whose
131
+ own tolerances are tighter — each named, with what it tolerates. Seeding one
132
+ bottle with `--follow Mount` pulls 2 assets instead of 165; the other 163
133
+ threads are declared at the boundary.
134
+
135
+ ```
136
+ $ weft save car car.usda -m "first pass" # immutable, deduped
137
+ $ weft promote car v002 --to approved # gated: measured compatibility
138
+ $ weft select 'chassis*' --follow Mount # a slice, priced before loading
139
+ ```
140
+
141
+ Teams share *ways of seeing* as versioned content: rule sets (which threads
142
+ to follow), edge extractors (your soft-reference conventions become real
143
+ edges), and omission classes — the vocabulary is yours; the machinery
144
+ stays fixed.
145
+
146
+ ## Measured
147
+
148
+ All from real runs, not projections:
149
+
150
+ - Seeding one bottle pulls 2 assets instead of 165 — the other 163 are
151
+ declared at the boundary, not silently dropped.
152
+ - The translucent pull's 26-placement mask is asserted byte-identical to a
153
+ hand-built reference in the acceptance suite.
154
+ - A 0.7 cm republish, inside the provider's own 1 cm promise, is refused by
155
+ 19 consumers — each named, with its own tolerance.
156
+ - 4,296 production layers walked in 1.75 s (23 ms incremental).
157
+ - The whole scene is addressable in ~126 ms without loading it.
158
+ - 25× storage dedup at 64 KiB chunks.
159
+
160
+ And on ALab opened whole (47,401 composed prims, 14.5 M points), from
161
+ [`docs/superpowers/specs/2026-10-05-alab-benchmarks.md`](docs/superpowers/specs/2026-10-05-alab-benchmarks.md):
162
+
163
+ - Pulling one asset vs. loading everything: **0.9 % of the prims, 0.25 % of the
164
+ geometry — ~3× faster, ~2× lighter.** The win scales with slice size and
165
+ crosses to a loss near ~99 %, exactly where it should.
166
+ - Query the whole scene as a table in **0.15 s, 125 MB, zero geometry loaded.**
167
+ - A repeated pull of an unchanged context is cached: **0.11 s → 0.003 s (~77×).**
168
+
169
+ ## Status
170
+
171
+ A working prototype, tested against real production USD (365 tests, CI on a
172
+ no-deps "bare" env and a full `usd-core` env), with no outside users yet. The
173
+ design docs came first; where measurement disagreed with design, the docs
174
+ record the correction — see `docs/superpowers/specs/` for the full design trail,
175
+ including an adversarial review that scoped weft to **consuming and certifying**
176
+ USD rather than authoring it. The core runs with zero dependencies; `usd-core`
177
+ unlocks the USD-facing tools. Apache-2.0; contributions welcome.
178
+
179
+ ## Reading
180
+
181
+ [`docs/index.html`](docs/index.html) is the single-page design brief.
182
+ The rest, in reading order:
183
+
184
+ | | |
185
+ |---|---|
186
+ | [`docs/01-overview.md`](docs/01-overview.md) | thesis and cross-industry mapping |
187
+ | [`docs/02-architecture.md`](docs/02-architecture.md) | the resolution layer and USD integration points |
188
+ | [`docs/03-versioning.md`](docs/03-versioning.md) | revisions, channels, baselines |
189
+ | [`docs/04-contracts.md`](docs/04-contracts.md) | generators, archetypes, tolerances |
190
+ | [`docs/05-contexts.md`](docs/05-contexts.md) | claims and approval |
191
+ | [`docs/06-storage.md`](docs/06-storage.md) | stores, layout, Merkle hierarchy |
192
+ | [`docs/07-adoption.md`](docs/07-adoption.md) | the rung ladder; comparisons to USD / Omniverse / Fabric |
193
+ | [`docs/09-usd-audit.md`](docs/09-usd-audit.md) | what USD already holds, what is genuinely absent |
194
+ | [`docs/08-open-questions.md`](docs/08-open-questions.md) | what is still undecided |
195
+ | [`docs/10-slices.md`](docs/10-slices.md) | the slice interaction model |
196
+ | [`specs/weftContracts/schema.usda`](specs/weftContracts/schema.usda) | codeless API schemas for the contract archetypes |
197
+
198
+ The design documents predate the rename and say "JIT-SD" throughout — same
199
+ project.
200
+
201
+ ## Commitments
202
+
203
+ - Versions are acts of intent; the only mutable thing is a channel pointer.
204
+ - Couple to contracts, not names — prim paths are an output, not a
205
+ precondition.
206
+ - Identity is metadata, never an address. Time is an index, never an
207
+ address.
208
+ - Every rung works solo and offline; no rung requires a higher one.
@@ -0,0 +1,22 @@
1
+ """absent -- find what a USD stage refers to that is no longer there.
2
+
3
+ USD can tell you what is in a scene. This tells you what isn't, and why.
4
+ """
5
+
6
+ from .detect import ( # noqa: F401
7
+ ANCHOR_KEY,
8
+ AUTHORED_AGAINST_KEY,
9
+ DEAD,
10
+ MOVED,
11
+ UNKNOWN,
12
+ Finding,
13
+ Report,
14
+ anchor_index,
15
+ scan,
16
+ scan_file,
17
+ )
18
+
19
+ __all__ = [
20
+ "ANCHOR_KEY", "AUTHORED_AGAINST_KEY", "DEAD", "MOVED", "UNKNOWN",
21
+ "Finding", "Report", "anchor_index", "scan", "scan_file",
22
+ ]