Cannot apply materials to imported meshes

Ok, so I’m probably doing something wrong, but I definitely need help with this.

When I import a custom mesh that I made in blender it looks like this:

But then immediately when I assign a material, it turns out like this:

It looks super shiny as if I had turned the roughness to 0. But the material I added was a cave rock black and it was an element brush and I did not paint this. In fact, I cannot paint at all. As soon as I assign the material, the whole mesh changes into this mirror-like material and I cannot modify it in any way.

If I import another .obj I downloaded from somewhere this does not happen, so I need to know if I need to do something in blender when exporting. I already tried exporting with and without materials in both gltf and obj formats.

I should note this mesh has inverted normals, it’s meant to be looked at from the inside, but still no dice when I try to paint it like that:

I would really appreciate it if anyone knows how to solve this. Thanks.

Hello @Ignawesome and welcome to our community!

Would you be able to provide either the mesh or the InstaMAT Package (.IMP) file with the mesh included to test?

Thanks!

Thanks for the help.

Here is the IMP file, it includes the obj and the glb files:

And a zip with the blend, glb and obj separately: Cave.zip - Google Drive

Here are some errors that showed up in the console:

ERROR: OBJ: Unable to locate material file cave8.mtl
ERROR: OBJ: Unable to locate fallback material file C:\Users\IGNAWE~1\AppData\Local\Temp\204a9f0a-ea89-4b4a-a143-720766b3956c\MeshImport.mtl
Preparing InstaLODMesh “Caves_-col” (224184 polygons / 1 materials)

WARNING: (Layering) Layer=(ElementLayer cave8.glb 1773d9f7-4c47-491e-8129-8f44b18953a1) in channel BaseColor: Cannot instance Element (Reason: Graph with ID=47b2651d-f156-4718-8073-7de3dcf4e7fb not instantiable)

WARNING: (Layering) Layer=(ElementLayer cave8.glb 1773d9f7-4c47-491e-8129-8f44b18953a1) in channel Height: Cannot instance Element (Reason: Graph with ID=47b2651d-f156-4718-8073-7de3dcf4e7fb not instantiable)

WARNING: (Layering) Layer=(ElementLayer cave8.glb 1773d9f7-4c47-491e-8129-8f44b18953a1) in channel Roughness: Cannot instance Element (Reason: Graph with ID=47b2651d-f156-4718-8073-7de3dcf4e7fb not instantiable)

WARNING: (Layering) Layer=(ElementLayer cave8.glb 1773d9f7-4c47-491e-8129-8f44b18953a1) in channel Metalness: Cannot instance Element (Reason: Graph with ID=47b2651d-f156-4718-8073-7de3dcf4e7fb not instantiable)
WARNING: (Layering) Layer=(ElementLayer cave8.glb 1773d9f7-4c47-491e-8129-8f44b18953a1) in channel Normal: Cannot instance Element (Reason: Graph with ID=47b2651d-f156-4718-8073-7de3dcf4e7fb not instantiable)

Hello @Ignawesome,

Thanks for providing the package. From what I can tell, it looks like the mesh does not have any unwrapped UV coordinates.

The UVs of the mesh can be unwrapped in InstaMAT Studio using a node in an Element graph called the Mesh UV Unwrap node. Here’s a quick example of a graph that takes a mesh input, unwraps the UVs and then provides a mesh output.

You can drag your mesh from the Package Management panel into the graph to provide it as an input, then connect it to the Mesh UV Unwrap node to create the UVs.

Once unwrapped, you can view the mesh output by clicking on the output pin of the Mesh UV Unwrap node to show it in the viewport and click the
CleanShot 2024-03-29 at 08.53.18 Export Viewport Scene button to save the new version of the mesh. You can then re-import the model and use it in your Layering project.

What’s great is that once you create this graph to unwrap your UVs, you can re-use it for any mesh that needs to be unwrapped. If you set the output node as shown above, you can use the CleanShot 2024-03-29 at 08.55.50 Image and Data Output Export window as another way to export the mesh data. All you need to do is change the input mesh.

