Mtlx authoring in VRED. Open Source Plugin now available.

Mtlx authoring in VRED. Open Source Plugin now available.

scottXWLZ5
Participant Participant
606 Views
22 Replies
Message 1 of 23

Mtlx authoring in VRED. Open Source Plugin now available.

scottXWLZ5
Participant
Participant

Hi All, 

Thought I would make a post on here to share my open source plugin release. This now allows full mtlx authoring inside VRED via a node graph window. 

EOkHEyHo3W.png

Numerous examples and presets, preview shader once the material has been pushed to VRED. A handy validator for the material which can spot errors before and show diagnosis before sending. It uses each unique VRED versions mtlx library that it ships with. In theory this means versions 2024-2026 should work (I developed and tested this on 2027 version) but I cannot account for the python syntax changes between versions if there is a discrepancy. 

Please use this post, my Linkedin or Github itself to share issues found, requests or anything else you can think of. I'd like to support this as much as I can until Autodesk release a true native one. 

 

 

https://github.com/ScottRaffertyCG/VREDx


Cheers!

Scott 
Pyre Labs founder

 

 

 

607 Views
22 Replies
Replies (22)
Message 2 of 23

seiferp
Community Manager
Community Manager

Nice job!

Message 3 of 23

andreasK3K4G
Advocate
Advocate

Hi Scott,

that looks very nice.

I want to test, but got some errors.
VRED 2026.2
I have the MaterialX library folder in VRED InstallationDir C:\Program Files\Autodesk\VREDPro-18.2\runtimeData\MaterialX\libraries


When clicking on Open MaterialX Editor in the menu bar i got this errors.

Traceback (most recent call last):
  File "C:\Users\XXX\Documents\Autodesk\VRED-18.2\ScriptPlugins\VredX\vredx.zip\vredx\vredbridge\ui_integration.py", line 78, in <lambda>
  File "<string>", line 91, in show_editor
  File "C:\Users\XXX\Documents\Autodesk\VRED-18.2\ScriptPlugins\VredX\vredx.zip\vredx\ui\main_window.py", line 111, in ensure_editor_ready
  File "<string>", line 82, in _load_library
  File "C:\Users\XXX\Documents\Autodesk\VRED-18.2\ScriptPlugins\VredX\vredx.zip\vredx\core\nodedef_library.py", line 110, in load
FileNotFoundError: No MaterialX library folder found (VRED install or snapshot)


Any idea?

0 Likes
Message 4 of 23

scottXWLZ5
Participant
Participant

Hi Andreas, 

You have installed VREDx to your Documents\Autodesk\VRED-18.2\ScriptPlugins\Vredx. I designed this to install to:

C:\Program Files\Autodesk\VREDPro-19.1\lib\plugins\WIN64\Scripts

 as the standard install path because I walk up the folders to get to root then I find:

...\VREDPro-18.2\runtimeData\MaterialX\libraries

which is critical for mtlx authoring to run. Since you have put it in your Documents there is no mtlx library under the same root folder to find. Please try installing it to C:\Program Files\Autodesk\VREDPro-19.1\lib\plugins\WIN64\Scripts or wherever you have installed VRED. The sub folders must match:

...\VREDPro-19.1\lib\plugins\WIN64\Scripts

I will consider options for using the plugin from documents and will let you know if a release contains any changes for this. 

0 Likes
Message 5 of 23

andreasK3K4G
Advocate
Advocate

I will consider options for using the plugin from documents and will let you know if a release contains any changes for this.

 

Please, cause in our company we dont have write access to C:\Program Files\

Thats why we need to put Plugins to Documents folder.

 

This should get you the install folder.

 

import os, sys
print(sys.executable)

Prints:

C:\Program Files\Autodesk\VREDPro-18.2\bin\WIN64\VREDPro.exe



0 Likes
Message 6 of 23

scottXWLZ5
Participant
Participant

Yep found something similar built into VRED I can use. 

Give me an hour or two and I will have a new release on GitHub for you to try. Will ping you here when it's available. 

0 Likes
Message 7 of 23

andreasK3K4G
Advocate
Advocate

Amazing! No hurry, take your time. 😉

0 Likes
Message 8 of 23

scottXWLZ5
Participant
Participant

Was faster than I thought. 

I have verified this works with my 2027 version using the:

Documents\Autodesk\VRED-19.1\ScriptPlugins\Vredx

folder to run the script. It finds the install location using VRED_ROOT at runtime. 

https://github.com/ScottRaffertyCG/VREDx/releases/tag/v0.5.5 - try this now please

0 Likes
Message 9 of 23

andreasK3K4G
Advocate
Advocate

