ExportTemplate is not working in ElementGraph and InstaMATPipeline

When running a graph in Execute Mode (using the “-exportTemplate” option) in ElementGraph or InstaMATPipeline, referencing the output template for the output textures has no effect.

All output textures are named by the default defined naming convention and each channel is packed.

The Layering Project has confirmed that the Output Template works correctly.
How can I use Output Template with the “-exportTemplate” option in ElementGraph and InstaMATPipeline?

Thank you @YuLite for your post. We are currently looking into this and will get back to you when new information is available.

Thanks again!

1 Like

Thanks again @YuLite for your post.

Executing the -exportTemplate argument with an Element Graph is done by adding the argument after -mode Execute is set. It can be added either before or after the -graph argument.

For example the following command executes a package “Test.IMP” with a graph called “Test” that contains a material with the PBR map outputs (BaseColor, Normal, Roughness, Metalness, AO, Height) and applies a template called “Test Template.json” which packs some channels into the Red, Green, Blue, and Alpha channels of a single RGBA output.

InstaMATPipeline -mode Execute "Test.IMP" -graph "Test" 1024 1024 Normalized8 "Export/{GRAPH.NAME}_{OUTPUT.TYPE}_{OUTPUT.NAME}.png" -exportTemplate "<InstaMAT-User-Data-Directory>/Output Templates/Test Template.json"

Output Templates are stored in InstaMAT’s user data directory, and on Windows it can be found in Documents\InstaMAT\Output Templates by default.

The graph is laid out as follows:

The Output Template is configured as follows:

The result is a single packed image using the output template’s configuration.

image (2)

I hope this helps clarify how to use export templates in InstaMAT Pipeline. I’ll make sure to extend our documentation with this information.


1 Like

Thanks for sharing the solution.
I found the cause by comparing my graph with the screenshot you provided.

In order for the Export Template to work, I had to expose each texture map as an Output.!

I had previously only set the textures to Scene and did not expose each map individually as an Output.


*Previous NodeTree.

Fixed NodeTree

1 Like

You’re welcome! Glad we were able to help. :smiling_face: