Welcome to Python-flavored Magnum! Please note that, while already being
rather stable, this functionality is still considered experimental and
some APIs might get changed without preserving full backwards compatibility.
Changelog
Changes since 2020.06
- Minimal supported CMake version is now 3.5, changed from 3.4, since CMake 3.27+ warns if a compatibility with CMake below 3.5 is requested. Older versions are not supported anymore and all workarounds for them were removed. This is a conservative change, as there are no known supported distributions which would have anything older than 3.5.
- Exposed the corrade.BUILD_DEPRECATED and magnum.BUILD_DEPRECATED constants, as some features may work differently depending on these being enabled or not and it’s useful to be able to query this
- Exposed the new containers.BitArray, containers.BitArrayView, containers.StridedBitArrayView1D containers, their mutable and multi-dimensional counterparts as well as the containers.StridedArrayView*D.slice_bit() utility
- Exposed missing Vector4 constructor from a Vector3 and a W component and Vector3 from Vector2 and a Z component
- Renamed
Matrix3.from()
/Matrix4.from()
to Matrix3.from_() / Matrix4.from_() becausefrom
is a Python keyword and it would be silly to have to writegetattr(Matrix4, 'from')
just to use these APIs - Exposed newly added off-center variants of Matrix4.orthographic_projection() and Matrix3.projection()
- Exposed remaining vector/scalar, exponential and other functions in the math library
- Exposed the CompressedPixelFormat enum, various pixel-format-related helper APIs are now properties on PixelFormat and CompressedPixelFormat
- Exposed CompressedImage2D, CompressedImageView2D, MutableCompressedImageView2D and their 1D and 3D counterparts
- Exposed Color3.from_xyz(), Color3.from_linear_rgb_int(), Color3.to_xyz(), Color3.to_linear_rgb_int() and equivalent APIs on Color4
- Exposed new Quaternion.rotation(), Quaternion.reflection() and Quaternion.reflect_vector() APIs
- Exposed gl.Context and its platform-specific subclasses for EGL, WGL and GLX
- Exposed gl.Framebuffer.attach_texture() and missing sRGB, depth and stencil gl.TextureFormat values (see mosra/magnum-bindings#14)
- Exposed gl.Renderer.set_blend_function(), gl.Renderer.set_blend_equation() and related enums (see mosra/magnum-bindings#9)
- Exposed gl.Renderer.Feature.CLIP_DISTANCEn values that are new since 2020.06
- Exposed new instancing, texture transformation, normal-mapping-related and lighting features in shaders.PhongGL
- Exposed new instancing and texture transformation features in shaders.FlatGL2D and shaders.FlatGL3D
- Exposed shaders.DistanceFieldVectorGL2D, shaders.DistanceFieldVectorGL3D, shaders.VectorGL2D and shaders.VectorGL3D shaders
- Renamed all helper
Python.h
headers toPythonBindings.h
to avoid issues with shitty IDE indexers such as Eclipse, confusing these with Python’s<Python.h>
- Minor performance fixes (see mosra/magnum-bindings#10, mosra/magnum-bindings#15, mosra/magnum-bindings#16, mosra/magnum-bindings#17, mosra/magnum-bindings#19, mosra/magnum-bindings#20) Travis banned everyone from using their CI and so all Linux and macOS builds were migrated from Travis to Circle CI. See also mosra/magnum#350 and mosra/magnum#523.
- It’s now possible to use
<PackageName>_ROOT
to point to install locations of dependencies such as Corrade on CMake 3.12+, in addition to putting them all together insideCMAKE_PREFIX_PATH
. See also mosra/magnum#614. - On CMake 3.16 and newer,
FindMagnumBindings.cmake
can provide additional details if some component is not found - The Homebrew package now uses
std_cmake_args
instead of hardcoded build type and install prefix, which resolves certain build issues (see mosra/homebrew-magnum#6) - Added a caster for Containers::Optional, allowing it to be used
directly in function signatures and showing up on the Python side as either
None
or the actual value - Various documentation fixes (see mosra/magnum-bindings#11)
- Fixed copypaste errors in bindings for Range2D.center_x() / Range2D.center_y(), Range3D.z(), Range3D.center_x() / Range3D.center_y() / Range3D.center_z()
- Fixed a copypaste error in platform.sdl2.Application.PointerMoveEvent.relative_position and platform.glfw.Application.PointerMoveEvent.relative_position
- Fixed platform.sdl2.Application.Modifier and platform.glfw.Application.Modifier to behave properly as flags and not just as an enum
- Exposed meshtools.compress_indices(), meshtools.concatenate(), meshtools.copy(), meshtools.duplicate(), meshtools.filter_attributes(), meshtools.filter_except_attributes(), meshtools.filter_only_attributes(), meshtools.generate_indices(), meshtools.interleave(), meshtools.remove_duplicates(), meshtools.remove_duplicates_fuzzy(), meshtools.transform2d(), meshtools.transform2d_in_place(), meshtools.transform3d(), meshtools.transform3d_in_place(), meshtools.transform_texture_coordinates2d() and meshtools.transform_texture_coordinates2d_in_place()
- Exposed platform.sdl2.Application.viewport_event() and platform.glfw.Application.viewport_event() and a possibility to make the window resizable on startup
- Exposed platform.sdl2.Application.exit_event() and platform.glfw.Application.exit_event()
- Exposed platform.sdl2.Application.dpi_scaling and platform.glfw.Application.dpi_scaling
- Exposed platform.glfw.Application.swap_interval and platform.glfw.Application.main_loop_iteration()
- Exposed platform.sdl2.Application.cursor and platform.sdl2.Application.warp_cursor(), same for GLFW
- Exposed trade.AbstractImporter.features and trade.AbstractImporter.flags and corresponding enums
- Exposed a basic interface of trade.AbstractImageConverter and trade.AbstractSceneConverter
- Exposed the whole interface of trade.MeshData and trade.MeshAttributeData including typed access to index and attribute data, together with VertexFormat, trade.DataFlags, trade.AbstractImporter.mesh_attribute_name() and trade.AbstractImporter.mesh_attribute_for_name()
- Exposed the whole interface of trade.MaterialData including typed access to attribute data, together with trade.AbstractImporter.material() and related importer APIs
- Exposed the whole interface of trade.SceneData and trade.SceneFieldData including typed access to mapping and field data, together with trade.AbstractImporter.scene() and related importer APIs
- Exposed Color3.red() and other convenience constructors (see mosra/magnum-bindings#12)
- Exposed the materialtools, scenetools and text libraries
- Exposed utility.copy() for convenient, fast and safe copying of multi-dimensional strided arrays
- Exposed the minimal interface of utility.ConfigurationGroup and utility.Configuration
- Exposed pluginmanager.AbstractManager.set_preferred_plugins(), pluginmanager.AbstractManager.register_external_manager(), the base pluginmanager.AbstractPlugin class and pluginmanager.PluginMetadata
- Fixed issues with an in-source build (see mosra/magnum-bindings#13)
- All CMake build options are now prefixed with
MAGNUM_
. For backwards compatibility, unlessMAGNUM_BUILD_DEPRECATED
is disabled and unless a prefixed option is already set during the initial run, the unprefixed options are still recognized with a warning. See also mosra/corrade#139. - Added a
MAGNUM_PYTHON_BINDINGS_STATIC_PLUGINS
CMake option for linking static plugins to the Python bindings module. See the building documentation for more information. - Added a
MAGNUM_BUILD_PYTHON_BINDINGS_RTLD_GLOBAL
CMake option to make the Python bindings module loaded into the global namespace instead of isolated in order to attempt to solve problems with duplicated globals when static builds of Corrade and Magnum are linked into multiple dynamic modules. See the building documentation for more information.
2020.06
Released 2020-06-27, tagged as v2020.06.
- Exposed Matrix4.cofactor(), Matrix4.comatrix(), Matrix4.adjugate() (and equivalents in other matrix sizes), and Matrix4.normal_matrix()
- Exposed gl.AbstractFramebuffer.blit() functions and related enums
- Exposed more keys in platform.sdl2.Application and platform.glfw.Application
- Exposed gl.AbstractTexture.unbind()
- Exposed trade.AbstractImporter.image2d_level_count() and related APIs for 1D and 3D
- Exposed trade.MeshData and related APIs, the previous
trade.MeshData3D
APIs are removed - Exposed new APIs and tangent support in the primitives library
- platform.sdl2.Application and platform.glfw.Application now
provide a clear error instead of “pure virtual method call” in case
draw_event()
is not implemented - Library version is now exposed through
MAGNUMBINDINGS_VERSION_YEAR
,MAGNUMBINDINGS_VERSION_MONTH
,MAGNUMBINDINGS_VERSION_COMMIT
,MAGNUMBINDINGS_VERSION_HASH
andMAGNUMBINDINGS_VERSION_STRING
preprocessor defines in a newMagnum/versionBindings.h
header. This header is not included by any other header to avoid trigerring a full rebuild when Git commit changes. If Git is not found, only the first two defines are present.
2019.10
Released 2019-10-24, tagged as v2019.10.
Initial version. See mosra/magnum#228, mosra/magnum-bindings#1, mosra/magnum-bindings#2 and mosra/magnum-bindings#6 for more information.