Vladimír Vondruš
165416f73b
python: add code coverage markers for trade bindings.
...
Not desirable to test all possible types, and some unreachable parts are
indeed unreachable.
3 years ago
Vladimír Vondruš
526def5f45
python: parametrize AbstractImporter name helpers by return type.
...
For objects it'll be 64-bit IDs, not 32-bit.
3 years ago
Vladimír Vondruš
ee56f6f114
python: improve docs of trade.AbstractImporter APIs.
3 years ago
Vladimír Vondruš
b811592407
python: fix compatibility with pybind11 < 2.6.
3 years ago
Vladimír Vondruš
d95c60942b
python: implement handling for custom trade.MeshAttribute values.
...
So it's possible to create them, print them and get the custom ID back.
Will be also used for SceneField and other yet-to-be-exposed enums.
3 years ago
Vladimír Vondruš
a45fbb84da
python: handle Windows path insanities in the bindings directly.
...
Otherwise people wouldn't be able to conveniently use os.path, which is
an undesirable pain point. And do this for all currently exposed APIs,
not just the AbstractImporter that caused a problem.
This reverts commit 28497ec2ca .
3 years ago
Vladimír Vondruš
b3e24a11b4
python: reorder trade.MeshData APIs to have enum overloads first.
...
Because for some reason pybind11 on *some platforms* (or in some
configurations?) picks the integer overload even for enum arguments,
only because it's first in the overload set.
This is extremely brittle, but for now I don't know any better solution.
3 years ago
Vladimír Vondruš
d106fc09d7
python: direct access to trade.MeshData indices and attributes.
...
In concrete types. Yes. Well, some of them for now, I still need to
sleep on normalized and matrix types, how it makes the most sense to
expose those. Oh, and array attributes as well.
3 years ago
Vladimír Vondruš
211bd5f0a8
python: mutable access to trade.MeshData raw index/vertex data.
...
Not much useful on its own, but it's a prep for what comes next.
3 years ago
Vladimír Vondruš
cca2eaf659
python: expose all index/attribute property queries in trade.MeshData.
...
Except for the actual data access, that'll be done next. Also updated
the mesh test file with more useful contents.
3 years ago
Vladimír Vondruš
734072bee3
python: doc++
...
Huh, why didn't I document the MeshData accessors at all?
4 years ago
Vladimír Vondruš
b983d29acf
python: avoid an assertion in trade.MeshData.index_count.
...
Emit a Python exception instead.
4 years ago
Vladimír Vondruš
7bd8bd965b
python: expose trade.MeshData.index_data and .vertex_data.
...
Useful for rudimentary data size stats queries, not much else as the
other APIs are not exposed yet.
4 years ago
Vladimír Vondruš
1ce696203e
python: TODOs.
4 years ago
Vladimír Vondruš
a79bc39f3e
python: ability to import images and meshes by name.
4 years ago
Vladimír Vondruš
ea4e353231
python: work around GCC 4.8 being utterly confused.
4 years ago
Vladimír Vondruš
c2e2a8e520
python: expose basics of trade.AbstractSceneConverter.
4 years ago
Vladimír Vondruš
da21863ac7
python: exposed basics of trade.AbstractImageConverter.
4 years ago
Vladimír Vondruš
a325f3d0c1
python: minor, doc++, add TODOs.
4 years ago
Vladimír Vondruš
8e8a03e175
python: use AssertionError for trade.AbstractImporter usage errors.
...
Because using RuntimeError conflates with import failures. Also update
and fix docs to not show ValueError for where IndexError should be.
4 years ago
Vladimír Vondruš
b58b53bfda
python: lazily adapt to Corrade & Magnum std::string removal.
...
Because making & testing my own string caster is not something I'd want
to do right now (seems complicated by looking at what's all done for
std::string), the functions currently all go through a std::string
instead.
4 years ago
Vladimír Vondruš
2295f43873
Updated copyright year.
4 years ago
Vladimír Vondruš
98a3dcf59c
python: basic support for arbitrary types in strided array views.
...
Not ArrayView yet, and also no documentation on this whatsoever. That'll
come next. Also not everything works with arbitrary types yet,
converting from buffer protocol doesn't remember the format and
conversion to bytes doesn't take the actual type size into account
either.
5 years ago
Vladimír Vondruš
84f9bb2a9d
Updated copyright year.
5 years ago
Vladimír Vondruš
57db13422f
python: make this compatible with pybind11 2.6.
...
Pybind changed py::module to py::module_ in order to support C++
modules, adapting to that change. It still builds on older versions,
but we're using only the new APIs.
6 years ago
Vladimír Vondruš
1d278d1112
python: rename all Python.h headers to PythonBindings.h.
...
It conveys clearer what those headers are for and avoids issues where
shitty IDE indexers (Eclipse?) confuse this with Python's Python.h.
6 years ago
Vladimír Vondruš
b1d45fc85a
Updated copyright year.
6 years ago
Vladimír Vondruš
2045e22463
python: properly check also level bounds in importers.
6 years ago
Vladimír Vondruš
a470eae5f1
python: adapt to Trade::MeshDataXD deprecation.
...
Right now there's no deprecation logic in place for the Python bindings,
so this is a breaking change. Sorry about that.
6 years ago
Vladimír Vondruš
45eb76446b
python: expose trade.abstractImporter.imageXd_level_count().
6 years ago
Vladimír Vondruš
5d7e5c5b1c
python: adapt to Magnum changes.
6 years ago
Vladimír Vondruš
70fe4e8a25
python: add more getters to trade.MeshDataXD.
...
Was not sure if properties or methods, but this thing is scheduled for a
rewrite anyway.
7 years ago
Vladimír Vondruš
59a2773808
python: expose mesh import.
7 years ago
Vladimír Vondruš
7da09f9080
python: expose basic image import in trade.
...
Quite a huge commit because it all needs to be tested together.
7 years ago
Vladimír Vondruš
e8198cb97e
python: fix PyInit_* declarations to work on Windows as well.
...
Co-authored-by: Cameron Egbert <cegbert@oculus.com>
7 years ago
Vladimír Vondruš
68e28685ff
python: fix Clang's -Wmissing-prototypes warnings.
...
This is a temporary change until a PR fixing this on pybind11 side is
merged (and a new version released).
7 years ago
Vladimír Vondruš
d050145e51
python: put everything into a single module if magnum is built statically.
...
That makes it much easier to handle in that case (because that's the
whole point of static builds) and also nicely circumvents any issues
with duplicated global data when a static lib would be linked to
multiple dynamic libraries.
7 years ago
Vladimír Vondruš
21ee51fd96
python: do as little as possible in PYBIND11_MODULE.
7 years ago
Vladimír Vondruš
293c5eca64
python: *very* little from Trade.
7 years ago
Vladimír Vondruš
caa1619eef
python: expose Windowless{Glx,Egl}Application in platform.{glx,egl}.
...
One of them is then available through the platform.WindowlessApplication
alias. The selection is a bit arbitrary now, but has to suffice.
7 years ago
Vladimír Vondruš
a55a7e6009
python: expose Quaternion.
7 years ago
Vladimír Vondruš
44503539e7
python: expose matrix types.
...
Not the Matrix4 / Matrix3 transformation types yet, though.
7 years ago
Vladimír Vondruš
081d32938a
python: expose all Vector variants.
7 years ago
Vladimír Vondruš
2922f28267
Initial code for the Python bindings, adding math angle types.
...
Only the double ones, exposed as floats, because the extra ALU required
by doubles is negligible to function call overhead. It'll be different
for non-scalar types, but here I use this.
7 years ago