{"library":"pyobjc-framework-modelio","title":"PyObjC ModelIO Framework","description":"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.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install pyobjc-framework-modelio"],"cli":null},"imports":["from ModelIO import MDLAsset","from ModelIO import MDLMesh"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom ModelIO import MDLAsset, MDLMesh, MDLMaterial\nfrom Foundation import NSURL\n\n# Note: ModelIO is a macOS-only framework for 3D asset manipulation.\n# This code will only run on macOS.\n\ndef create_simple_asset():\n    # Create a simple mesh (e.g., a cube)\n    # newBoxWithDimensions_segments_geometryType_inwardNormals_allocator_ is a class method\n    cube_mesh = MDLMesh.newBoxWithDimensions_segments_geometryType_inwardNormals_allocator_(\n        (1.0, 1.0, 1.0),    # Dimensions (width, height, depth)\n        (1, 1, 1),          # Number of segments along each dimension\n        1,                  # MDLGeometryTypeTriangles = 1\n        False,              # Inward normals\n        None                # Allocator (None for default)\n    )\n\n    # Create a basic material\n    material = MDLMaterial.alloc().initWithName_scatteringFunction_(\"MyMaterial\", None)\n\n    # Add the material to the mesh\n    cube_mesh.addMaterial_(material)\n\n    # Create an asset and add the mesh to it\n    asset = MDLAsset.alloc().init()\n    asset.addObjects_([cube_mesh])\n\n    # Define a temporary path to save the asset\n    temp_dir = '/tmp'\n    if not os.path.exists(temp_dir):\n        os.makedirs(temp_dir)\n    output_path = os.path.join(temp_dir, \"simple_cube.obj\")\n    output_url = NSURL.fileURLWithPath_(output_path)\n\n    # Export the asset to a file (e.g., OBJ format)\n    # ModelIO supports various formats, but OBJ is simple.\n    # exportAssetToURL_ is an instance method\n    asset.exportAssetToURL_(output_url)\n\n    print(f\"Successfully created and saved a simple 3D asset to: {output_path}\")\n\nif __name__ == \"__main__\":\n    create_simple_asset()\n","lang":"python","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":null,"pypi_latest":"12.1","is_stale":null,"summary":{"python_range":"3.10–3.9","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pyobjc-framework-modelio","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pyobjc-framework-modelio","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.9,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyobjc-framework-modelio","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pyobjc-framework-modelio","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.9,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pyobjc-framework-modelio","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pyobjc-framework-modelio","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.9,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pyobjc-framework-modelio","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pyobjc-framework-modelio","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.5,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pyobjc-framework-modelio","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pyobjc-framework-modelio","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.5,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}