question

Aron Baaijens avatar image
Aron Baaijens asked ·

MaterialX not working

I've tried every possible option on the export and usage of MaterialX, but can't seem to get it to work.
There is some basic documentation and a tutorial for Arnold, but following it does not get my materialx operator to work.

What I've tried:

- I've exported a range of materials using the "Export Selection to MaterialX" script in the utilities tab. Using all export combinations.
- I also tried all the examples of the materialx website.
- I've tried applying a materialX operator in the Operator tab in the render settings
- I also tried applying it to a ass file and a gpu cache.

The materialx operator doesn't give an error and on materialx files with looks it also displays them in the look field, so it's recognizing the files, but on rendering it doesn't overwrite the original shaders.
(the ignore operators options also isn't enabled)

Does anybody have a idea what I'm doing wrong, what the correct workflow is or why it's not working?

Also does anybody know for sure if the shaders made in maya can be exported as materialx and used in Houdini. That's all I'm trying to test.

Cheers,

Aron

Using: Mtoa 3.3.0.2 (Core 5.4.0.2), Maya 2019

arnoldshadersmaterial
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Stephen Blair avatar image
Stephen Blair answered ·

You export full paths like /pSphere1/pSphereShape1

That's the name you have to match

So in Maya, you need to turn on Render Settings > System > Render Settings > Export Full Paths

Also, for now I would use the pipe character | instead of forward slashes /

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Orn Gunnarsson avatar image
Orn Gunnarsson answered ·

The materialx operator itself is fairly flexible and supports glob expressions to assign things to geometries and collections. The general idea is that the materialx documents contain look-dev for individual assets, where the assignments are relative to the asset for portability across shots. The operator selection can then filter what assets in the scene are subject to a particular look-dev, e.g. imagine one case where you have 10 characters and you want to vary the look version or variant for certain characters.

Note that in the future the intention is that the operator will also support assigning materials without predefined assignments in the mtlx document. In that case the idea is that the operator selection is the only assignment, where instead of choosing a look you choose a material that the selection should get.

Lastly, the current export process bakes out the assignments to give you a look that can be approved, where it works best with stand ins as the look will be portable across shots and other DCCs. We plan to offer more flavours of look dev processes in the future so stay tuned.

3 comments Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Thanks Orn,

That clears things up.

I watched all the talks about materialx and remembered the possibility of assigning materials without predefined assignments. Now I know I'm getting ahead of myself:P

0 Likes 0 · ·

Apart from standins how would the assignment work across DCCs? Don't DCCs maintain different naming conventions? Making it pretty hard to make the assignment work.
Let's take Maya and Houdini as an example. How would one assign a .mtlx file to a object in Houdini that came from maya and that was used to create the .mtlx file in maya?

0 Likes 0 · ·

One simple thing would be to allow baking materialx files relative to some point in the hierarchy, where the look can then be reapplied relative to a different prefix path in a different DCC for instance.

0 Likes 0 · ·
Aron Baaijens avatar image
Aron Baaijens answered ·

Additional question... I don't know if anyone is still gonna read this. But now I'm questioning my belief on what materialx is capable of.
Is it possible to apply a materialx to not just the object that generated it, but also other objects? What is the selection suppose to do in the materialx operator if it is only going to assign the shader to the object that generated it?

Can I remove the materialassign from the .mtlx file so it can be assigned to all objects?
I thought it was possible to create a material library of materialx files that could be assigned to anything you'd want.

1 comment Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

The selection is to select the object in the scene with a name that matches the name exported to materialx


So you cannot assign that material to any object in the scene that matches the selection expression.

0 Likes 0 · ·
Aron Baaijens avatar image
Aron Baaijens answered ·

Turning on Render Settings > System > Render Settings > Export Full Paths in combination with using the pipe character as export seperator fixed the issue.

It turns out the Export Full Path option box in the materialx exporter has to be the same as set in the arnold render settings.

Thanks Stephen:)

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Stephen Blair avatar image
Stephen Blair answered ·

Do a test on a sphere with the default name pSphereShape1 and select that specific node

3 comments Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

still doesn't work...

here is the render log: arnold.1.txt

and here the tranlation info output, if that helps. Its the only log that mentions MaterialX: arnold_translation_output.txt

here one of the .mtlx files I'm using: SimpleSrf.txt (saved as .txt, otherwise I couldn't upload it)

0 Likes 0 · ·

Use Standard Surface, not the Maya surface shader.

0 Likes 0 · ·

When I export my own shader standard surface shader it also doesn't work:
here is the .mtlx export from a standard surface shader on which I only adjusted the base color and weight.

red_shader.txt

0 Likes 0 · ·
red-shader.txt (553 B)
Stephen Blair avatar image
Stephen Blair answered ·

Use Arnold shaders only (ones that are listed in nodedefs.mtlx)

Is the selection expression of the materialx operator selecting the right object? Set the log verbosity to Debug to see whether's it matches.

1 comment Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

I only used standard surface shaders and for Selection I used different options like (*) for selecting everything and (*.(@node == 'polymesh')) for all meshes. But nothing sticks.

0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.