Skip to main content

Utilities to get materials stored on a remote server

Project description

MaterialX Materials

Introduction

Welcome to MaterialX Materials.

This site hosts a set of libraries and command line utilities to query remote databases for MaterialX materials.

> Visit the Home Page

Related utilities and libraries can be found at the:

The current utilities support:

PhysicallyBased database Material descriptions can be downloaded with additional utilities to create materials using either: Autodesk Standard Surface, OpenPBR, or glTF PBR shading model shaders.

AMD GPUOpen database MaterialX packages can be downloaded (as zip files). Images and MaterialX documents can be extracted for any of the posted materials in the database.

ambientCG database MaterialX packages can be downloaded (as zip files). Images and MaterialX documents can be extracted for any of the posted materials in the database.

Each currently has Python implementations.

<iframe src="https://www.youtube.com/embed/4KiPW9IUR6U?rel=0&vq=hd1080" title="Using Material Libraries" width="100%" height="600px" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen> </iframe>

Usage Examples

A. PhysicallyBased

An interactive page:

for extracting PhysicallyBased uses a Javascript implementation found here


B. AMD GPUOpen

A command line utility is available here. This uses Node.js to allow access to fetch materials from the GPU Open site(which is not available via a web page).

A Flask application is also available which uses the Python package with a Web based front here.


C. Loading into Web Editor

Below are screenshots of materials fetched from from PhysicallyBased and GPU Open and ambientCg> (left to right images respectively). Note that the material zip from GPU Open and ambientCg is directly read into the editor via it's zip loading option.

Library Dependencies

The Python utilities require:

  1. The MaterialX 1.39 or greater package for PhysicallyBased OpenPBR shader creation
  2. The requests package.
  3. The pillow package for image handling for GPUOpen package handling

The GPUOpen Javascript logic requires:

  1. node-fetch if fetch is not available in the version of Node.js used.
  2. yargs for the command line utility

Package Building

The GitHub repository can be cloned.

The Python package can be built using:

pip install .

This will pull down the dependent Python packages as needed.

Build scripts can be found in the utilities folder.

  • build.sh will install the package and run package commands to update package data.
  • buildDocs.sh will prepare documents and run Doxygen to build API docs.

The GPUOpen Javascript utility requires Node.js to be installed. From the package folder (javascript\JsGPUOpenLoaderPackage) the following should be run:

npm install     # Install dependent packages
npm run build   # Setup runtime area

Usage

Python Commands

  • Query all materials fom PhysicallyBased and convert them to all support shading models. Save the material list and corresponding MaterialX files in the default output location. The build will include this information Python package under the data folder.

    python physicallyBasedMaterialXCmd.py
    

    or

    materialxMaterials physbased
    
  • Query all materials fom GPUOpen. Extract out a few material packages (zip). Save the material lists, material names and unzipped packages (MaterialX and images) in the default output location. The build will include this information Python package under the data folder.

    materialxMaterials gpuopen --materialNames=1 --saveMaterials=1
    
  • Download the materials list fom ambientCG:

    materialxMaterials acg --saveMaterials True
    
  • Extract out a material package for the "WoodFloor038" material from ambientCG requesting the package where the images are 2K PNG files:

    materialxMaterials acg --downloadMaterial "WoodFloor038" --downloadResolution 2
    

GPU Open Node.js Utility

The utility can be run from the javascript\JsGPUOpenLoaderPackage folder as follows:

npm start -- [<arguments>]

or:

node gpuOpenFetch.js [<arguments>]

with the appropriate arguments. It supports the same options as the Python utility -- namely material information, and package (zip) downloads. For the following 2 lines are equivalent to download a material called "Moss Green Solid Granite".

node gpuOpenFetch.js  -n "Moss Green Solid Granite"
npm start -- -n "Moss Green Solid Granite"

Library

A Jupyter notebook demonstrates the direct usage of the Python library. The output of the notebook can be found here. The notebook can found in the Github repository under the examples folder.

Results

The following are some samples which have been rendered using the MaterialXView utility which is part of the MaterialX binary distribution.

Examples

Details about some examples can be found in the Examples pages
Emerald Peaks Wallpaper Indigo Palm Wallpaper Oliana Blue Painted Wood
Ketchup Cooking Oil Brass
Metal (53) Paving Stones (142) Wood Floor (38)
The rows of materials are from `GPUOpen` `PhysicallyBased`, and `ambientCG` from top to bottom respectively.

API Reference

The API reference can be found here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

materialxmaterials-0.0.2.tar.gz (30.8 kB view details)

Uploaded Source

Built Distribution

materialxMaterials-0.0.2-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file materialxmaterials-0.0.2.tar.gz.

File metadata

  • Download URL: materialxmaterials-0.0.2.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0

File hashes

Hashes for materialxmaterials-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8253ccca3a31d28903cc48461888fdd376078a5b89f851d948f1c18b64c74a95
MD5 7d24f571394fb8b537a4cd671ae68699
BLAKE2b-256 98d225d377b109255adc9fa5fa802b1ad9c5c612aab29b31a75df611e8b389bc

See more details on using hashes here.

File details

Details for the file materialxMaterials-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for materialxMaterials-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7a142587caa3751d5c7b262722505167ad21be040b988b531e2e729681be9746
MD5 de60b78a9d917ce8a958b7690463fa75
BLAKE2b-256 128944a4f3dd793f9bb407f19bbcf72cfa603975df1788061724672da234c786

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page