Publish OBJ+MTL files with tray publisher

Hi,

Let’s suppose I have a OBJ file with it’s associated MTL file.

If I want to publish the model with the Tray Publisher, I can use the Model publish type but I can only put .obj files.

Ideally what’s the best way to represent .obj+.mtl associations in AYON? By having multiple representations for the same product?

Edit: I added the .mtl extension in ayon+settings://traypublisher/simple_creators/1/extensions?project=<YOUR_PROJECT> and it worked. I created an issue in Blender here for loading an obj (also tested it in Maya but Blender seems to interpret the .mtl file by creating a shader).

I agree with you the way to go was to add more extensions.


This works to publish the files to AYON but I have two concerns (as far as I know):

  1. It doesn’t always work because AYON renames the files.
  2. I don’t think having these files as different representations is logically correct. Because, These files are not representations of the same product, they are auxiliary/complementary files.
1 Like

Thanks for the great answer, you are totally right I didn’t think about the renaming of texture files references in the .mtl file.

Can the AYON data model handle this kind of auxiliary files?

For simple creator plugin, it doesn’t handle that.
As far as I know, we may need a dedicated creator plugin for it.

Tagging @BigRoy, he can provide better insights.

1 Like

It is doable to include them - but you must include them as dedicated “transfers” instead of representation files.

We actually do this for .obj inside Maya when extracting. We read the maps from the .obj and take those along. The code is here with the transfers being defined here.

For Tray Publisher, you can go two ways:

  1. Create a new dedicated creator to do the heavy lifting.
  2. Or, write a CollectorPlugin that “collects” additional textures like these as dedicated transfers when it detects it’s publishing an .obj file. It would make it quite universally applicable. It could even share logic with the one from maya but that’d be redundant refactoring maybe at this stage.

I personally would likely try 2)

2 Likes