I’ve attached the updated package with the Unwrap UVs Element graph and the updated model in the Layering project.

Let me know if you have any further questions! Thanks!

1 Like

Hey, thanks so much! I had to tinker with it a little but I learned a lot and eventually was able to do it myself.
I can see now that the UVs were the problem. I’ve had issues with them for a while in blender and that’s why I decided to try instamat.
I think my cave mesh is too big for the textures I want on it. Originally I scaled the UVs in blender way out of bounds in order to get a repeating pattern, but I had the same result as the mesh without UVs.
Not I managed to put the UVs on the mesh, but there is still one adjacent issue:

This is how it looks in the brush preview:

And this is how it looks once painted:

The textures I paint on it look very low resolution. I’m aware this is not a bug or related to my original problem, but I’d appreciate if someone knows what is the proper way of painting an asset like this.

Additionally, I’ll mention a couple of questions I had while using the software:
first, is there a way to navigate up and down (in addition to forward, backwards, left and right) while holding right mouse button? That type of first person navigation is very convenient but I couldn’t find how to do that movement.

Lastly, I noticed that the mesh doesn’t update until I try to paint on it or apply/move a mask. Is that intended behavior? Like, when I add a material on a layer it just doesn’t update until I do something else. Or maybe it’s just loading… sometimes it’s loading a material and I cannot tell. Maybe it would be possible to show an indication that the viewport/preview is updating?

Anyway, thanks a lot for your help so far, it’s been really useful! :slight_smile:

1 Like

You’re welcome @Ignawesome! Glad I could help! From what I can see regarding the resolution of the texture on your mesh, it has to do with the amount and size of the UV shells in a single 0-1 UV tile. One option would be to break the environment up into multiple material sections, or unwrap the mesh for a UDIM workflow. Both workflows are supported in InstaMAT.

If you’d like to break up the mesh into multiple materials, InstaMAT has a powerful asset texturing workflow called Multi-Material (Unified). It provides the UDIM workflow for meshes that have been set up with multiple material sections assigned. InstaMAT provides one layer stack for the entire scene.

This way you can break up your mesh’s UVs into multiple UV tiles so that they have bigger shells resulting in textures that have more detail, while still working with one layer stack.

Regarding your questions:

is there a way to navigate up and down (in addition to forward, backwards, left and right) while holding right mouse button?

Currently this is not possible, however you could create a feature request in the InstaMAT > Feature Requests category. Just be sure to follow the Feature Request post template which is provided automatically when a post is made in that category.

As a workaround, I usually switch between the first person navigation and either the MMB or Cmd/Option + Left Click (I’m using a Mac in this case) to adjust my elevation.

I noticed that the mesh doesn’t update until I try to paint on it or apply/move a mask. Is that intended behavior?

Could you provide a quick screen recording of this behavior? It might be that the material is loading. There is a progress bar in the bottom right corner of the UI that indicates when processing is in progress.

1 Like

I’m back! I was able to solve the issue thanks to your feedback :smiley:

Separating the cave mesh into different objects and assigning different materials for each. But I also had to change the projection mode of materials to UV, as it was Triplanar by default. So in each material go to Element Layer → Layer Projection → Projection Mode → UV.

This is the result in InstaMAT:

Then I imported it to Godot and it looks like this:

It’s waaay better than before, even if it lost some quality, arguably due to texture resolution.
These are the best results I’ve had yet, so I’m definitely sold on this method :slight_smile:

As a workaround, I usually switch between the first person navigation and either the MMB or Cmd/Option + Left Click (I’m using a Mac in this case) to adjust my elevation.

This worked wonders and is very intuitive too!

And regarding my previous complaint about the mesh not updating. I had already recorded the issue when I noticed this happened because of the little lock on the top right which was locked by default. The preview mesh now updates instantly.

So everything is solved! Thank you so much for your time and sorry for the delay :sweat_smile:

