Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphinx Python Documentation #1567

Draft
wants to merge 55 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
bef6e1f
Update #342 Sphinx Python Documentation.
StefanHabel Oct 13, 2023
9d4b492
Sphinx Python Documentation (#1567) - Added MATERIALX_BUILD_PYTHON_DO…
StefanHabel Oct 18, 2023
e129d65
Sphinx Python Documentation (#1567) - Updated Markdown files to use a…
StefanHabel Oct 18, 2023
6a5da31
Sphinx Python Documentation (#1567) - Revised `index.rst`.
StefanHabel Oct 18, 2023
e1113ea
Sphinx Python Documentation (#1567) - Resolved import order dependenc…
StefanHabel Oct 18, 2023
e4382bb
Sphinx Python Documentation (#1567) - Tweaked Sphinx configuration.
StefanHabel Oct 18, 2023
c983b87
Sphinx Python Documentation (#1567) - Fixed a couple of typos in head…
StefanHabel Oct 18, 2023
3567610
Sphinx Python Documentation (#1567) - Added define to produce detaile…
StefanHabel Oct 18, 2023
abc2edb
Sphinx Python Documentation (#1567) - Added docstrings to PyMaterialX…
StefanHabel Oct 18, 2023
133a0b4
Sphinx Python Documentation (#1567) - Added docstrings to PyMaterialX…
StefanHabel Oct 18, 2023
67bb241
Sphinx Python Documentation (#1567) - Added docstrings to PyMaterialX…
StefanHabel Oct 18, 2023
e715c0f
Sphinx Python Documentation (#1567) - Added docstrings to PyMaterialX…
StefanHabel Oct 18, 2023
6a9d8e5
Sphinx Python Documentation (#1567) - Added docstrings to PyMaterialX…
StefanHabel Oct 18, 2023
2c04542
Sphinx Python Documentation (#1567) - Added docstrings to PyMaterialX…
StefanHabel Oct 18, 2023
8790578
Sphinx Python Documentation (#1567) - Added docstrings to PyMaterialX…
StefanHabel Oct 18, 2023
0439c07
Sphinx Python Documentation (#1567) - Added docstrings to PyMaterialX…
StefanHabel Oct 18, 2023
1e745bd
Sphinx Python Documentation (#1567) - Added docstrings to PyMaterialX…
StefanHabel Oct 18, 2023
4c11bde
Sphinx Python Documentation (#1567) - Added docstrings to PyMaterialX…
StefanHabel Oct 18, 2023
9d73ddc
Sphinx Python Documentation (#1567) - Added docstrings to PyMaterialX…
StefanHabel Oct 18, 2023
0e1e502
Sphinx Python Documentation (#1567) - Updated listings of modules in …
StefanHabel Oct 18, 2023
805f13c
Sphinx Python Documentation (#1567) - Removed aliasing of `PyMaterial…
StefanHabel Oct 18, 2023
c0d65ed
Fixed a couple of typos in `MaterialXGenShader/Util.h`.
StefanHabel Oct 20, 2023
ab6860b
Added `PYMATERIALX_IMPORT_MODULE` macro to import a PyMaterialX module
StefanHabel Oct 20, 2023
26a972f
Added `PYMATERIALX_DOCSTRING` macro to erase the first newline character
StefanHabel Oct 20, 2023
b8eecc0
Added warnings and statistics to the Sphinx generation.
StefanHabel Oct 20, 2023
bf427e4
Added section describing the MaterialX Python API. (#1567)
StefanHabel Oct 21, 2023
fbe2947
Added links to source folders on GitHub to module template. (#1567)
StefanHabel Oct 21, 2023
f064a22
Extended build checks to warn about undocumented functions and method…
StefanHabel Oct 21, 2023
d30276b
Tweaked custom style sheet regarding highlighting and indexes. (#1567)
StefanHabel Oct 21, 2023
86030d0
More docstrings for methods in the `Element` class. (#1567)
StefanHabel Oct 21, 2023
90c78d4
Revised example code in utility functions of `PyMaterialXCore`. (#1567)
StefanHabel Oct 21, 2023
37f1ef5
Merge branch 'main' into #342-Sphinx-Python-Documentation
jstone-lucasfilm Oct 25, 2023
aed7f8f
Extended docstrings of `PyMaterialXCore` and `PyMaterialXFormat`. (#1…
StefanHabel Oct 22, 2023
052f38e
Tweaked module template to clarify module source links. (#1567)
StefanHabel Oct 22, 2023
939c996
Fixed a typo in messages at the end of the Sphinx build. (#1567)
StefanHabel Oct 22, 2023
77b5944
Exposed `Element.getChild()` in the Python API docs. (#1567)
StefanHabel Oct 22, 2023
be2db5e
More fixes in header files in MaterialXCore. (#1567)
StefanHabel Oct 31, 2023
71bd3fd
More fixes in header files. (#1567)
StefanHabel Oct 31, 2023
f7bea44
Tweaked `PYMATERIALX_DOCSTRING` macro to also trim the last character…
StefanHabel Oct 31, 2023
e66a3f5
Tweaked contents of index page. (#1567)
StefanHabel Oct 31, 2023
28fd863
Minor tweak of Jinja template for module pages. (#1567)
StefanHabel Oct 31, 2023
74872ea
Support for listing properties and attributes of classes separately. …
StefanHabel Oct 31, 2023
572089b
Tweaked style sheet. (#1567)
StefanHabel Oct 31, 2023
513ef90
Simplified detection of class names by defining a handler for 'autodo…
StefanHabel Oct 31, 2023
c9a2469
Docstrings for PyMaterialXCore. (#1567)
StefanHabel Oct 31, 2023
21eecdd
Docstrings for PyMaterialXFormat. (#1567)
StefanHabel Oct 31, 2023
40079f1
Docstrings for PyMaterialXGenGlsl. (#1567)
StefanHabel Oct 31, 2023
dfa106a
Docstrings for PyMaterialXGenMdl. (#1567)
StefanHabel Oct 31, 2023
f62be3a
Docstrings for PyMaterialXGenMsl. (#1567)
StefanHabel Oct 31, 2023
77ca69c
Docstrings for PyMaterialXGenOsl. (#1567)
StefanHabel Oct 31, 2023
6253abc
Docstrings for PyMaterialXGenShader. (#1567)
StefanHabel Oct 31, 2023
c1b31c0
Docstrings for PyMaterialXRender. (#1567)
StefanHabel Oct 31, 2023
0ca9f23
Docstrings for PyMaterialXRenderGlsl. (#1567)
StefanHabel Oct 31, 2023
f73acc4
ocstrings for PyMaterialXRenderMsl. (#1567)
StefanHabel Oct 31, 2023
b589282
Docstrings for PyMaterialXRenderOsl. (#1567)
StefanHabel Oct 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ enable_testing()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/cmake/modules")

# JavaScript setup
option(MATERIALX_BUILD_JS "Build the MaterialX JavaScript package from C++ bindings. Requires the emscripten environment." OFF)
Expand All @@ -37,6 +38,10 @@ option(MATERIALX_BUILD_PYTHON "Build the MaterialX Python package from C++ bindi
option(MATERIALX_BUILD_VIEWER "Build the MaterialX Viewer." OFF)
option(MATERIALX_BUILD_GRAPH_EDITOR "Build the MaterialX Graph Editor." OFF)
option(MATERIALX_BUILD_DOCS "Create HTML documentation using Doxygen. Requires that Doxygen be installed." OFF)
option(MATERIALX_BUILD_PYTHON_DOCS "Create HTML documentation using Sphinx. Requires that Sphinx be installed." OFF)
if (MATERIALX_BUILD_PYTHON_DOCS)
set(MATERIALX_BUILD_PYTHON ON)
endif()

option(MATERIALX_BUILD_GEN_GLSL "Build the GLSL shader generator back-end." ON)
option(MATERIALX_BUILD_GEN_OSL "Build the OSL shader generator back-end." ON)
Expand Down Expand Up @@ -125,6 +130,7 @@ message(STATUS "Setting namespace to '${MATERIALX_NAMESPACE}'")
set (MATERIALX_LIBNAME_SUFFIX "" CACHE STRING "Specify a suffix to all libraries that are built")

mark_as_advanced(MATERIALX_BUILD_DOCS)
mark_as_advanced(MATERIALX_BUILD_PYTHON_DOCS)
mark_as_advanced(MATERIALX_BUILD_GEN_GLSL)
mark_as_advanced(MATERIALX_BUILD_GEN_OSL)
mark_as_advanced(MATERIALX_BUILD_GEN_MDL)
Expand Down Expand Up @@ -331,7 +337,7 @@ if(MATERIALX_BUILD_PYTHON)
add_subdirectory(python)
endif()

if(MATERIALX_BUILD_DOCS)
if(MATERIALX_BUILD_DOCS OR MATERIALX_BUILD_PYTHON_DOCS)
add_subdirectory(documents)
endif()

Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="documents/Images/MaterialXLogo.png" height="170" />
<img src="https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXLogo.png" height="170" />
</p>

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/LICENSE)
Expand Down Expand Up @@ -32,29 +32,29 @@ The Python bindings for MaterialX are based on [PyBind11](https://github.com/pyb

The [MaterialX Viewer](documents/DeveloperGuide/Viewer.md) leverages shader generation to build GLSL shaders from MaterialX graphs, rendering the results using the NanoGUI framework.

Marble | Copper | Plastic | Carpaint
-------|--------|---------|---------
![MaterialX Marble material](https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXView_Marble.png) | ![MaterialX Copper material](https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXView_Copper.png) | ![MaterialX Plastic material](https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXView_Plastic.png) | ![MaterialX Carpaint material](https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXView_Carpaint.png) |

**Figure 1:** Procedural and uniform materials in the MaterialX viewer
<p float="left">
<img src="documents/Images/MaterialXView_Marble.png" width="204" />
<img src="documents/Images/MaterialXView_Copper.png" width="204" />
<img src="documents/Images/MaterialXView_Plastic.png" width="204" />
<img src="documents/Images/MaterialXView_Carpaint.png" width="204" />
</p>

Tiled Brass | Tiled Wood
------------|-----------
![MaterialX TiledBrass material](https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXView_TiledBrass.png) | ![MaterialX TiledWood material](https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/MaterialXView_TiledWood.png)

**Figure 2:** Textured, color-space-managed materials in the MaterialX viewer
<p float="left">
<img src="documents/Images/MaterialXView_TiledBrass.png" width="412" />
<img src="documents/Images/MaterialXView_TiledWood.png" width="412" />
</p>

### Open Chess Set

The Open Chess Set is an open reference asset, consisting of a [MaterialX file](resources/Materials/Examples/StandardSurface/standard_surface_chess_set.mtlx) in the Standard Surface shading model and a [geometry file](resources/Geometry) in the glTF format. It was authored by Moeen Sayed and Mujtaba Sayed, and was contributed to the MaterialX project by Side Effects.

![The Open Chess Set rendered in Arnold for Maya](https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/OpenChessSet_Arnold_01.png)

**Figure 3:** The Open Chess Set, rendered in Arnold for Maya
<img src="documents/Images/OpenChessSet_Arnold_01.png" />

![The Open Chess Set rendered in Karma XPU for Houdini](https://raw.githubusercontent.com/AcademySoftwareFoundation/MaterialX/main/documents/Images/OpenChessSet_Karma_01.png)

**Figure 4:** The Open Chess Set, rendered in Karma XPU for Houdini
<img src="documents/Images/OpenChessSet_Karma_01.png" />

### Pre-Built Binaries

Expand Down
20 changes: 20 additions & 0 deletions cmake/modules/FindSphinx.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
include(FindPackageHandleStandardArgs)

find_package(Python3)
if(PYTHON3_FOUND)
jstone-lucasfilm marked this conversation as resolved.
Show resolved Hide resolved
get_filename_component(_PYTHON_EXECUTABLE_DIR "${PYTHON_EXECUTABLE}" DIRECTORY)
set(
_SPHINX_SEARCH_PATHS
"${_PYTHON_EXECUTABLE_DIR}"
"${_PYTHON_EXECUTABLE_DIR}/bin"
"${_PYTHON_EXECUTABLE_DIR}/Scripts"
)

find_program(
SPHINX_EXECUTABLE
NAMES sphinx-build sphinx-build.exe
HINTS ${_SPHINX_SEARCH_PATHS})
mark_as_advanced(SPHINX_EXECUTABLE)

find_package_handle_standard_args(Sphinx DEFAULT_MSG SPHINX_EXECUTABLE)
endif()
144 changes: 112 additions & 32 deletions documents/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1,114 @@
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(DOXYGEN_HTML_OUTPUT_DIR ${DOXYGEN_OUTPUT_DIR}/html)
set(DOXYGEN_INPUT_LIST ${CMAKE_SOURCE_DIR}/documents/DeveloperGuide/MainPage.md
${CMAKE_SOURCE_DIR}/source/MaterialXCore
${CMAKE_SOURCE_DIR}/source/MaterialXFormat
${CMAKE_SOURCE_DIR}/source/MaterialXGenShader
${CMAKE_SOURCE_DIR}/source/MaterialXGenShader/Nodes
${CMAKE_SOURCE_DIR}/source/MaterialXGenGlsl
${CMAKE_SOURCE_DIR}/source/MaterialXGenGlsl/Nodes
${CMAKE_SOURCE_DIR}/source/MaterialXGenOsl
${CMAKE_SOURCE_DIR}/source/MaterialXGenMdl
${CMAKE_SOURCE_DIR}/source/MaterialXRender
${CMAKE_SOURCE_DIR}/source/MaterialXRenderHw
${CMAKE_SOURCE_DIR}/source/MaterialXRenderGlsl
${CMAKE_SOURCE_DIR}/source/MaterialXRenderOsl
)
string (REPLACE ";" " " DOXYGEN_INPUT_STR "${DOXYGEN_INPUT_LIST}")
# MaterialX C++ API Documentation
if(MATERIALX_BUILD_DOCS)
find_package(Doxygen)
if(DOXYGEN_FOUND)
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(DOXYGEN_HTML_OUTPUT_DIR ${DOXYGEN_OUTPUT_DIR}/html)
set(
DOXYGEN_INPUT_LIST
${CMAKE_SOURCE_DIR}/documents/DeveloperGuide/MainPage.md
${CMAKE_SOURCE_DIR}/source/MaterialXCore
${CMAKE_SOURCE_DIR}/source/MaterialXFormat
${CMAKE_SOURCE_DIR}/source/MaterialXGenShader
${CMAKE_SOURCE_DIR}/source/MaterialXGenShader/Nodes
${CMAKE_SOURCE_DIR}/source/MaterialXGenGlsl
${CMAKE_SOURCE_DIR}/source/MaterialXGenGlsl/Nodes
${CMAKE_SOURCE_DIR}/source/MaterialXGenOsl
${CMAKE_SOURCE_DIR}/source/MaterialXGenMdl
${CMAKE_SOURCE_DIR}/source/MaterialXRender
${CMAKE_SOURCE_DIR}/source/MaterialXRenderHw
${CMAKE_SOURCE_DIR}/source/MaterialXRenderGlsl
${CMAKE_SOURCE_DIR}/source/MaterialXRenderOsl
)
string (REPLACE ";" " " DOXYGEN_INPUT_STR "${DOXYGEN_INPUT_LIST}")

find_package(Doxygen)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)

if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
add_custom_target(MaterialXDocs ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating HTML documentation: ${DOXYGEN_HTML_OUTPUT_DIR}/index.html")
add_custom_command(TARGET MaterialXDocs PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/documents/DoxygenAwesome ${CMAKE_CURRENT_BINARY_DIR})
add_custom_command(TARGET MaterialXDocs PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/documents/Images ${CMAKE_CURRENT_BINARY_DIR})
install(DIRECTORY ${DOXYGEN_HTML_OUTPUT_DIR}
DESTINATION "documents" MESSAGE_NEVER)
endif(DOXYGEN_FOUND)
add_custom_target(
MaterialXDocs
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Building MaterialX C++ API Documentation: ${DOXYGEN_HTML_OUTPUT_DIR}/index.html"
)
add_custom_command(
TARGET MaterialXDocs PRE_BUILD
COMMAND ${CMAKE_COMMAND}
-E copy_directory ${CMAKE_SOURCE_DIR}/documents/DoxygenAwesome
${DOXYGEN_HTML_OUTPUT_DIR}
)
add_custom_command(
TARGET MaterialXDocs PRE_BUILD
COMMAND ${CMAKE_COMMAND}
-E copy_directory ${CMAKE_SOURCE_DIR}/documents/Images
${DOXYGEN_HTML_OUTPUT_DIR}
)
install(DIRECTORY ${DOXYGEN_HTML_OUTPUT_DIR}
DESTINATION "documents"
MESSAGE_NEVER)
else()
message(WARNING "Unable to build MaterialX C++ API Documentation: Doxygen not found.")
endif(DOXYGEN_FOUND)
endif(MATERIALX_BUILD_DOCS)


# MaterialX Python API Documentation
jstone-lucasfilm marked this conversation as resolved.
Show resolved Hide resolved
if(MATERIALX_BUILD_PYTHON_DOCS)
find_package(Sphinx)
if(SPHINX_FOUND)
set(SPHINX_SOURCE_DIR ${CMAKE_SOURCE_DIR}/documents/DeveloperGuide/)
set(SPHINX_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(SPHINX_HTML_OUTPUT_DIR ${SPHINX_OUTPUT_DIR}/html-sphinx)
set(
MATERIALX_PYTHON_DOCS_TARGET_DEPENDENCIES
MaterialXCore
PyMaterialXCore
PyMaterialXFormat
PyMaterialXGenShader
PyMaterialXGenGlsl
PyMaterialXGenOsl
PyMaterialXGenMdl
PyMaterialXGenMsl
PyMaterialXRender
PyMaterialXRenderGlsl
PyMaterialXRenderOsl
PyMaterialXRenderMsl
)

# Configure the Sphinx configuration file `conf.py`
set(MATERIALX_PYTHONPATH ${CMAKE_SOURCE_DIR}/lib)
set(MATERIALX_LOGO_FILENAME "MaterialXLogo_200x155.png")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/sphinx-conf.py.in
${CMAKE_CURRENT_BINARY_DIR}/conf.py)

# Add a custom target to invoke `sphinx-build` to generate the Python
# API docs, which depends on the Python bindings to be built
add_custom_target(
MaterialXDocsPython
${SPHINX_EXECUTABLE}
-c ${CMAKE_CURRENT_BINARY_DIR}
${SPHINX_SOURCE_DIR}
${SPHINX_HTML_OUTPUT_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${MATERIALX_PYTHON_DOCS_TARGET_DEPENDENCIES}
COMMENT "Building MaterialX Python API Documentation: ${SPHINX_HTML_OUTPUT_DIR}/index.html"
)

# Add post-build commands to copy our logo and custom style sheet to the
# "_static" folder
add_custom_command(
TARGET MaterialXDocsPython POST_BUILD
COMMAND ${CMAKE_COMMAND}
-E copy ${CMAKE_SOURCE_DIR}/documents/sphinx-custom.css
${SPHINX_HTML_OUTPUT_DIR}/_static/custom.css
)
add_custom_command(
TARGET MaterialXDocsPython POST_BUILD
COMMAND ${CMAKE_COMMAND}
-E copy ${CMAKE_SOURCE_DIR}/documents/Images/${MATERIALX_LOGO_FILENAME}
${SPHINX_HTML_OUTPUT_DIR}/_static/
)
else()
message(WARNING "Unable to build MaterialX Python API Documentation: Sphinx not found.")
endif(SPHINX_FOUND)
endif(MATERIALX_BUILD_PYTHON_DOCS)
25 changes: 13 additions & 12 deletions documents/DeveloperGuide/GraphEditor.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,30 @@

The MaterialX Graph Editor is an example application for visualizing, creating, and editing MaterialX graphs. It utilizes the ImGui framework as well as additional ImGui extensions such as the Node Editor.

### Example Images
## Example Images

![MaterialX Graph Editor with procedural marble example](../Images/MaterialXGraphEditor_Marble.png)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not specific to this PR but I noticed that images don't show up properly on the PyPi package page for MaterialX.
If were adding more images, just curious is there a more robust way to specify image references -- such as an absolute reference to the web site location instead of using relative paths ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see the issue: https://pypi.org/project/materialx/

It's great to see that the documentation content is reused in many places!

I've migrated the Markdown docs, including README.md, to use absolute paths now:


**Figure 1:** MaterialX Graph Editor with procedural marble example
<img src="/documents/Images/MaterialXGraphEditor_Marble.png" />

## Building The MaterialX Graph Editor
## Building the MaterialX Graph Editor
Select the `MATERIALX_BUILD_GRAPH_EDITOR` option in CMake to build the MaterialX Graph Editor. Installation will copy the **MaterialXGraphEditor** executable to a `/bin` directory within the selected install folder.

### Summary of Graph Editor Features
## Summary of Graph Editor Features

1. **Load Material**: Load a material document in the MTLX format.
2. **Save Material**: Save out a graph as a mterial document in MTLX format.
3. **New Material**: Clear all information to set up for the creation of a new material
4. **Node Property Editor**: View or edit properties of the selected node.
5. **Render View**: View the rendered material.

### Buttons
## Buttons

To display a new material and graph, click the `Load Material` button and and navigate to the [Example Materials](../../resources/Materials/Examples) folder, which contains a selection of materials in the MTLX format, and select a document to load. The Graph Editor will display the graph hierarchy of the selected document for visualization and editing.
To display a new material and graph, click the `Load Material` button and and navigate to the [Example Materials](https://github.com/AcademySoftwareFoundation/MaterialX/tree/main/resources/Materials/Examples) folder, which contains a selection of materials in the MTLX format, and select a document to load. The Graph Editor will display the graph hierarchy of the selected document for visualization and editing.

To save out changes to the graphs as MTLX files click the `Save Material` button. This will save the position of the nodes in the graph for future use as well.

### Editor Window
## Editor Window

The MaterialX document is displayed as nodes in the Editor window. When a file is intially loaded the material node, surface shader node, and any enclosing nodegraphs will be displayed. Double-clicking on a nodegraph, or any node defined as a subgraph, will display the contents of that graph.

Expand All @@ -40,19 +41,19 @@ Another type of node present in the `Add Node` pop-up is the group, or backgroun

To search the editor window for a specific node use `CTRL` + `F` to bring up the search bar.

### Node Property Editor
## Node Property Editor
When a node is selected in the graph, its information is displayed on the left-hand column in the `Node Property Editor`. This editor displays the name of the node, its category, its inputs, the input name, types and values. Inputs that are connected to other nodes will not display a value.

This is where a node's properties such as its name and input values can be adjusted. When an input value is changed the material is automatically updated to reflect that change. The node info button displays the `doc` string for the selected node and its inputs if they exist. This `doc` string is currently read only.

The show All Inputs checkbox displays all possible inputs for a node. With the box unchecked only inputs that have a connection or have had a value set will be shown. Only these inputs will be saved out when the graph is saved.

### Render View
## Render View
Above the `Node Property Editor`, the `Render View` displays the current material on the Arnold Shader Ball. If inside a subgraph it will display the material associated with that subgraph; otherwise it will display the output of the selected node. It automatically updates when any changes are made to the graph.

To adjust the relative sizes of the Node Property Editor and Render View windows, drag the separator between these windows in the application. The render view window camera can be changed using the left or right mouse buttons to manipulate the shader ball.

### Keyboard Shortcuts
## Keyboard Shortcuts

- `TAB`: Add Node Popup
- `Right Click`: pan along the editor
Expand All @@ -66,7 +67,7 @@ To adjust the relative sizes of the Node Property Editor and Render View windows
- `+` : Zoom in with the camera when mouse is over the Render View Window.
- `-` : Zoom out with the camera when mouse is over the Render View Window.

### Command-Line Options
## Command-Line Options

The following are common command-line options for MaterialXGraphEditor, and a complete list can be displayed with the `--help` option.
- `--material [FILENAME]` : Specify the filename of the MTLX document to be displayed in the graph editor
Expand All @@ -75,7 +76,7 @@ The following are common command-line options for MaterialXGraphEditor, and a co
- `--library [FILEPATH]` : Specify an additional data library folder (e.g. 'vendorlib', 'studiolib'). This relative path will be appended to each location in the data search path when loading data libraries.
- `--captureFilename [FILENAME]` : Specify the filename to which the first rendered frame should be written

### Known Limitations
## Known Limitations

- Creating new connections using the `channels` attribute of an input is not yet supported, though existing `channels` connections will be displayed in graphs.
- Assigning a new `colorspace` attribute to an input is not yet supported, though existing `colorspace` attributes on inputs will be respected by the render view.
Loading