mujofil 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mujofil-0.1.0/.github/workflows/wheels.yml +63 -0
- mujofil-0.1.0/.gitignore +24 -0
- mujofil-0.1.0/CMakeLists.txt +161 -0
- mujofil-0.1.0/LICENSE +201 -0
- mujofil-0.1.0/NOTICE +20 -0
- mujofil-0.1.0/PKG-INFO +102 -0
- mujofil-0.1.0/README.md +82 -0
- mujofil-0.1.0/mujofil/__init__.py +54 -0
- mujofil-0.1.0/mujofil/__main__.py +13 -0
- mujofil-0.1.0/mujofil/_system_check.py +93 -0
- mujofil-0.1.0/mujofil/env_wrapper.py +112 -0
- mujofil-0.1.0/mujofil/materials/default_pbr.mat +36 -0
- mujofil-0.1.0/mujofil/materials/ground_grid.mat +50 -0
- mujofil-0.1.0/mujofil/materials/prebuilt/default_pbr.filamat +0 -0
- mujofil-0.1.0/mujofil/materials/prebuilt/ground_grid.filamat +0 -0
- mujofil-0.1.0/mujofil/renderer.py +186 -0
- mujofil-0.1.0/mujofil/utils.py +42 -0
- mujofil-0.1.0/pyproject.toml +72 -0
- mujofil-0.1.0/src/bindings/bindings.cpp +16 -0
- mujofil-0.1.0/src/bindings/renderer_bindings.cpp +90 -0
- mujofil-0.1.0/src/bindings/scene_bindings.cpp +101 -0
- mujofil-0.1.0/src/core/camera_controller.cpp +2 -0
- mujofil-0.1.0/src/core/camera_controller.h +91 -0
- mujofil-0.1.0/src/core/light_manager.cpp +282 -0
- mujofil-0.1.0/src/core/light_manager.h +83 -0
- mujofil-0.1.0/src/core/material_manager.cpp +174 -0
- mujofil-0.1.0/src/core/material_manager.h +63 -0
- mujofil-0.1.0/src/core/renderer.cpp +344 -0
- mujofil-0.1.0/src/core/renderer.h +121 -0
- mujofil-0.1.0/src/core/scene_bridge.cpp +878 -0
- mujofil-0.1.0/src/core/scene_bridge.h +162 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/actuator.h +874 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/api.h +44 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/collisionAPI.h +387 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/equalityAPI.h +224 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/equalityConnectAPI.h +163 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/equalityJointAPI.h +289 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/equalityWeldAPI.h +189 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/imageableAPI.h +186 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/jointAPI.h +648 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/keyframe.h +294 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/layer_sink.h +41 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/materialAPI.h +212 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/meshCollisionAPI.h +218 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjassert.h +134 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjdata.h +450 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjexport.h +47 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjmacro.h +38 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjmodel.h +902 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjplugin.h +229 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjrender.h +177 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjsan.h +69 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjspec.h +822 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjthread.h +42 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjtype.h +579 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjui.h +345 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjvisualize.h +415 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mjxmacro.h +1059 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/mujoco.h +2099 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/sceneAPI.h +1783 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/siteAPI.h +185 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/tendon.h +843 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/tokens.h +853 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/utils.h +35 -0
- mujofil-0.1.0/third_party/mujoco/include/mujoco/writer.h +53 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: Build & publish wheels
|
|
2
|
+
|
|
3
|
+
# Builds broad-compatibility wheels (CPython 3.9–3.13, manylinux_2_28 →
|
|
4
|
+
# Ubuntu 18.04+ / Debian 10+ / RHEL 8+) with cibuildwheel, plus an sdist.
|
|
5
|
+
# On a tagged release (v*), publishes to PyPI via Trusted Publishing (OIDC) —
|
|
6
|
+
# no API token stored in the repo.
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
branches: [main]
|
|
11
|
+
tags: ["v*"]
|
|
12
|
+
pull_request:
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build_wheels:
|
|
17
|
+
name: Wheels on ${{ matrix.os }}
|
|
18
|
+
runs-on: ${{ matrix.os }}
|
|
19
|
+
strategy:
|
|
20
|
+
fail-fast: false
|
|
21
|
+
matrix:
|
|
22
|
+
os: [ubuntu-latest] # add macos-14 / windows-latest once Filament paths are wired
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Build wheels
|
|
27
|
+
uses: pypa/cibuildwheel@v2.23.3
|
|
28
|
+
# All build configuration lives in [tool.cibuildwheel] in pyproject.toml.
|
|
29
|
+
|
|
30
|
+
- uses: actions/upload-artifact@v4
|
|
31
|
+
with:
|
|
32
|
+
name: wheels-${{ matrix.os }}
|
|
33
|
+
path: ./wheelhouse/*.whl
|
|
34
|
+
|
|
35
|
+
build_sdist:
|
|
36
|
+
name: Source distribution
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v4
|
|
40
|
+
- uses: actions/setup-python@v5
|
|
41
|
+
with:
|
|
42
|
+
python-version: "3.11"
|
|
43
|
+
- run: pipx run build --sdist
|
|
44
|
+
- uses: actions/upload-artifact@v4
|
|
45
|
+
with:
|
|
46
|
+
name: sdist
|
|
47
|
+
path: ./dist/*.tar.gz
|
|
48
|
+
|
|
49
|
+
publish:
|
|
50
|
+
name: Publish to PyPI
|
|
51
|
+
needs: [build_wheels, build_sdist]
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
# Only on a version tag.
|
|
54
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
55
|
+
environment: pypi
|
|
56
|
+
permissions:
|
|
57
|
+
id-token: write # OIDC Trusted Publishing — no token needed
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/download-artifact@v4
|
|
60
|
+
with:
|
|
61
|
+
path: dist
|
|
62
|
+
merge-multiple: true
|
|
63
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
mujofil-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Build / packaging artifacts
|
|
2
|
+
/dist/
|
|
3
|
+
/build/
|
|
4
|
+
/_skbuild/
|
|
5
|
+
/_filament/
|
|
6
|
+
*.egg-info/
|
|
7
|
+
wheelhouse/
|
|
8
|
+
|
|
9
|
+
# Compiled / native
|
|
10
|
+
*.so
|
|
11
|
+
*.o
|
|
12
|
+
*.a
|
|
13
|
+
*.filamat
|
|
14
|
+
|
|
15
|
+
# Python caches
|
|
16
|
+
__pycache__/
|
|
17
|
+
*.py[cod]
|
|
18
|
+
.venv/
|
|
19
|
+
venv/
|
|
20
|
+
|
|
21
|
+
# Editor / OS
|
|
22
|
+
.vscode/
|
|
23
|
+
.idea/
|
|
24
|
+
.DS_Store
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.20)
|
|
2
|
+
project(mujofil VERSION 0.1.0 LANGUAGES CXX C)
|
|
3
|
+
|
|
4
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
5
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
6
|
+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
7
|
+
if(NOT CMAKE_BUILD_TYPE)
|
|
8
|
+
set(CMAKE_BUILD_TYPE Release)
|
|
9
|
+
endif()
|
|
10
|
+
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
|
11
|
+
|
|
12
|
+
# ============================================================================
|
|
13
|
+
# Filament (static libs -> baked into the module, nothing to ship separately)
|
|
14
|
+
# ============================================================================
|
|
15
|
+
# One-command install: if FILAMENT_DIR isn't provided, download the pinned
|
|
16
|
+
# Filament release automatically so `pip install mujofil` works from source with
|
|
17
|
+
# no manual setup. A prebuilt wheel never hits this path.
|
|
18
|
+
set(FILAMENT_VERSION "1.56.3")
|
|
19
|
+
if(NOT FILAMENT_DIR)
|
|
20
|
+
set(FILAMENT_DIR "$ENV{FILAMENT_DIR}")
|
|
21
|
+
endif()
|
|
22
|
+
if(NOT FILAMENT_DIR)
|
|
23
|
+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
24
|
+
set(_fil_os "linux")
|
|
25
|
+
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
26
|
+
set(_fil_os "mac")
|
|
27
|
+
elseif(WIN32)
|
|
28
|
+
set(_fil_os "windows")
|
|
29
|
+
else()
|
|
30
|
+
message(FATAL_ERROR "Unsupported platform for Filament auto-download.")
|
|
31
|
+
endif()
|
|
32
|
+
set(FILAMENT_DIR "${CMAKE_BINARY_DIR}/_filament")
|
|
33
|
+
if(NOT EXISTS "${FILAMENT_DIR}/include")
|
|
34
|
+
set(_fil_url "https://github.com/google/filament/releases/download/v${FILAMENT_VERSION}/filament-v${FILAMENT_VERSION}-${_fil_os}.tgz")
|
|
35
|
+
message(STATUS "FILAMENT_DIR not set — downloading Filament v${FILAMENT_VERSION} (${_fil_os})...")
|
|
36
|
+
file(MAKE_DIRECTORY "${FILAMENT_DIR}")
|
|
37
|
+
file(DOWNLOAD "${_fil_url}" "${CMAKE_BINARY_DIR}/filament.tgz" SHOW_PROGRESS STATUS _dl)
|
|
38
|
+
list(GET _dl 0 _dl_rc)
|
|
39
|
+
if(NOT _dl_rc EQUAL 0)
|
|
40
|
+
message(FATAL_ERROR "Failed to download Filament from ${_fil_url} (${_dl}).")
|
|
41
|
+
endif()
|
|
42
|
+
execute_process(
|
|
43
|
+
COMMAND ${CMAKE_COMMAND} -E tar xzf "${CMAKE_BINARY_DIR}/filament.tgz"
|
|
44
|
+
WORKING_DIRECTORY "${FILAMENT_DIR}")
|
|
45
|
+
# The tarball extracts into a 'filament/' subdir — flatten it.
|
|
46
|
+
if(EXISTS "${FILAMENT_DIR}/filament/include")
|
|
47
|
+
file(GLOB _fil_children "${FILAMENT_DIR}/filament/*")
|
|
48
|
+
foreach(_c ${_fil_children})
|
|
49
|
+
get_filename_component(_n "${_c}" NAME)
|
|
50
|
+
file(RENAME "${_c}" "${FILAMENT_DIR}/${_n}")
|
|
51
|
+
endforeach()
|
|
52
|
+
endif()
|
|
53
|
+
endif()
|
|
54
|
+
endif()
|
|
55
|
+
if(NOT EXISTS "${FILAMENT_DIR}/include")
|
|
56
|
+
message(FATAL_ERROR "FILAMENT_DIR='${FILAMENT_DIR}' has no include/ — bad Filament path.")
|
|
57
|
+
endif()
|
|
58
|
+
set(FILAMENT_INCLUDE_DIR "${FILAMENT_DIR}/include")
|
|
59
|
+
set(FILAMENT_LIB_DIR "${FILAMENT_DIR}/lib/x86_64")
|
|
60
|
+
|
|
61
|
+
set(FILAMENT_LIBS
|
|
62
|
+
filament backend bluegl bluevk filabridge filaflat utils geometry smol-v
|
|
63
|
+
ibl image camutils filameshio gltfio gltfio_core uberarchive meshoptimizer
|
|
64
|
+
ktxreader basis_transcoder dracodec png z stb uberzlib zstd)
|
|
65
|
+
|
|
66
|
+
# ============================================================================
|
|
67
|
+
# MuJoCo — HEADERS ONLY, and VENDORED into the repo (third_party/mujoco/include).
|
|
68
|
+
# The bindings read mjModel/mjData via raw pointers and call no MuJoCo functions,
|
|
69
|
+
# so we never link or ship libmujoco. Vendoring the headers (MuJoCo is Apache-2.0)
|
|
70
|
+
# means the build needs NO mujoco install at all — identical across every Python
|
|
71
|
+
# version and CI container. `mujoco` remains a pure RUNTIME pip dependency that
|
|
72
|
+
# provides the actual library when the user runs.
|
|
73
|
+
# ============================================================================
|
|
74
|
+
if(NOT MUJOCO_INCLUDE_DIR)
|
|
75
|
+
set(MUJOCO_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/third_party/mujoco/include")
|
|
76
|
+
endif()
|
|
77
|
+
if(NOT EXISTS "${MUJOCO_INCLUDE_DIR}/mujoco/mujoco.h")
|
|
78
|
+
message(FATAL_ERROR "Vendored MuJoCo headers not found at ${MUJOCO_INCLUDE_DIR}.")
|
|
79
|
+
endif()
|
|
80
|
+
message(STATUS "MuJoCo headers (vendored): ${MUJOCO_INCLUDE_DIR}")
|
|
81
|
+
|
|
82
|
+
# scikit-build-core sets Python_EXECUTABLE; fall back to a plain interpreter
|
|
83
|
+
# lookup for standalone CMake configures.
|
|
84
|
+
if(NOT Python_EXECUTABLE)
|
|
85
|
+
find_package(Python COMPONENTS Interpreter REQUIRED)
|
|
86
|
+
endif()
|
|
87
|
+
|
|
88
|
+
find_package(pybind11 CONFIG REQUIRED)
|
|
89
|
+
find_package(Threads REQUIRED)
|
|
90
|
+
|
|
91
|
+
# ============================================================================
|
|
92
|
+
# Core static library (the Filament renderer)
|
|
93
|
+
# ============================================================================
|
|
94
|
+
add_library(vf_mujoco_core STATIC
|
|
95
|
+
src/core/renderer.cpp
|
|
96
|
+
src/core/scene_bridge.cpp
|
|
97
|
+
src/core/material_manager.cpp
|
|
98
|
+
src/core/light_manager.cpp
|
|
99
|
+
src/core/camera_controller.cpp)
|
|
100
|
+
|
|
101
|
+
target_include_directories(vf_mujoco_core PUBLIC
|
|
102
|
+
${CMAKE_SOURCE_DIR}/src ${FILAMENT_INCLUDE_DIR} ${MUJOCO_INCLUDE_DIR})
|
|
103
|
+
target_link_directories(vf_mujoco_core PUBLIC ${FILAMENT_LIB_DIR})
|
|
104
|
+
foreach(lib ${FILAMENT_LIBS})
|
|
105
|
+
target_link_libraries(vf_mujoco_core PUBLIC ${lib})
|
|
106
|
+
endforeach()
|
|
107
|
+
target_link_libraries(vf_mujoco_core PUBLIC Threads::Threads dl)
|
|
108
|
+
|
|
109
|
+
# ============================================================================
|
|
110
|
+
# Python module
|
|
111
|
+
# ============================================================================
|
|
112
|
+
pybind11_add_module(_vf_mujoco_native
|
|
113
|
+
src/bindings/bindings.cpp
|
|
114
|
+
src/bindings/renderer_bindings.cpp
|
|
115
|
+
src/bindings/scene_bindings.cpp)
|
|
116
|
+
target_link_libraries(_vf_mujoco_native PRIVATE vf_mujoco_core c++ c++abi)
|
|
117
|
+
target_include_directories(_vf_mujoco_native PRIVATE
|
|
118
|
+
${CMAKE_SOURCE_DIR}/src ${FILAMENT_INCLUDE_DIR} ${MUJOCO_INCLUDE_DIR})
|
|
119
|
+
|
|
120
|
+
# Look for bundled shared libs (libc++ etc., placed by auditwheel) next to the
|
|
121
|
+
# module inside the installed package.
|
|
122
|
+
set_target_properties(_vf_mujoco_native PROPERTIES
|
|
123
|
+
INSTALL_RPATH "$ORIGIN"
|
|
124
|
+
BUILD_WITH_INSTALL_RPATH ON)
|
|
125
|
+
|
|
126
|
+
# Install the native module INTO the python package directory.
|
|
127
|
+
install(TARGETS _vf_mujoco_native DESTINATION mujofil)
|
|
128
|
+
|
|
129
|
+
# ============================================================================
|
|
130
|
+
# Filament materials, installed as package data.
|
|
131
|
+
# Prefer PREBUILT .filamat files committed under mujofil/materials/prebuilt/
|
|
132
|
+
# (compiled on a host with a working matc). Filament's matc binary needs glibc
|
|
133
|
+
# >= 2.29 and cannot run inside the manylinux_2_28 (glibc 2.28) CI container, so
|
|
134
|
+
# we ship the precompiled packages there. If they're absent (e.g. you edited a
|
|
135
|
+
# .mat), fall back to compiling with matc.
|
|
136
|
+
# ============================================================================
|
|
137
|
+
set(PREBUILT_MAT_DIR "${CMAKE_SOURCE_DIR}/mujofil/materials/prebuilt")
|
|
138
|
+
file(GLOB PREBUILT_MATERIALS "${PREBUILT_MAT_DIR}/*.filamat")
|
|
139
|
+
|
|
140
|
+
if(PREBUILT_MATERIALS)
|
|
141
|
+
message(STATUS "Using prebuilt Filament materials from ${PREBUILT_MAT_DIR}")
|
|
142
|
+
install(FILES ${PREBUILT_MATERIALS} DESTINATION mujofil/materials)
|
|
143
|
+
add_custom_target(materials ALL)
|
|
144
|
+
else()
|
|
145
|
+
set(MATC "${FILAMENT_DIR}/bin/matc")
|
|
146
|
+
file(GLOB MATERIAL_SOURCES "${CMAKE_SOURCE_DIR}/mujofil/materials/*.mat")
|
|
147
|
+
foreach(mat_file ${MATERIAL_SOURCES})
|
|
148
|
+
get_filename_component(mat_name ${mat_file} NAME_WE)
|
|
149
|
+
set(mat_output "${CMAKE_BINARY_DIR}/materials/${mat_name}.filamat")
|
|
150
|
+
add_custom_command(
|
|
151
|
+
OUTPUT ${mat_output}
|
|
152
|
+
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/materials"
|
|
153
|
+
COMMAND ${MATC} -o ${mat_output} -a vulkan -a opengl ${mat_file}
|
|
154
|
+
DEPENDS ${mat_file}
|
|
155
|
+
COMMENT "Compiling material: ${mat_name}")
|
|
156
|
+
list(APPEND COMPILED_MATERIALS ${mat_output})
|
|
157
|
+
endforeach()
|
|
158
|
+
add_custom_target(materials ALL DEPENDS ${COMPILED_MATERIALS})
|
|
159
|
+
install(FILES ${COMPILED_MATERIALS} DESTINATION mujofil/materials)
|
|
160
|
+
endif()
|
|
161
|
+
add_dependencies(_vf_mujoco_native materials)
|
mujofil-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
mujofil-0.1.0/NOTICE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MuJoFil
|
|
2
|
+
Copyright 2026 Tau Intelligence
|
|
3
|
+
|
|
4
|
+
This product includes software developed at Tau Intelligence.
|
|
5
|
+
|
|
6
|
+
------------------------------------------------------------------------
|
|
7
|
+
Third-party components
|
|
8
|
+
------------------------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
MuJoCo (headers vendored under third_party/mujoco/include)
|
|
11
|
+
Copyright Google DeepMind
|
|
12
|
+
Licensed under the Apache License, Version 2.0.
|
|
13
|
+
https://github.com/google-deepmind/mujoco
|
|
14
|
+
Only the public C API headers are bundled; the MuJoCo library itself is a
|
|
15
|
+
runtime dependency installed via the `mujoco` PyPI package.
|
|
16
|
+
|
|
17
|
+
Google Filament (statically linked into the native extension)
|
|
18
|
+
Copyright Google LLC
|
|
19
|
+
Licensed under the Apache License, Version 2.0.
|
|
20
|
+
https://github.com/google/filament
|
mujofil-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: mujofil
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MuJoCo + Google Filament — high-fidelity, faster-than-OpenGL PBR rendering for MuJoCo
|
|
5
|
+
Keywords: mujoco,filament,rendering,pbr,robotics,simulation
|
|
6
|
+
Author: MuJoFil Contributors
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Project-URL: Homepage, https://github.com/tau-intelligence/MuJoCo-Filament
|
|
9
|
+
Project-URL: Source, https://github.com/tau-intelligence/MuJoCo-Filament
|
|
10
|
+
Project-URL: Issues, https://github.com/tau-intelligence/MuJoCo-Filament/issues
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Requires-Dist: mujoco>=3.0
|
|
13
|
+
Requires-Dist: numpy>=1.24
|
|
14
|
+
Provides-Extra: gym
|
|
15
|
+
Requires-Dist: gymnasium>=0.29; extra == "gym"
|
|
16
|
+
Provides-Extra: examples
|
|
17
|
+
Requires-Dist: imageio; extra == "examples"
|
|
18
|
+
Requires-Dist: pillow; extra == "examples"
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# MuJoFil — MuJoCo + Google Filament
|
|
22
|
+
|
|
23
|
+
High-fidelity, **physically-based** rendering for [MuJoCo](https://mujoco.org),
|
|
24
|
+
powered by [Google Filament](https://google.github.io/filament/) instead of the
|
|
25
|
+
legacy fixed-function OpenGL path — sharper materials, real image-based lighting,
|
|
26
|
+
and faster frames on modern GPUs.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install mujofil
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
That's it. The Filament engine is **statically compiled into the wheel** and the
|
|
33
|
+
material packages ship inside it, so there's no separate SDK, no compiler, and no
|
|
34
|
+
`PYTHONPATH` setup. MuJoCo itself comes from its own pip wheel (a dependency).
|
|
35
|
+
|
|
36
|
+
> ## ⚠️ One thing pip can't install for you: a **Vulkan GPU driver**
|
|
37
|
+
> MuJoFil renders on the GPU via Vulkan (with an OpenGL fallback). That driver is
|
|
38
|
+
> part of your operating system and **cannot** be bundled in a wheel. MuJoFil
|
|
39
|
+
> detects this for you — if it's missing you'll see a clear message on first
|
|
40
|
+
> `import mujofil`, and `mujofil-doctor` prints exactly what to install:
|
|
41
|
+
>
|
|
42
|
+
> | OS | Install command |
|
|
43
|
+
> |----|-----------------|
|
|
44
|
+
> | Ubuntu/Debian | `sudo apt install libvulkan1 mesa-vulkan-drivers vulkan-tools` |
|
|
45
|
+
> | Fedora | `sudo dnf install vulkan-loader mesa-vulkan-drivers vulkan-tools` |
|
|
46
|
+
> | Arch | `sudo pacman -S vulkan-icd-loader vulkan-tools <gpu-vulkan-driver>` |
|
|
47
|
+
> | macOS | LunarG Vulkan SDK (MoltenVK): https://vulkan.lunarg.com/sdk/home#mac |
|
|
48
|
+
> | Windows | Latest GPU driver, or LunarG SDK: https://vulkan.lunarg.com |
|
|
49
|
+
>
|
|
50
|
+
> NVIDIA GPUs also need the proprietary driver. Headless/no-GPU machines can use
|
|
51
|
+
> the software rasterizer (`mesa-vulkan-drivers`, "lavapipe"). After installing,
|
|
52
|
+
> run **`mujofil-doctor`** to confirm.
|
|
53
|
+
|
|
54
|
+
## Verify your setup
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
mujofil-doctor # prints a GPU/Vulkan diagnostic; exit 0 = ready to render
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Quick start
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
import mujoco
|
|
64
|
+
from mujofil import VFRenderer, RenderConfig
|
|
65
|
+
|
|
66
|
+
model = mujoco.MjModel.from_xml_path("scene.xml")
|
|
67
|
+
data = mujoco.MjData(model)
|
|
68
|
+
|
|
69
|
+
r = VFRenderer(model, RenderConfig(width=1920, height=1080))
|
|
70
|
+
mujoco.mj_step(model, data)
|
|
71
|
+
rgb = r.render(data) # (H, W, 3) uint8
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## What ships in the wheel
|
|
75
|
+
|
|
76
|
+
* `mujofil/_vf_mujoco_native.*.so` — the Filament renderer (Filament linked
|
|
77
|
+
statically; only `libc++`/`libunwind` bundled alongside via `auditwheel`).
|
|
78
|
+
* `mujofil/materials/*.filamat` — precompiled Filament material packages.
|
|
79
|
+
* Pure-Python API (`VFRenderer`, `RenderConfig`, `VFRenderWrapper`).
|
|
80
|
+
|
|
81
|
+
MuJoCo is **not** bundled — the bindings read `mjModel`/`mjData` through pointers
|
|
82
|
+
and call no MuJoCo functions, so the `mujoco` pip package satisfies it at runtime.
|
|
83
|
+
|
|
84
|
+
## Requirements
|
|
85
|
+
|
|
86
|
+
* A GPU with a working **Vulkan** (preferred) or OpenGL driver — same as any
|
|
87
|
+
realtime renderer. For headless CI, a software Vulkan (e.g. lavapipe) works.
|
|
88
|
+
* Linux x86-64 (manylinux wheels). macOS / Windows wheels are produced by the
|
|
89
|
+
same `cibuildwheel` config.
|
|
90
|
+
|
|
91
|
+
## Building from source
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
export FILAMENT_DIR=/path/to/filament # a Filament release
|
|
95
|
+
pip install . # scikit-build-core + CMake
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Multi-platform release wheels are built in CI with `cibuildwheel`.
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
Apache 2.0 License
|
mujofil-0.1.0/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# MuJoFil — MuJoCo + Google Filament
|
|
2
|
+
|
|
3
|
+
High-fidelity, **physically-based** rendering for [MuJoCo](https://mujoco.org),
|
|
4
|
+
powered by [Google Filament](https://google.github.io/filament/) instead of the
|
|
5
|
+
legacy fixed-function OpenGL path — sharper materials, real image-based lighting,
|
|
6
|
+
and faster frames on modern GPUs.
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pip install mujofil
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
That's it. The Filament engine is **statically compiled into the wheel** and the
|
|
13
|
+
material packages ship inside it, so there's no separate SDK, no compiler, and no
|
|
14
|
+
`PYTHONPATH` setup. MuJoCo itself comes from its own pip wheel (a dependency).
|
|
15
|
+
|
|
16
|
+
> ## ⚠️ One thing pip can't install for you: a **Vulkan GPU driver**
|
|
17
|
+
> MuJoFil renders on the GPU via Vulkan (with an OpenGL fallback). That driver is
|
|
18
|
+
> part of your operating system and **cannot** be bundled in a wheel. MuJoFil
|
|
19
|
+
> detects this for you — if it's missing you'll see a clear message on first
|
|
20
|
+
> `import mujofil`, and `mujofil-doctor` prints exactly what to install:
|
|
21
|
+
>
|
|
22
|
+
> | OS | Install command |
|
|
23
|
+
> |----|-----------------|
|
|
24
|
+
> | Ubuntu/Debian | `sudo apt install libvulkan1 mesa-vulkan-drivers vulkan-tools` |
|
|
25
|
+
> | Fedora | `sudo dnf install vulkan-loader mesa-vulkan-drivers vulkan-tools` |
|
|
26
|
+
> | Arch | `sudo pacman -S vulkan-icd-loader vulkan-tools <gpu-vulkan-driver>` |
|
|
27
|
+
> | macOS | LunarG Vulkan SDK (MoltenVK): https://vulkan.lunarg.com/sdk/home#mac |
|
|
28
|
+
> | Windows | Latest GPU driver, or LunarG SDK: https://vulkan.lunarg.com |
|
|
29
|
+
>
|
|
30
|
+
> NVIDIA GPUs also need the proprietary driver. Headless/no-GPU machines can use
|
|
31
|
+
> the software rasterizer (`mesa-vulkan-drivers`, "lavapipe"). After installing,
|
|
32
|
+
> run **`mujofil-doctor`** to confirm.
|
|
33
|
+
|
|
34
|
+
## Verify your setup
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
mujofil-doctor # prints a GPU/Vulkan diagnostic; exit 0 = ready to render
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
import mujoco
|
|
44
|
+
from mujofil import VFRenderer, RenderConfig
|
|
45
|
+
|
|
46
|
+
model = mujoco.MjModel.from_xml_path("scene.xml")
|
|
47
|
+
data = mujoco.MjData(model)
|
|
48
|
+
|
|
49
|
+
r = VFRenderer(model, RenderConfig(width=1920, height=1080))
|
|
50
|
+
mujoco.mj_step(model, data)
|
|
51
|
+
rgb = r.render(data) # (H, W, 3) uint8
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## What ships in the wheel
|
|
55
|
+
|
|
56
|
+
* `mujofil/_vf_mujoco_native.*.so` — the Filament renderer (Filament linked
|
|
57
|
+
statically; only `libc++`/`libunwind` bundled alongside via `auditwheel`).
|
|
58
|
+
* `mujofil/materials/*.filamat` — precompiled Filament material packages.
|
|
59
|
+
* Pure-Python API (`VFRenderer`, `RenderConfig`, `VFRenderWrapper`).
|
|
60
|
+
|
|
61
|
+
MuJoCo is **not** bundled — the bindings read `mjModel`/`mjData` through pointers
|
|
62
|
+
and call no MuJoCo functions, so the `mujoco` pip package satisfies it at runtime.
|
|
63
|
+
|
|
64
|
+
## Requirements
|
|
65
|
+
|
|
66
|
+
* A GPU with a working **Vulkan** (preferred) or OpenGL driver — same as any
|
|
67
|
+
realtime renderer. For headless CI, a software Vulkan (e.g. lavapipe) works.
|
|
68
|
+
* Linux x86-64 (manylinux wheels). macOS / Windows wheels are produced by the
|
|
69
|
+
same `cibuildwheel` config.
|
|
70
|
+
|
|
71
|
+
## Building from source
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
export FILAMENT_DIR=/path/to/filament # a Filament release
|
|
75
|
+
pip install . # scikit-build-core + CMake
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Multi-platform release wheels are built in CI with `cibuildwheel`.
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
Apache 2.0 License
|