fbxkit 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.
- fbxkit-0.1.0/.gitignore +33 -0
- fbxkit-0.1.0/CHANGELOG.md +68 -0
- fbxkit-0.1.0/LICENSE +21 -0
- fbxkit-0.1.0/PKG-INFO +861 -0
- fbxkit-0.1.0/README.md +812 -0
- fbxkit-0.1.0/examples/batch_cleanup.py +86 -0
- fbxkit-0.1.0/examples/custom_operation.py +118 -0
- fbxkit-0.1.0/pyproject.toml +104 -0
- fbxkit-0.1.0/src/fbxkit/__about__.py +7 -0
- fbxkit-0.1.0/src/fbxkit/__init__.py +210 -0
- fbxkit-0.1.0/src/fbxkit/__main__.py +8 -0
- fbxkit-0.1.0/src/fbxkit/builtin_ops.py +561 -0
- fbxkit-0.1.0/src/fbxkit/cli.py +429 -0
- fbxkit-0.1.0/src/fbxkit/document.py +448 -0
- fbxkit-0.1.0/src/fbxkit/errors.py +110 -0
- fbxkit-0.1.0/src/fbxkit/io.py +260 -0
- fbxkit-0.1.0/src/fbxkit/ops.py +231 -0
- fbxkit-0.1.0/src/fbxkit/params.py +239 -0
- fbxkit-0.1.0/src/fbxkit/patch.py +226 -0
- fbxkit-0.1.0/src/fbxkit/schema.py +316 -0
- fbxkit-0.1.0/src/fbxkit/selectors.py +337 -0
- fbxkit-0.1.0/src/fbxkit/serialize.py +143 -0
- fbxkit-0.1.0/src/fbxkit/session/__init__.py +51 -0
- fbxkit-0.1.0/src/fbxkit/session/base.py +233 -0
- fbxkit-0.1.0/src/fbxkit/session/fake.py +391 -0
- fbxkit-0.1.0/src/fbxkit/session/fbx.py +913 -0
- fbxkit-0.1.0/src/fbxkit/session/index.py +208 -0
- fbxkit-0.1.0/src/fbxkit/session/protocol.py +170 -0
- fbxkit-0.1.0/tests/conftest.py +40 -0
- fbxkit-0.1.0/tests/test_cli.py +169 -0
- fbxkit-0.1.0/tests/test_document.py +216 -0
- fbxkit-0.1.0/tests/test_index.py +125 -0
- fbxkit-0.1.0/tests/test_io.py +194 -0
- fbxkit-0.1.0/tests/test_layering.py +167 -0
- fbxkit-0.1.0/tests/test_operations.py +314 -0
- fbxkit-0.1.0/tests/test_packaging.py +130 -0
- fbxkit-0.1.0/tests/test_params.py +118 -0
- fbxkit-0.1.0/tests/test_patch.py +178 -0
- fbxkit-0.1.0/tests/test_selectors.py +136 -0
- fbxkit-0.1.0/tests/test_serialize.py +122 -0
fbxkit-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
build/
|
|
6
|
+
dist/
|
|
7
|
+
.eggs/
|
|
8
|
+
|
|
9
|
+
# Environments
|
|
10
|
+
.venv/
|
|
11
|
+
venv/
|
|
12
|
+
env/
|
|
13
|
+
|
|
14
|
+
# Tooling
|
|
15
|
+
.pytest_cache/
|
|
16
|
+
.ruff_cache/
|
|
17
|
+
.mypy_cache/
|
|
18
|
+
.coverage
|
|
19
|
+
htmlcov/
|
|
20
|
+
|
|
21
|
+
# Editors
|
|
22
|
+
.idea/
|
|
23
|
+
.vscode/
|
|
24
|
+
*.swp
|
|
25
|
+
|
|
26
|
+
# OS
|
|
27
|
+
.DS_Store
|
|
28
|
+
Thumbs.db
|
|
29
|
+
|
|
30
|
+
# Scratch output from the examples and the test scripts
|
|
31
|
+
*.fbx
|
|
32
|
+
!tests/data/*.fbx
|
|
33
|
+
.fbxkit-*
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
|
|
5
|
+
[semantic versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
Note that the **package version and the schema version move independently**.
|
|
8
|
+
`fbxkit.SCHEMA_VERSION` describes the shape of the documents and patches; pin
|
|
9
|
+
consumers to that rather than to the release.
|
|
10
|
+
|
|
11
|
+
## [0.1.0] - 2026-09-01
|
|
12
|
+
|
|
13
|
+
First release. Schema `0.1.0`.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `fbxkit.open()` / `new()` / `read()` / `patch_file()` -- the four entry points.
|
|
18
|
+
- **Selectors**: `|root|**[type=mesh]`, `**|*_L`, `[name~=regex]`, with `**`
|
|
19
|
+
spanning any depth and `#N` disambiguating duplicate sibling names.
|
|
20
|
+
- **Nine builtin operations**, deliberately few: `create_node`, `delete_node`,
|
|
21
|
+
`rename`, `reparent`, `set_property`, `add_property`, `remove_property`,
|
|
22
|
+
`set_transform`, `retarget_textures`. Each is something you can ask of any
|
|
23
|
+
FBX file. Scene settings are readable but not writable -- see below.
|
|
24
|
+
- **Patches as data**: a JSON file of operations that can be stored, reviewed,
|
|
25
|
+
validated without opening a scene, dry-run, and applied identically on a
|
|
26
|
+
workstation and on a server.
|
|
27
|
+
- **`FbxSession` / `FakeSession`** behind one protocol, so the whole package is
|
|
28
|
+
tested with no SDK installed.
|
|
29
|
+
- **A versioned document schema** with lossless round trips: fields written by a
|
|
30
|
+
newer fbxkit survive being read and rewritten by an older one.
|
|
31
|
+
- **`fbxkit` CLI**: `info`, `ls`, `read`, `apply`, `do`, `ops`, `validate`,
|
|
32
|
+
`demo`, `doctor`, with exit codes `0` / `1` / `2`.
|
|
33
|
+
- **`fbxkit doctor`** -- the Autodesk SDK is a required external dependency that
|
|
34
|
+
cannot be declared in `pyproject.toml` (not on PyPI, one wheel per CPython
|
|
35
|
+
minor version). `doctor` reports whether this interpreter has it, searches the
|
|
36
|
+
usual install locations, and prints the exact wheel path and `pip install`
|
|
37
|
+
line, or says why the wheel present is for a different Python.
|
|
38
|
+
- **A test corpus and the scripts that produce it**: `make_test_fbx.py` writes
|
|
39
|
+
16 FBX files covering every edge case below, with a `manifest.json` recording
|
|
40
|
+
what each pins down and what opening it actually did; `verify_testdata.py`
|
|
41
|
+
checks a directory against that manifest (bytes and behaviour);
|
|
42
|
+
`publish_testdata.py` publishes it to Subversion, idempotently.
|
|
43
|
+
- **`scripts/release.py`** -- builds and publishes to PyPI with the whole gate in
|
|
44
|
+
front of the upload, and refuses a version number that the index already has:
|
|
45
|
+
that is the one mistake here that cannot be undone.
|
|
46
|
+
|
|
47
|
+
### Notes on behaviour that came out of measurement
|
|
48
|
+
|
|
49
|
+
- Saves preserve the input's **format and FBX version** by default. The format
|
|
50
|
+
is sniffed from the file header because `FbxImporter.GetFileFormat()` reports
|
|
51
|
+
binary for ASCII files.
|
|
52
|
+
- Export version strings are checked against a whitelist because
|
|
53
|
+
`SetFileExportVersion()` returns `True` for versions that do not exist.
|
|
54
|
+
- Deletion is recursive by default: the SDK's non-recursive destroy leaves
|
|
55
|
+
children alive but unparented, and the exporter writes them back out.
|
|
56
|
+
- Writes are atomic -- a temporary file beside the target, moved into place. The
|
|
57
|
+
cost, taken deliberately: the exporter stamps the path it was given into the
|
|
58
|
+
file as `DocumentUrl`, and that cannot be overridden, so the temporary name is
|
|
59
|
+
what gets recorded. It is derived from the target to stay recognisable.
|
|
60
|
+
- A failed patch is not saved, so a file is either fully patched or untouched.
|
|
61
|
+
- A file that opens with **zero nodes** is flagged: a truncated ASCII FBX imports
|
|
62
|
+
without complaint and yields an empty scene, so "empty" and "damaged" are
|
|
63
|
+
otherwise indistinguishable.
|
|
64
|
+
- FBX export is **not reproducible** -- the header carries a creation timestamp
|
|
65
|
+
and the document path, so saving the same scene twice gives different bytes.
|
|
66
|
+
- Scene settings are readable but **not writable**. Changing the declared axis or
|
|
67
|
+
unit without re-transforming the geometry is half a conversion, and an MVP
|
|
68
|
+
should not ship the half that silently misplaces assets.
|
fbxkit-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 narutozb
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|