Browse Source

python: doc++

next
Vladimír Vondruš 2 years ago
parent
commit
3f7371013d
  1. 136
      doc/python/corrade.containers.rst
  2. 52
      doc/python/magnum.trade.rst
  3. 8
      src/python/magnum/trade.cpp

136
doc/python/corrade.containers.rst

@ -124,12 +124,12 @@
:py:`'B'`, :py:`'h'`, :py:`'H'`, :py:`'i'`, :py:`'I'`, :py:`'q'`,
:py:`'Q'`, :py:`'f'` or :py:`'d'`
.. py:function:: corrade.containers.StridedArrayView1D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0`
:raise IndexError: If :p:`dimension` is not :py:`0`
.. py:function:: corrade.containers.StridedArrayView1D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0`
:raise IndexError: If :p:`dimension` is not :py:`0`
.. py:function:: corrade.containers.StridedArrayView1D.expanded
:raise IndexError: if :p:`dimension` is not :py:`0`
:raise ValueError: if product of :p:`size` is not equal to size in
:raise IndexError: If :p:`dimension` is not :py:`0`
:raise ValueError: If product of :p:`size` is not equal to size in
:p:`dimension`
.. py:class:: corrade.containers.MutableStridedArrayView1D
@ -150,12 +150,12 @@
:py:`'b'`, :py:`'B'`, :py:`'h'`, :py:`'H'`, :py:`'i'`, :py:`'I'`,
:py:`'q'`, :py:`'Q'`, :py:`'f'` or :py:`'d'`
.. py:function:: corrade.containers.MutableStridedArrayView1D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0`
:raise IndexError: If :p:`dimension` is not :py:`0`
.. py:function:: corrade.containers.MutableStridedArrayView1D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0`
:raise IndexError: If :p:`dimension` is not :py:`0`
.. py:function:: corrade.containers.MutableStridedArrayView1D.expanded
:raise IndexError: if :p:`dimension` is not :py:`0`
:raise ValueError: if product of :p:`size` is not equal to size in
:raise IndexError: If :p:`dimension` is not :py:`0`
:raise ValueError: If product of :p:`size` is not equal to size in
:p:`dimension`
.. py:class:: corrade.containers.StridedArrayView2D
@ -169,15 +169,15 @@
:py:`'B'`, :py:`'h'`, :py:`'H'`, :py:`'i'`, :py:`'I'`, :py:`'q'`,
:py:`'Q'`, :py:`'f'` or :py:`'d'`
.. py:function:: corrade.containers.StridedArrayView2D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0` or :py:`1`
:raise IndexError: If :p:`dimension` is not :py:`0` or :py:`1`
.. py:function:: corrade.containers.StridedArrayView2D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0` or :py:`1`
:raise IndexError: If :p:`dimension` is not :py:`0` or :py:`1`
.. py:function:: corrade.containers.StridedArrayView2D.transposed
:raise IndexError: if :p:`a` or :p:`b` is not :py:`0` or :py:`1` or if
:raise IndexError: If :p:`a` or :p:`b` is not :py:`0` or :py:`1` or if
they're the same
.. py:function:: corrade.containers.StridedArrayView2D.expanded
:raise IndexError: if :p:`dimension` is not :py:`0` or :py:`1`
:raise ValueError: if product of :p:`size` is not equal to size in
:raise IndexError: If :p:`dimension` is not :py:`0` or :py:`1`
:raise ValueError: If product of :p:`size` is not equal to size in
:p:`dimension`
.. py:class:: corrade.containers.MutableStridedArrayView2D
@ -198,15 +198,15 @@
:py:`'b'`, :py:`'B'`, :py:`'h'`, :py:`'H'`, :py:`'i'`, :py:`'I'`,
:py:`'q'`, :py:`'Q'`, :py:`'f'` or :py:`'d'`
.. py:function:: corrade.containers.MutableStridedArrayView2D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0` or :py:`1`
:raise IndexError: If :p:`dimension` is not :py:`0` or :py:`1`
.. py:function:: corrade.containers.MutableStridedArrayView2D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0` or :py:`1`
:raise IndexError: If :p:`dimension` is not :py:`0` or :py:`1`
.. py:function:: corrade.containers.MutableStridedArrayView2D.transposed
:raise IndexError: if :p:`a` or :p:`b` is not :py:`0` or :py:`1` or if
:raise IndexError: If :p:`a` or :p:`b` is not :py:`0` or :py:`1` or if
they're the same
.. py:function:: corrade.containers.MutableStridedArrayView2D.expanded
:raise IndexError: if :p:`dimension` is not :py:`0` or :py:`1`
:raise ValueError: if product of :p:`size` is not equal to size in
:raise IndexError: If :p:`dimension` is not :py:`0` or :py:`1`
:raise ValueError: If product of :p:`size` is not equal to size in
:p:`dimension`
.. py:class:: corrade.containers.StridedArrayView3D
@ -220,15 +220,15 @@
:py:`'B'`, :py:`'h'`, :py:`'H'`, :py:`'i'`, :py:`'I'`, :py:`'q'`,
:py:`'Q'`, :py:`'f'` or :py:`'d'`
.. py:function:: corrade.containers.StridedArrayView3D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
.. py:function:: corrade.containers.StridedArrayView3D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
.. py:function:: corrade.containers.StridedArrayView3D.transposed
:raise IndexError: if :p:`a` or :p:`b` is not :py:`0`, :py:`1` or :py:`2`
:raise IndexError: If :p:`a` or :p:`b` is not :py:`0`, :py:`1` or :py:`2`
or if they're the same
.. py:function:: corrade.containers.StridedArrayView3D.expanded
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise ValueError: if product of :p:`size` is not equal to size in
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise ValueError: If product of :p:`size` is not equal to size in
:p:`dimension`
.. py:class:: corrade.containers.MutableStridedArrayView3D
@ -249,15 +249,15 @@
:py:`'b'`, :py:`'B'`, :py:`'h'`, :py:`'H'`, :py:`'i'`, :py:`'I'`,
:py:`'q'`, :py:`'Q'`, :py:`'f'` or :py:`'d'`
.. py:function:: corrade.containers.MutableStridedArrayView3D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
.. py:function:: corrade.containers.MutableStridedArrayView3D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
.. py:function:: corrade.containers.MutableStridedArrayView3D.transposed
:raise IndexError: if :p:`a` or :p:`b` is not :py:`0`, :py:`1` or :py:`2`
:raise IndexError: If :p:`a` or :p:`b` is not :py:`0`, :py:`1` or :py:`2`
or if they're the same
.. py:function:: corrade.containers.MutableStridedArrayView3D.expanded
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise ValueError: if product of :p:`size` is not equal to size in
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise ValueError: If product of :p:`size` is not equal to size in
:p:`dimension`
.. py:class:: corrade.containers.StridedArrayView4D
@ -271,13 +271,13 @@
:py:`'B'`, :py:`'h'`, :py:`'H'`, :py:`'i'`, :py:`'I'`, :py:`'q'`,
:py:`'Q'`, :py:`'f'` or :py:`'d'`
.. py:function:: corrade.containers.StridedArrayView4D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:py:`3`
.. py:function:: corrade.containers.StridedArrayView4D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:py:`3`
.. py:function:: corrade.containers.StridedArrayView4D.transposed
:raise IndexError: if :p:`a` or :p:`b` is not :py:`0`, :py:`1` :py:`2` or
:raise IndexError: If :p:`a` or :p:`b` is not :py:`0`, :py:`1` :py:`2` or
:py:`3` or if they're the same
.. py:class:: corrade.containers.MutableStridedArrayView4D
@ -298,13 +298,13 @@
:py:`'b'`, :py:`'B'`, :py:`'h'`, :py:`'H'`, :py:`'i'`, :py:`'I'`,
:py:`'q'`, :py:`'Q'`, :py:`'f'` or :py:`'d'`
.. py:function:: corrade.containers.MutableStridedArrayView4D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:py:`3`
.. py:function:: corrade.containers.MutableStridedArrayView4D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:py:`3`
.. py:function:: corrade.containers.MutableStridedArrayView4D.transposed
:raise IndexError: if :p:`a` or :p:`b` is not :py:`0`, :py:`1` :py:`2` or
:raise IndexError: If :p:`a` or :p:`b` is not :py:`0`, :py:`1` :py:`2` or
:py:`3` or if they're the same
.. py:class:: corrade.containers.BitArray
@ -355,12 +355,12 @@
is empty.
.. py:function:: corrade.containers.StridedBitArrayView1D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0`
:raise IndexError: If :p:`dimension` is not :py:`0`
.. py:function:: corrade.containers.StridedBitArrayView1D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0`
:raise IndexError: If :p:`dimension` is not :py:`0`
.. py:function:: corrade.containers.StridedBitArrayView1D.expanded
:raise IndexError: if :p:`dimension` is not :py:`0`
:raise ValueError: if product of :p:`size` is not equal to size in
:raise IndexError: If :p:`dimension` is not :py:`0`
:raise ValueError: If product of :p:`size` is not equal to size in
:p:`dimension`
.. py:class:: corrade.containers.MutableStridedBitArrayView1D
@ -369,12 +369,12 @@
:ref:`__setitem__()` as well.
.. py:function:: corrade.containers.MutableStridedBitArrayView1D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0`
:raise IndexError: If :p:`dimension` is not :py:`0`
.. py:function:: corrade.containers.MutableStridedBitArrayView1D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0`
:raise IndexError: If :p:`dimension` is not :py:`0`
.. py:function:: corrade.containers.MutableStridedBitArrayView1D.expanded
:raise IndexError: if :p:`dimension` is not :py:`0`
:raise ValueError: if product of :p:`size` is not equal to size in
:raise IndexError: If :p:`dimension` is not :py:`0`
:raise ValueError: If product of :p:`size` is not equal to size in
:p:`dimension`
.. py:class:: corrade.containers.StridedBitArrayView2D
@ -382,15 +382,15 @@
See :ref:`StridedBitArrayView1D` for more information.
.. py:function:: corrade.containers.StridedBitArrayView2D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0` or :py:`1`
:raise IndexError: If :p:`dimension` is not :py:`0` or :py:`1`
.. py:function:: corrade.containers.StridedBitArrayView2D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0` or :py:`1`
:raise IndexError: If :p:`dimension` is not :py:`0` or :py:`1`
.. py:function:: corrade.containers.StridedBitArrayView2D.transposed
:raise IndexError: if :p:`a` or :p:`b` is not :py:`0` or :py:`1` or if
:raise IndexError: If :p:`a` or :p:`b` is not :py:`0` or :py:`1` or if
they're the same
.. py:function:: corrade.containers.StridedBitArrayView2D.expanded
:raise IndexError: if :p:`dimension` is not :py:`0` or :py:`1`
:raise ValueError: if product of :p:`size` is not equal to size in
:raise IndexError: If :p:`dimension` is not :py:`0` or :py:`1`
:raise ValueError: If product of :p:`size` is not equal to size in
:p:`dimension`
.. py:class:: corrade.containers.MutableStridedBitArrayView2D
@ -399,15 +399,15 @@
for more information.
.. py:function:: corrade.containers.MutableStridedBitArrayView2D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0` or :py:`1`
:raise IndexError: If :p:`dimension` is not :py:`0` or :py:`1`
.. py:function:: corrade.containers.MutableStridedBitArrayView2D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0` or :py:`1`
:raise IndexError: If :p:`dimension` is not :py:`0` or :py:`1`
.. py:function:: corrade.containers.MutableStridedBitArrayView2D.transposed
:raise IndexError: if :p:`a` or :p:`b` is not :py:`0` or :py:`1` or if
:raise IndexError: If :p:`a` or :p:`b` is not :py:`0` or :py:`1` or if
they're the same
.. py:function:: corrade.containers.MutableStridedBitArrayView2D.expanded
:raise IndexError: if :p:`dimension` is not :py:`0` or :py:`1`
:raise ValueError: if product of :p:`size` is not equal to size in
:raise IndexError: If :p:`dimension` is not :py:`0` or :py:`1`
:raise ValueError: If product of :p:`size` is not equal to size in
:p:`dimension`
.. py:class:: corrade.containers.StridedBitArrayView3D
@ -415,15 +415,15 @@
See :ref:`StridedBitArrayView1D` for more information.
.. py:function:: corrade.containers.StridedBitArrayView3D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
.. py:function:: corrade.containers.StridedBitArrayView3D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
.. py:function:: corrade.containers.StridedBitArrayView3D.transposed
:raise IndexError: if :p:`a` or :p:`b` is not :py:`0`, :py:`1` or :py:`2`
:raise IndexError: If :p:`a` or :p:`b` is not :py:`0`, :py:`1` or :py:`2`
or if they're the same
.. py:function:: corrade.containers.StridedBitArrayView3D.expanded
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise ValueError: if product of :p:`size` is not equal to size in
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise ValueError: If product of :p:`size` is not equal to size in
:p:`dimension`
.. py:class:: corrade.containers.MutableStridedBitArrayView3D
@ -432,15 +432,15 @@
for more information.
.. py:function:: corrade.containers.MutableStridedBitArrayView3D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
.. py:function:: corrade.containers.MutableStridedBitArrayView3D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
.. py:function:: corrade.containers.MutableStridedBitArrayView3D.transposed
:raise IndexError: if :p:`a` or :p:`b` is not :py:`0`, :py:`1` or :py:`2`
:raise IndexError: If :p:`a` or :p:`b` is not :py:`0`, :py:`1` or :py:`2`
or if they're the same
.. py:function:: corrade.containers.MutableStridedBitArrayView3D.expanded
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise ValueError: if product of :p:`size` is not equal to size in
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` or :py:`2`
:raise ValueError: If product of :p:`size` is not equal to size in
:p:`dimension`
.. py:class:: corrade.containers.StridedBitArrayView4D
@ -448,13 +448,13 @@
See :ref:`StridedBitArrayView1D` for more information.
.. py:function:: corrade.containers.StridedBitArrayView4D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:py:`3`
.. py:function:: corrade.containers.StridedBitArrayView4D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:py:`3`
.. py:function:: corrade.containers.StridedBitArrayView4D.transposed
:raise IndexError: if :p:`a` or :p:`b` is not :py:`0`, :py:`1` :py:`2` or
:raise IndexError: If :p:`a` or :p:`b` is not :py:`0`, :py:`1` :py:`2` or
:py:`3` or if they're the same
.. py:class:: corrade.containers.MutableStridedBitArrayView4D
@ -463,11 +463,11 @@
for more information.
.. py:function:: corrade.containers.MutableStridedBitArrayView4D.flipped
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:py:`3`
.. py:function:: corrade.containers.MutableStridedBitArrayView4D.broadcasted
:raise IndexError: if :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:raise IndexError: If :p:`dimension` is not :py:`0`, :py:`1` :py:`2` or
:py:`3`
.. py:function:: corrade.containers.MutableStridedBitArrayView4D.transposed
:raise IndexError: if :p:`a` or :p:`b` is not :py:`0`, :py:`1` :py:`2` or
:raise IndexError: If :p:`a` or :p:`b` is not :py:`0`, :py:`1` :py:`2` or
:py:`3` or if they're the same

52
doc/python/magnum.trade.rst

@ -244,19 +244,27 @@
.. py:function:: magnum.trade.MeshData.attribute(self, id: int)
:raise IndexError: If :p:`id` is negative or not less than
:ref:`attribute_count()`
:raise NotImplementedError: if :ref:`attribute_array_size()` for given
attribute isn't :py:`0`
.. py:function:: magnum.trade.MeshData.attribute(self, name: magnum.trade.MeshAttribute, id: int, morph_target_id: int)
:raise KeyError: If :p:`id` is negative or not less than
:ref:`attribute_count()` for :p:`name` and :p:`morph_target_id`
:raise NotImplementedError: if :ref:`attribute_array_size()` for given
attribute isn't :py:`0`
.. py:function:: magnum.trade.MeshData.mutable_attribute(self, id: int)
:raise IndexError: If :p:`id` is negative or not less than
:ref:`attribute_count()`
:raise AttributeError: If :ref:`vertex_data_flags` doesn't contain
:ref:`DataFlags.MUTABLE`
:raise NotImplementedError: if :ref:`attribute_array_size()` for given
attribute isn't :py:`0`
.. py:function:: magnum.trade.MeshData.mutable_attribute(self, name: magnum.trade.MeshAttribute, id: int, morph_target_id: int)
:raise KeyError: If :p:`id` is negative or not less than
:ref:`attribute_count()` for :p:`name` and :p:`morph_target_id`
:raise AttributeError: If :ref:`vertex_data_flags` doesn't contain
:ref:`DataFlags.MUTABLE`
:raise NotImplementedError: if :ref:`attribute_array_size()` for given
attribute isn't :py:`0`
.. py:enum:: magnum.trade.MaterialLayer
@ -674,6 +682,50 @@
:raise KeyError: If :p:`field_name` does not exist
:raise IndexError: If :p:`object` is negative or not less than
:ref:`mapping_bound`
.. py:function:: magnum.trade.SceneData.mapping(self, id: int)
:raise IndexError: If :p:`id` is negative or not less than
:ref:`field_count`
.. py:function:: magnum.trade.SceneData.mapping(self, name: magnum.trade.SceneField)
:raise KeyError: If :p:`name` does not exist
.. py:function:: magnum.trade.SceneData.mutable_mapping(self, id: int)
:raise IndexError: If :p:`id` is negative or not less than
:ref:`field_count`
:raise AttributeError: If :ref:`data_flags` doesn't contain
:ref:`DataFlags.MUTABLE`
.. py:function:: magnum.trade.SceneData.mutable_mapping(self, name: magnum.trade.SceneField)
:raise KeyError: If :p:`name` does not exist
:raise AttributeError: If :ref:`data_flags` doesn't contain
:ref:`DataFlags.MUTABLE`
.. py:function:: magnum.trade.SceneData.field(self, id: int)
:raise IndexError: If :p:`id` is negative or not less than
:ref:`field_count`
:raise NotImplementedError: If :ref:`field_array_size()` for given field is
not :py:`0`
:raise NotImplementedError: If :ref:`field_type()` for given field is a
string type
.. py:function:: magnum.trade.SceneData.field(self, name: magnum.trade.SceneField)
:raise KeyError: If :p:`name` does not exist
:raise NotImplementedError: If :ref:`field_array_size()` for given field is
not :py:`0`
:raise NotImplementedError: If :ref:`field_type()` for given field is a
string type
.. py:function:: magnum.trade.SceneData.mutable_field(self, id: int)
:raise IndexError: If :p:`id` is negative or not less than
:ref:`field_count`
:raise AttributeError: If :ref:`data_flags` doesn't contain
:ref:`DataFlags.MUTABLE`
:raise NotImplementedError: If :ref:`field_array_size()` for given field is
not :py:`0`
:raise NotImplementedError: If :ref:`field_type()` for given field is a
string type
.. py:function:: magnum.trade.SceneData.mutable_field(self, name: magnum.trade.SceneField)
:raise KeyError: If :p:`name` does not exist
:raise AttributeError: If :ref:`data_flags` doesn't contain
:ref:`DataFlags.MUTABLE`
:raise NotImplementedError: If :ref:`field_array_size()` for given field is
not :py:`0`
:raise NotImplementedError: If :ref:`field_type()` for given field is a
string type
.. py:class:: magnum.trade.ImporterManager
:summary: Manager for :ref:`AbstractImporter` plugin instances

8
src/python/magnum/trade.cpp

@ -2607,7 +2607,7 @@ void trade(py::module_& m) {
PyErr_Format(PyExc_IndexError, "index %u out of range for %u fields", id, self.fieldCount());
throw py::error_already_set{};
}, "Object mapping data for given field", py::arg("name"))
}, "Object mapping data for given field", py::arg("id"))
.def("mutable_mapping", [](Trade::SceneData& self, Trade::SceneField name) {
if(!(self.dataFlags() & Trade::DataFlag::Mutable)) {
PyErr_SetString(PyExc_AttributeError, "scene data is not mutable");
@ -2629,7 +2629,7 @@ void trade(py::module_& m) {
PyErr_Format(PyExc_IndexError, "index %u out of range for %u fields", id, self.fieldCount());
throw py::error_already_set{};
}, "Mutable object mapping data for given field", py::arg("name"))
}, "Mutable object mapping data for given field", py::arg("id"))
.def("field", [](/*const*/ Trade::SceneData& self, Trade::SceneField name) {
if(const Containers::Optional<UnsignedInt> found = self.findFieldId(name)) {
/** @todo handle arrays (return a 2D (bit) view) */
@ -2660,7 +2660,7 @@ void trade(py::module_& m) {
if(self.fieldType(id) == Trade::SceneFieldType::Bit)
return pyCastButNotShitty(Containers::pyArrayViewHolder(self.fieldBits(id), py::cast(self)));
return pyCastButNotShitty(sceneFieldView(self.fieldType(id), self.field(id), py::cast(self)));
}, "Data for given field", py::arg("name"))
}, "Data for given field", py::arg("id"))
.def("mutable_field", [](Trade::SceneData& self, Trade::SceneField name) {
if(!(self.dataFlags() & Trade::DataFlag::Mutable)) {
PyErr_SetString(PyExc_AttributeError, "scene data is not mutable");
@ -2699,7 +2699,7 @@ void trade(py::module_& m) {
if(self.fieldType(id) == Trade::SceneFieldType::Bit)
return pyCastButNotShitty(Containers::pyArrayViewHolder(self.mutableFieldBits(id), py::cast(self)));
return pyCastButNotShitty(sceneFieldView(self.fieldType(id), self.mutableField(id), py::cast(self)));
}, "Mutable data for given field", py::arg("name"))
}, "Mutable data for given field", py::arg("id"))
.def_property_readonly("owner", [](Trade::SceneData& self) {
return pyObjectHolderFor<Trade::PyDataHolder>(self).owner;

Loading…
Cancel
Save