1 Like

That’s really great to hear @Ignawesome! Thanks for the update! Your cave is looking great!

Please don’t hesitate to ask if you have any further questions. :blush:

1 Like

Hi Pixby,

I have run into the same problem.
I have made a UV-map, but I can’t see it in Instamat… Is there a shortcut for viewing it? Or the different channels? Can you help with this?

I found the node, just like 2 minutes later…
What you need to do is to click on the node in the middle, on the right panel you will see the properties of that node.
There is a tab called Outputs: There you see a Node called Output. You need to RIGHTCLICK on it, then a little window pops up, and it says: >> Expose as Output Parameter. Click on it and it will make the " Set output" node.

( This really needs to made either more clear or simpler ( A set Output node on its own)

https://community.theabstract.co/uploads/default/original/1X/51f0f523da96318b133ec7d058ec8450700d5c13.png

Thanks for any help.

Hello @baroba and welcome to our community!

You can view the unwrapped mesh in the 3D viewport by clicking on the output pin of the Mesh UV Unwrap node in the graph, or right click the node and select View Mesh 'Output' from the contextual menu. The keyboard shortcut for this is V by default to preview the selected node output.

To view the UVs on the mesh in the viewport, you can set the viewport’s Render Mode to UV Grid in the Viewport Settings panel under Environment Settings.

If you’d like to learn more about UV unwrapping meshes in InstaMAT Studio, here is a link to one of our documentation articles.

If you have any questions, please feel free to ask. :smiling_face:

Thanks!

Thanks :slight_smile: @Pixby
It feels like we are talking about two different programs here…
I have made a script (element graph) in the package that has my mesh and project.
I have referred to my mesh in the nodes. But I have no idea if the nodes do anything and when.


Clicking on the nodes does nothing ( SetPreviewGraphOutput: No renderstate for variable=(Variable ‘Output’ 0b3f8649-1ffb-4aec-badd-bfb9a77293a1), waiting for render… ) I have no idea how to properly initialize a variable. Or even what I am supposed to do… Substance painter was hard, but this looks like Painter and Designer all in one, which makes it even more difficult. I understand the power it contains, but the learning curve is steep. I have managed to get some textures on my model, but it takes a long time to do basic stuff… Still got a lot to learn…

PS:A feature request: Maybe make a dropdown menu for all the different Channels and textures. Or a string of channels next to each other, so that we can easily switch between them.

I’m happy to help clarify wherever I can, @baroba. :smiling_face:

Based on the portion of the output log you’ve posted above, it looks like you’ve clicked on the output pin of the node before the unwrap processing had completed.

If a node is still processing, it will display an icon to the right of the node name, indicating that it is still in progress. Once it has completed processing, you should be able to click the output pin again to view the resulting mesh in the 3D viewport.

The mesh should not change visually in the viewport after running it through the Mesh UV Unwrap node. However, you can view the UVs of the model in the graph using a Mesh UV node. You can also view the UVs on the mesh in the 3D viewport using the abovementioned method in my previous post.

Here’s an example of looking at the UVs before and after the Mesh UV Unwrap node.

What you could do is use an Element Graph project to prepare and unwrap a model, then save that unwrapped version of the mesh to disk, and use it in a Layering project. This way, you can use InstaMAT to do both the mesh preparation and the texturing stages.

Regarding your PS, you can press the C key to cycle through the channels in the 3D viewport. Make sure you’ve focused/clicked on the viewport before pressing the hotkey.

Here’s an example of doing this in a Layering project.
CleanShot 2025-01-13 at 15.16.46

In addition, you can also view a particular channel by selecting it in the Viewport Settings panel. After setting the Render Mode to Solo Material Channel, a dropdown will appear allowing you to choose which channel to view in the 3D viewport.

Have you had a chance to take a look at our YouTube channel? There’s a Getting Started playlist that covers a variety of topics that can get you up and running quickly. I’ll leave a link to that playlist here.

I didn’t want to overload you with too much information, but what’s pretty great is that once you texture something using a Layering project in InstaMAT, you can use that same project to texture additional meshes by dragging the layering project into an Element Graph. This way, you can set up a workflow that can process (UV Unwrap/Optimize/Bake) and texture an asset with one graph. You can see this in action near the end of the InstaMAT’s Layering Fundamentals: A Deep Dive into Layering Concepts video.

I hope this helps, and if you have any further questions please don’t hesitate to ask.

Thanks!

1 Like

Hi Pixby,

It has been a busy week and hadn’t have much time to go over it all.
I successfully did see the change in the UVmap, so that works.
But if I want to save the mesh, I have two options: Save and Set Output.
I can add the same mesh to the local variables ( ElementMesh)
But I have no idea when and if the mesh gets saved. There is something called versioning, but no idea how it works. I would like to save a new version of the mesh to know that it works.

I have seen most of the videos ( Thanks for making those )
You are talking about the part after the 2 minutes mark? That he adds the project to a graph? I did the same, added a meshbake and a few other nodes seen in the video and now I got error messages… So not working for me :slight_smile:
I also tried the decals-workflow that comes right after that part.
But that doesn’t work either. You can see that he already has a decal as active layer, and everything he does is already using that decal. If you have nothing selected pressing Q doesn’t do anything. So how so you place a decal from 0?
If I drag a image onto the mesh I still get a initiation error, meaning that the UVmap is still not correct…
Back to zero…

1 Like

Hello @baroba,

Thank you for the additional information. I’m glad to hear that you were able to unwrap the UVs of the mesh using the Element Graph.

Graph Outputs and Local Variable

To add some clarity about graph outputs and local variables:

Setting a graph output or local variable does not automatically save data to disk.

A local variable is a way of setting and referencing data privately inside of a graph. This makes it possible for nodes within a graph to access the same data so that you don’t have to set parameters on multiple nodes individually. For example you could have a “Count” local variable that controls the amount of scattered tiles for multiple scatter nodes. By changing the value of the “Count” local variable, you can set the values for each scatter node that references it.

Local variables are like graph inputs, but graph inputs are public and can be controlled from outside of the graph. An example of a graph input is a “Wear”, “Dirt Level” or “Color” parameter on a material.

To learn more about graph inputs and local variables, we have an article from our Knowledge Base here.

Exporting Meshes to Disk in InstaMAT Studio

There are two ways to save a mesh to disk out of InstaMAT Studio:

  1. View the mesh in the 3D viewport by clicking the output pin of the node that generates the mesh, then click the Export Viewport Scene button in the viewport’s toolbar. You can then choose where to save a new version and what you would like to name it.
    CleanShot 2025-01-27 at 16.15.43@2x
  2. Create a graph output and connect the output pin of the node generating the mesh. You can then use the Image and Data Output Export panel to export the mesh and any other data connected to graph outputs. To save the mesh to disk, ensure that the mesh output is enabled in the export dialog, then click export to save the mesh to disk. Be sure to change the file name if you’d like to save a new version otherwise the file will be overwritten.

Layering Project / Graph Project Integration

Regarding adding your layering project to a graph, would you be willing to send a screenshot of your graph setup? This can help to identify what is going on quickly.

I also wanted to mention that our CEO did a demo of something like this during our 3 hour InstaMAT Launch Party Live Stream. Here’s a link with a timecode to a portion of the stream where he brings in a layering projection into an element graph, then shows how to process geometry and texture assets this way.

https://www.youtube.com/live/jVMsGm5K79U?si=wq529i_wvFptz6Gy&t=8030

Decals

For decals, here’s an article on how to create one in a layering project from our documentation: Decals | InstaMAT Documentation

The decal picker [Q] works when the selected layer is already set up as a decal by changing its Projection Mode to Decal. In this case it sounds like you need to create a new layer and set it’s Projection Mode using the Layer Projection panel.

I hope this information helps!

Thanks!