Skip to content

Commit

Permalink
Added section describing the MaterialX Python API. (#1567)
Browse files Browse the repository at this point in the history
...to mention the `MaterialX` Python package, and the way it's typically
aliased as `mx` upon `import`.

Also removed the paragraph about the MaterialX.org site, as it seemed
unnecessary.

Also added a link to the auto-generated alphabetical index to the TOC.

Signed-off-by: Stefan Habel <[email protected]>
  • Loading branch information
StefanHabel committed Oct 21, 2023
1 parent b8eecc0 commit bf427e4
Showing 1 changed file with 42 additions and 5 deletions.
47 changes: 42 additions & 5 deletions documents/DeveloperGuide/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MaterialX Python API Documentation
==================================

The MaterialX Python API provides Python bindings for the
The `MaterialX Python API`_ provides Python bindings for the
`MaterialX C++ API <https://materialx.org/docs/api/>`_ .

MaterialX is an open standard for representing rich material and look-development
Expand All @@ -15,10 +15,6 @@ Adobe, and SideFX contributing to its ongoing development. In 2021, MaterialX
became the seventh hosted project of the `Academy Software Foundation
<https://www.aswf.io/>`_ .

General information about MaterialX, announcements, events, third-party support,
and contributing to MaterialX is available at
`MaterialX.org <https://materialx.org/>`_ .

.. toctree::
:maxdepth: 1

Expand All @@ -28,6 +24,43 @@ and contributing to MaterialX is available at
ShaderGeneration.md


MaterialX Python API
--------------------

The MaterialX Python API consists of two parts:

- A set of `MaterialX Python Modules`_ that are implemented as Python C
extensions that correspond to MaterialX C++ libraries.
- A Python package named `MaterialX` that wraps the MaterialX Python modules to
provide a more pythonic interface, in particular for working with the
`Element Classes <generated/PyMaterialXCore.html#element-classes>`_ and
`Value Classes <generated/PyMaterialXCore.html#value-classes>`_ of
`PyMaterialXCore`.

The `MaterialX` Python package is typically imported aliased as `mx`:

.. code:: python
import MaterialX as mx
All functions and classes from the `PyMaterialXCore` and `PyMaterialXFormat`
modules are available in the top-level `MaterialX` namespace.

For example, the `PyMaterialXCore.Matrix44` class is available as
`MaterialX.Matrix44`:

.. code:: python
>>> import MaterialX as mx
>>> mx.Matrix44
<class 'MaterialX.PyMaterialXCore.Matrix44'>
You can use the *Quick search* box in the sidebar on the left to quickly find
documentation for a particular function or class of interest, for example
`getUdimCoordinates <search.html?q=getUdimCoordinates>`_
or `MeshPartition <search.html?q=MeshPartition>`_.


MaterialX Python Modules
------------------------

Expand All @@ -46,3 +79,7 @@ MaterialX Python Modules
PyMaterialXRenderGlsl
PyMaterialXRenderOsl
PyMaterialXRenderMsl

.. toctree::

genindex

0 comments on commit bf427e4

Please sign in to comment.