Registry / serialization / pyobjc-framework-modelio

pyobjc-framework-modelio

JSON →
library12.2pypypiunverified

pyobjc-framework-modelio provides Python bindings for Apple's ModelIO framework, enabling macOS applications to work with 3D assets, meshes, materials, and other related data. As part of the larger PyObjC project, it typically releases new versions to align with new macOS SDKs, with version 12.1 being the current stable release.

pip install pyobjc-framework-modelio
INSTALL
IMPORT
SIG · PYOBJC-FRAMEWORK-M
P
pyobjc-framework-modelio
serializationpythonv12.2
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MDLAsset
from ModelIO import MDLAsset
MDLMesh
from ModelIO import MDLMesh

This quickstart demonstrates how to create a simple 3D cube mesh using ModelIO, add it to an MDLAsset, and then export it to an OBJ file. This code is macOS-specific due to its reliance on Apple's ModelIO framework.

import os from ModelIO import MDLAsset, MDLMesh, MDLMaterial from Foundation import NSURL # Note: ModelIO is a macOS-only framework for 3D asset manipulation. # This code will only run on macOS. def create_simple_asset(): # Create a simple mesh (e.g., a cube) # newBoxWithDimensions_segments_geometryType_inwardNormals_allocator_ is a class method cube_mesh = MDLMesh.newBoxWithDimensions_segments_geometryType_inwardNormals_allocator_( (1.0, 1.0, 1.0), # Dimensions (width, height, depth) (1, 1, 1), # Number of segments along each dimension 1, # MDLGeometryTypeTriangles = 1 False, # Inward normals None # Allocator (None for default) ) # Create a basic material material = MDLMaterial.alloc().initWithName_scatteringFunction_("MyMaterial", None) # Add the material to the mesh cube_mesh.addMaterial_(material) # Create an asset and add the mesh to it asset = MDLAsset.alloc().init() asset.addObjects_([cube_mesh]) # Define a temporary path to save the asset temp_dir = '/tmp' if not os.path.exists(temp_dir): os.makedirs(temp_dir) output_path = os.path.join(temp_dir, "simple_cube.obj") output_url = NSURL.fileURLWithPath_(output_path) # Export the asset to a file (e.g., OBJ format) # ModelIO supports various formats, but OBJ is simple. # exportAssetToURL_ is an instance method asset.exportAssetToURL_(output_url) print(f"Successfully created and saved a simple 3D asset to: {output_path}") if __name__ == "__main__": create_simple_asset()
Debug
Known issues
breakingPyObjC releases frequently drop support for older Python versions. For example, v12.0 dropped Python 3.9, and v11.0 dropped Python 3.8. Ensure your Python version meets the `requires_python` specification for the PyObjC version you are installing.
fix
Upgrade to a compatible Python version (e.g., Python 3.10+ for PyObjC 12.x) or use an older PyObjC version that supports your Python environment.
affects: >=11.0
breakingThe automatic reference counting (ARC) behavior for Objective-C initializer methods (`init` family) was changed in PyObjC 11.1 to align with `clang`'s documentation. PyObjC now correctly models that these methods steal a reference to `self` and return a new reference, which can affect memory management if not accounted for.
fix
Review any custom `__new__` or `__init__` methods in Python subclasses of Objective-C classes, especially those mimicking initializer patterns, to ensure correct reference handling.
affects: >=11.1
gotchaPyObjC and all its framework bindings are macOS-specific. They cannot be installed or run on other operating systems (Windows, Linux, etc.), as they directly interface with macOS system frameworks.
fix
Develop and run PyObjC applications exclusively on macOS. For cross-platform development, consider alternative libraries.
affects: all
gotchaThe interaction between Python's `__init__` and Objective-C's `__new__` was subtly changed in PyObjC 10.3 and then partially reverted in 10.3.1. Initially, `__init__` was disabled when `__new__` was provided by PyObjC, breaking some projects. Reintroduced `__init__` support if a user implements `__new__`.
fix
If experiencing issues with `__init__` not being called correctly on subclasses, especially when `__new__` is involved, ensure you are on PyObjC 10.3.1 or later. Review your `__new__` and `__init__` implementations for compatibility with PyObjC's object lifecycle.
affects: 10.3 - 10.3.1
gotchaPyObjC has varying levels of support for Python's experimental free-threading (PEP 703). PyObjC 10.3 explicitly did *not* support it, while PyObjC 11 introduced experimental support for Python 3.13. Relying on free-threading with PyObjC can lead to instability or undefined behavior in certain versions.
fix
Avoid using PyObjC in a free-threading enabled Python environment unless explicitly stated as fully supported for your PyObjC version. Consult the PyObjC release notes for specific guidance on free-threading compatibility.
affects: >=10.3
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredProvides the core bridge between Python and Objective-C, essential for all PyObjC framework bindings.
pyobjc-framework-CocoarequiredModelIO often relies on fundamental Cocoa types and functionalities, making it a common indirect or direct dependency.
Agent activity
11 hits · last 30 days
node
10
Amazon
1
Resources
pyobjc-framework-modelio — pip install pyobjc-framework-modelio · libregistry