### Install and Run MakeHuman Source: https://context7.com/makehumancommunity/makehuman/llms.txt Steps to install Python dependencies, download assets, pre-compile components, and start the MakeHuman application. Includes a command to check the version. ```bash # Install Python dependencies pip install -r requirements.txt # numpy>=1.17.4, PyQt5>=12.8, PyOpenGL>=3.1.0 # (First run) download bundled assets via git-lfs python makehuman/download_assets_git.py # Optionally pre-compile targets, models, and proxies for faster startup python makehuman/compile_targets.py python makehuman/compile_models.py python makehuman/compile_proxies.py # Start MakeHuman python makehuman/makehuman.py # Windows python3 makehuman/makehuman.py # Linux / macOS # Check version python3 makehuman/makehuman.py --version # Output: MakeHuman 1.3.0 alpha ``` -------------------------------- ### Build Windows Installer with PyNSIST Source: https://context7.com/makehumancommunity/makehuman/llms.txt Builds a Windows installer using PyNSIST. It navigates to the win32 build scripts directory and executes the build script. Requires PyNSIST and NSIS to be installed. ```bash cd buildscripts/win32 python makePynsistBuild.py ``` -------------------------------- ### Get MakeHuman File-System Paths Source: https://context7.com/makehumancommunity/makehuman/llms.txt Resolve installation and user-data directory paths using the `mhapi.locations` module. Ensures paths are unicode-safe and cross-platform. ```python import gui3d mhapi = gui3d.app.mhapi locs = mhapi.locations # Where MakeHuman is installed print(locs.getInstallationPath()) # /usr/share/makehuman print(locs.getInstallationPath("plugins")) # /usr/share/makehuman/plugins # System-bundled data print(locs.getSystemDataPath()) # /usr/share/makehuman/data print(locs.getSystemDataPath("skins")) # /usr/share/makehuman/data/skins # Per-user working directory (~home/makehuman/) print(locs.getUserHomePath()) # /home/user/makehuman print(locs.getUserHomePath("models")) # /home/user/makehuman/models # Per-user data assets print(locs.getUserDataPath("clothes")) # /home/user/makehuman/data/clothes # Ensure an arbitrary path is absolute and unicode-encoded safe = locs.getUnicodeAbsPath("../relative/path") ``` -------------------------------- ### Start MakeHuman on Windows Source: https://github.com/makehumancommunity/makehuman/blob/master/README.md Launches the MakeHuman application from the command line on a Windows system. ```bash python makehuman.py ``` -------------------------------- ### Install Python Dependencies on openSUSE Source: https://github.com/makehumancommunity/makehuman/blob/master/README.md Installs core Python dependencies for MakeHuman on openSUSE using zypper. ```bash zypper install python3-numpy python3-qt5 python3-opengl ``` -------------------------------- ### Install Python Dependencies using Pip Source: https://github.com/makehumancommunity/makehuman/blob/master/README.md Installs all Python dependencies from the requirements.txt file using pip. It is recommended to activate a virtual environment before running this command. ```bash pip install -r requirements.txt ``` -------------------------------- ### Start MakeHuman on Linux Source: https://github.com/makehumancommunity/makehuman/blob/master/README.md Launches the MakeHuman application from the command line on Linux systems (Debian, Ubuntu, Mint). ```bash python3 makehuman.py ``` -------------------------------- ### Install Required Dependencies (Minimal) Source: https://github.com/makehumancommunity/makehuman/blob/master/buildscripts/rpm/README.txt Installs only the essential Python 3 dependencies for MakeHuman using yum. ```bash yum install python3-numpy python3-pyopengl python3-QtPy ``` -------------------------------- ### Install Mercurial (hg) Source: https://github.com/makehumancommunity/makehuman/blob/master/buildscripts/rpm/README.txt Installs the Mercurial distributed version control system using yum. ```bash yum install mercurial ``` -------------------------------- ### Build macOS Bundle with py2app Source: https://context7.com/makehumancommunity/makehuman/llms.txt Builds a macOS application bundle using py2app. It navigates to the darwin build scripts directory and executes the setup script. ```bash cd buildscripts/darwin python setup.py py2app ``` -------------------------------- ### mhapi.locations — File-System Paths Source: https://context7.com/makehumancommunity/makehuman/llms.txt Resolve installation and user-data directory paths in a unicode-safe, cross-platform manner. ```APIDOC ## mhapi.locations — File-System Paths ### Description Resolve installation and user-data directory paths in a unicode-safe, cross-platform manner. ### Usage ```python import gui3d mhapi = gui3d.app.mhapi locs = mhapi.locations # Where MakeHuman is installed print(locs.getInstallationPath()) # /usr/share/makehuman print(locs.getInstallationPath("plugins")) # /usr/share/makehuman/plugins # System-bundled data print(locs.getSystemDataPath()) # /usr/share/makehuman/data print(locs.getSystemDataPath("skins")) # /usr/share/makehuman/data/skins # Per-user working directory (~home/makehuman/) print(locs.getUserHomePath()) # /home/user/makehuman print(locs.getUserHomePath("models")) # /home/user/makehuman/models # Per-user data assets print(locs.getUserDataPath("clothes")) # /home/user/makehuman/data/clothes # Ensure an arbitrary path is absolute and unicode-encoded safe = locs.getUnicodeAbsPath("../relative/path") ``` ``` -------------------------------- ### Install Python Dependencies on Linux Source: https://github.com/makehumancommunity/makehuman/blob/master/README.md Installs core Python dependencies for MakeHuman on Debian-based systems using apt. Ensure you are using a virtual environment for best practices. ```bash apt install python3-opengl python3-pyqt5 python3-pyqt5.qtopengl python3-pyqt5.qtsvg ``` -------------------------------- ### Get Compatible URL Fetcher Source: https://context7.com/makehumancommunity/makehuman/llms.txt Retrieves a URL fetching utility that is compatible with both Python 2 and Python 3 environments. ```python fetcher = util.getCompatibleUrlFetcher() # urllib.request on Py3 ``` -------------------------------- ### Get Current Pose as Animation Source: https://context7.com/makehumancommunity/makehuman/llms.txt Captures the current pose of the skeleton rig and returns it as an animation object. ```python anim = skel_api.getPoseAsAnimation() print(anim.name if anim else "No active animation") ``` -------------------------------- ### Build Debian/Ubuntu .deb Package Source: https://context7.com/makehumancommunity/makehuman/llms.txt Builds a .deb package for Debian/Ubuntu systems. It navigates to the deb build scripts directory and executes the build script. Optionally, system dependencies can be installed first. ```bash cd buildscripts/deb python buildDeb.py # Installs system dependencies first (optional): bash install_deb_dependencies.bash ``` -------------------------------- ### Get MakeHuman Version Information Source: https://context7.com/makehumancommunity/makehuman/llms.txt Retrieve detailed version information of the running MakeHuman application, including full version string, numeric components, branch, and revision. ```python import gui3d mhapi = gui3d.app.mhapi v = mhapi.version print(v.getFullVersion()) # "MakeHuman 1.3.0 alpha" print(v.getVersionNumberAsString()) # "1.3.0" print(v.getVersionNumberAsArray()) # [1, 3, 0] print(v.getBranch()) # "default" (or None if not in an Hg repo) print(v.getRevision()) # "r1604 (d48f36771cc0)" (or None) ``` -------------------------------- ### Export Character with Custom Path using OBJ Exporter Source: https://context7.com/makehumancommunity/makehuman/llms.txt Demonstrates how to get a specific exporter (OBJ in this case) and use it to export the selected human model to a custom file path. ```python obj_exporter = exp.getOBJExporter() human = gui3d.app.selectedHuman obj_exporter.export(human, lambda ext: "/tmp/output/character.obj") ``` -------------------------------- ### Build RPM Package Source: https://github.com/makehumancommunity/makehuman/blob/master/buildscripts/rpm/README.txt Builds an RPM package for MakeHuman after ensuring mercurial and rpmbuild are installed. The build process can be customized via buildscripts/build.conf. ```bash ./buildRpm.py ``` -------------------------------- ### Get Bone Pose Matrices Source: https://context7.com/makehumancommunity/makehuman/llms.txt Retrieves the pose data for bones. It iterates through the first two bones and prints their names and the first element of their matrices. ```python pose = mh_call("getPose") for bone_name, matrix in list(pose["data"].items())[:2]: print(bone_name, matrix[0]) ``` -------------------------------- ### Socket Call: Get System Directory Source: https://context7.com/makehumancommunity/makehuman/llms.txt Retrieves the system data directory path from MakeHuman via the socket server. Returns a JSON object with 'data' and 'error' fields. ```python print(mh_call("getSysDir")) # {"data": "/usr/share/makehuman", "error": null} ``` -------------------------------- ### Discover and Equip Assets with mhapi.assets Source: https://context7.com/makehumancommunity/makehuman/llms.txt Discover available system and user assets (skins, hair, clothing, etc.), equip proxy meshes on the human, and read/write asset metadata. ```python import gui3d mhapi = gui3d.app.mhapi assets = mhapi.assets # --- Discover assets --- print(assets.getAssetTypes()) # ['material','model','clothes','hair','teeth','eyebrows','eyelashes', # 'tongue','eyes','proxy','skin','pose','expression','rig','target', ...] skins = assets.getAvailableSystemSkins() # list of absolute .mhmat paths hair = assets.getAvailableSystemHair() # list of absolute .mhclo paths user_clothes = assets.getAvailableUserClothes() # --- Equip / unequip proxy assets --- hair_file = skins[0].replace("skins", "hair").replace(".mhmat", ".mhclo") assets.equipHair("/path/to/data/hair/short01/short01.mhclo") print(assets.getEquippedHair()) # '/path/to/.../short01.mhclo' assets.unequipHair("/path/to/data/hair/short01/short01.mhclo") assets.equipClothes("/path/to/data/clothes/shirt01/shirt01.mhclo") assets.equipClothes("/path/to/data/clothes/jeans01/jeans01.mhclo") print(assets.getEquippedClothes()) # ['/path/.../shirt01.mhclo', ...] assets.unequipAllClothes() assets.equipEyebrows("/path/to/data/eyebrows/HighArch/HighArch.mhclo") assets.equipEyelashes("/path/to/data/eyelashes/default/default.mhclo") # --- Parse an asset file into a metadata dict --- info = assets.openAssetFile("/path/to/data/skins/default.mhmat", strip=True) print(info["name"]) print(info["diffuseColor"]) print(info["tag"]) # --- Read a material object into a Python dict (for socket transfer etc.) --- human = gui3d.app.selectedHuman mat_hash = assets.materialToHash(human.material) print(mat_hash["diffuseColor"]) print(mat_hash["diffuseTexture"]) # --- Resolve a user-facing asset title to its filesystem path --- path = assets.getAssetLocation("My Character", "model") # -> /home/user/makehuman/models/My_Character # --- Write modified metadata back to disk (with automatic .bak backup) --- info["description"] = "Updated skin material" assets.writeAssetFile(info, createBackup=True) ``` -------------------------------- ### Get Type and Value as Strings Source: https://context7.com/makehumancommunity/makehuman/llms.txt Provides utility functions to get string representations of Python types and values, useful for debugging and logging. Works with NumPy arrays and dictionaries. ```python import numpy as np arr = np.array([1.0, 2.0, 3.0], dtype=np.float32) print(util.getTypeAsString(arr)) # "array(f)" print(util.getTypeAsString({"a": 1})) # "dict" print(util.getValueAsString(3.14159)) # "3.1416" ``` -------------------------------- ### Configure Socket Server Auto-Start Source: https://context7.com/makehumancommunity/makehuman/llms.txt Creates or updates the socket.cfg file to control the automatic startup of the MakeHuman socket server on application launch. Requires restarting MakeHuman for changes to take effect. ```python import json, os cfg_path = os.path.expanduser("~/makehuman/socket.cfg") config = { "acceptConnections": True, "advanced": False, "host": "127.0.0.1", "port": 12345 } with open(cfg_path, "w") as f: json.dump(config, f, indent=4) # Restart MakeHuman – the socket will open automatically on launch. ``` -------------------------------- ### Prepare Export Tree for Builds Source: https://context7.com/makehumancommunity/makehuman/llms.txt Prepares a clean export tree used by all build scripts. This command can mark builds as releases, override the version string, and specify the destination directory. ```bash python buildscripts/build_prepare.py \ --release \ --version 1.3.0 \ --dest /tmp/mh-build ``` -------------------------------- ### Get Base Skeleton Source: https://context7.com/makehumancommunity/makehuman/llms.txt Retrieves the base skeleton structure, distinct from the currently applied pose or rig. ```python base_skel = skel_api.getBaseSkeleton() ``` -------------------------------- ### Run MakeHuman Source: https://github.com/makehumancommunity/makehuman/blob/master/buildscripts/rpm/README.txt Executes the MakeHuman application from its source directory. It is recommended to run this as a normal desktop user. ```bash cd makehuman/makehuman python makehuman.py ``` -------------------------------- ### Utility API Source: https://context7.com/makehumancommunity/makehuman/llms.txt Provides runtime utilities for detecting the Python/Qt environment and managing named log channels for plugin output. ```APIDOC ## Utility API Detect the Python/Qt environment and manage named log channels for plugin output. ### Environment Detection ```python util.isPython3() util.isPySideAvailable() util.isPyQtAvailable() ``` ### Log Channels ```python log = util.getLogChannel("my_plugin", defaultLevel=2, mirrorToMHLog=False) log.debug("Diagnostic message") ``` ### Type/value introspection helpers ```python util.getTypeAsString(variable) util.getValueAsString(variable) ``` ### URL fetcher ```python fetcher = util.getCompatibleUrlFetcher() ``` ``` -------------------------------- ### Apply Full-Body Pose from BVH File Source: https://context7.com/makehumancommunity/makehuman/llms.txt Applies a full-body pose to the skeleton by loading it from a .bvh file. Ensure the BVH file path is correctly specified. ```python bvh_path = mhapi.locations.getUserDataPath("poses/my_pose.bvh") skel_api.setPoseFromFile(bvh_path) ``` -------------------------------- ### Get Proxy List Information Source: https://context7.com/makehumancommunity/makehuman/llms.txt Retrieves information about proxy objects. It iterates through the list of proxies and prints their name, type, and vertex count. ```python proxies = mh_call("getProxiesInfo") for p in proxies["data"]: print(p["name"], p["type"], p["numVertices"]) ``` -------------------------------- ### Build RPM Package Source: https://context7.com/makehumancommunity/makehuman/llms.txt Builds an RPM package. It navigates to the rpm build scripts directory and executes the build script. ```bash cd buildscripts/rpm bash make_rpm.bash ``` -------------------------------- ### Socket Call: Get Available Modifier Names Source: https://context7.com/makehumancommunity/makehuman/llms.txt Fetches a list of all available modifier names that can be applied to a character in MakeHuman. The result is returned in the 'data' field of the JSON response. ```python result = mh_call("getAvailableModifierNames") print(result["data"][:3]) # ['breast/BreastFirmness', 'breast/BreastSize', 'camera/focalLength'] ``` -------------------------------- ### mhapi.version — Version Information Source: https://context7.com/makehumancommunity/makehuman/llms.txt Retrieve the running application's version details, including numeric components and the full descriptive string. ```APIDOC ## mhapi.version — Version Information ### Description Retrieve the running application's version details, including numeric components and the full descriptive string. ### Usage ```python import gui3d mhapi = gui3d.app.mhapi v = mhapi.version print(v.getFullVersion()) # "MakeHuman 1.3.0 alpha" print(v.getVersionNumberAsString()) # "1.3.0" print(v.getVersionNumberAsArray()) # [1, 3, 0] print(v.getBranch()) # "default" (or None if not in an Hg repo) print(v.getRevision()) # "r1604 (d48f36771cc0)" (or None) ``` ``` -------------------------------- ### Socket Call: Get Applied Targets Source: https://context7.com/makehumancommunity/makehuman/llms.txt Retrieves a dictionary of all currently applied targets (modifiers and their values) on the character. Useful for inspecting the current state of the character's customization. ```python result = mh_call("getAppliedTargets") for target, value in result["data"].items(): print(f"{target}: {value}") # nose/nose-scale-horiz-decr.target: 0.5 # forehead/ForeheadHeight.target: 0.7 ```