Great, it`s working!!

Message 10 of 23

andreasK3K4G
Advocate
Advocate

Hi,

for my first test, overall it is working good, thanks for putting that much effort into it.

 

I tried some materials from https://matlib.gpuopen.com/main/materials/all

When loading them inside vred material editor they are working fine.

When opening with your MTLX Editor i got two issues:

 

First, the nodegraph - every node is on the same place, so everything overlaps, cause in their mtlx files is no xpos=" " ypos=" " set. Dont know if you can do something about that.
Maybe to check every node, if there is no xpos info, place them in a grid layout or something.

 

Second, the textures are not assigned to the nodes, the relative path is visible like /textures/my_texture.png, but not loading.

If it is not intended to work with other mtlx files then self created inside vred from your tool, just ignore my message.

0 Likes
Message 11 of 23

scottXWLZ5
Participant
Participant

I can see the issue. 

There is an absolute / relative mismatch with how I am storing and reading the mtlx files. Fix incoming. It should absolutely (pun not intended) be able to work with externally authored mtlx files. Admittedly I did not do a lot of checking from matlib. After I release this patch I will validate against some common groups from matlib

I also got a working fix for the node positions on externally authored graphs. It's not perfect but it's better than everything being on position=0.

0 Likes
Message 12 of 23

scottXWLZ5
Participant
Participant

new release ready - https://github.com/ScottRaffertyCG/VREDx/releases/tag/v0.5.6

A new addition also, being able to read directly from a zip folder (because I wanted to speed up validating matlib files and they download as zips 😁). 

Now validated against texture enabled mtlx files, opacity enabled ones like Semitransparent Sillicone, Diamond etc, validated also against basic materials like core metals and plastics

0 Likes
Message 13 of 23

andreasK3K4G
Advocate
Advocate

Hi Scott,

me again. Thanks for the quick update.
What do you thing, can you add to the tool tip description the input pin value, now its just showing the output.
In the picture, when i search for convert, and i want to find "float to vector3" i can not see directly the correct node, or at least when hovering over.

 

andreasK3K4G_1-1783411594839.png

 

 

0 Likes
Message 14 of 23

scottXWLZ5
Participant
Participant

I have already added better labels, looser searching for strings like "convert" etc. It will be in 0.5.7 but I have a few more features that I need to polish before releasing so it will likely be closer to lunchtime that the release comes out (+3 hours from now). 

Thanks for the effort to improve this, it really helps.

0 Likes
Message 15 of 23

scottXWLZ5
Participant
Participant

0.5.7 release here - https://github.com/ScottRaffertyCG/VREDx/releases/tag/v0.5.7 

  • Expose-in-material toggle for VRED Realistic tab visibility (Inspector checkbox controls uivisible on literal inputs)
  • Node palette type labels, tooltips, and search (input-to-output type signatures; search by port types)
  • Nested nodegraph drill-down and compound output visualization (breadcrumb navigation, export output panel, scoped auto-layout)
  • Compound graph authoring and nested MTLLX round-trip (create/dissolve nodegraphs, expose internal ports as compound outputs, preserve nested structure on save)
  •  Auto-layout when dissolving compounds
Message 16 of 23

scottXWLZ5
Participant
Participant

(view in My Videos)

0 Likes
Message 17 of 23

scottXWLZ5
Participant
Participant

VREDx 0.6.0 is live. 

Full texture baking support inside the window is now available. Bake down heavy mtlx files to textures. Supports the entire mtlx map library (40+ textures). 
https://github.com/ScottRaffertyCG/VREDx/releases

working on an MCP server for 0.7.0 will general support for all agentic communication with VREDx to open, edit, author, bake & publish mtlx files (including sending to VRED) from any command line or agent chat with access to the MCP. Stay tuned!

 

0 Likes
Message 18 of 23

scottXWLZ5
Participant
Participant

VREDPro_XRbjA9kY62.png

Substance .sbsar file format conversion to mtlx directly in VREDx. 

Currently supported: 
Graph / preset / resolution selection
Full-res maps (Base Col, Roughness, Metallic, Normal, Height, Emissive, Opacity, AO, Specular and, Anisotropy)
Normal convention: Preserve or override with DirectX / OpenGL
standard_surface MaterialX with relative texture paths + normalmap nodes.


In progress:
Batch / multi-file conversion
OpenPBR and USD export support
Preset import
Parameter metadata > mtlx


This is using the native VRED shipped python API for substance and materials so no third party files needed. 

0 Likes
Message 19 of 23

clemens_schlicker_audi
Enthusiast
Enthusiast

You've got an interesting approach to avoid loading too many py files from your plugin, may I suggest this approach instead?

 

https://forums.autodesk.com/t5/vred-forum/plugin-development-ways-to-add-custom-and-external-modules...

 

Thanks for sharing your plugin open source! I'm going to give it a spin 😎

 

VRED Devs unite 😄

0 Likes
Message 20 of 23

scottXWLZ5
Participant
Participant

Hi Clemens! 

Thanks for the link. It's a good approach and would definitely work well on internal development within a team. Since I am releasing this via Github I have no real way of attributing hidden tags to folders for end users. My approach is designed so that any end user can download and jump straight into it.

I could add a fallback statement, if there is no zip found alongside it would look for any hidden folders designated as "modules". If you would like to have that feature let me know and I can get it in for 0.7.0 so anyone can use either the default zip method or an internally aligned hidden folder method. 

0 Likes