Currently in testing stage. Does not work well.
Core part is deletegated to native module(ctinyusd.so)
W.I.P.
- Python 3.7 or later
- Python 3.10+ recommended
- For developping and testing, Python 3.8 or later is required.
- numpy
- For efficient Attribute data handling.
from_numpy
andto_numpy
method available whennumpy
is installed..
- pandas
- To support TimeSamples data efficiently(e.g. read/write to CSV, Excel)
- typeguard
- To do type check at runtime.
ctinyusdz
: Native C++ module of tinyusdz- Python binding on top of C binding of TinyUSDZ.
tinyusdz
: Python module. Wraps some functions ofctinyusdz
TinyUSDZ's Python binding approach is like numpy: Frontend is written in Python for better Python integration(type hints for lsp(Intellisense), debuggers, exceptions, ...), and calls native C modules as necessary.
- Linux
- x86-64
- aarch64
- Windows
- 64bit AMD64
- 32bit x86
- ARM64(not intensively tested, but should work)
- macOS
- arm64
- Intel
- T.B.W.
- pxrUSD compatible Python API?(
pxr_compat
folder)
$ python -m pip install tinyusdz
Back to tinyusdz's root directory, then
# Use `build` module(install it with `python -m pip install build`)
$ python -m build .
If you are working on TinyUSDZ Python module, Using setup.py
recommended.
# install dependencies
$ python -m pip install setuptools scikit-build cmake ninja
$ python setup.py build
# Then copy `./_skbuild/<arch>-<version>/cmake-install/tinyusdz/ctinyusdz.*.so/dll to `<tinyusdz>/python` folder.
When TinyUSDZ C API has been updated, need to re-genrerate <tinyusdz>/python/tinyusdz/ctinyusd.py
using ctypesgen https://github.com/ctypesgen/ctypesgen .
# if you do not install ctypesgen
$ python -m pip install ctypesgen
$ cd <tinyusdz>/python
$ sh gen-ctypes.sh
If you built ctinyusdz with ASAN enabled, use LD_PRELOAD
to load asan modules.
LD_PRELOAD=/path/to/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/14.0.0/lib/x86_64-unknown-linux-gnu/libclang_rt.asan.so python tutorial.py
Please see https://tobywf.com/2021/02/python-ext-asan/ for more infos.
Apache 2.0 license.
EoL.