Author Topic: Unity 5 - Material Layering Plugin Issue  (Read 3309 times)

Hey guys!

I'm contacting you concerning a problem i have with the material layering plugin. I recently updated my Substance Painter to the version 2.5 to be able to use all the new functionalities.
I'm also using it to texture using the multi material layering technique.

When i try to open the .json file in Unity 5, i get that error:



I thought it came from my exports from Substance Painter. So, i cleaned my shelf from all previously imported materials. Re imported them cleanly and re did my texturing.

When i export the textures using Document Channels + Normal + AO (With Alpha) and tick the "Shader Parameters" option i still get the same issue in Unity 5.

The custom materials used were created using Substance Designer 5.5 so that may be the issue. I'll keep doing tests and ressearch on my end, but it seems to me there is still a problem with the Unity plugin itself.

Could really use some help on that one.

Thanks!

Cheers!

It is because they changed the name of the textures and inside the .json

It was exported as Mask_Opacity, now they export it as Mask_Blending_mask. But the importer to Unity is still on version one and looking for the Mask_Opacity instead of the new one. What you have to do is change the .json

Open the .json on notepad++ or another text editor and change it like this.



That should work, but there are other problems apart from this..... I am changing the importer in Unity so it works as it should but still I hope they release a new importer version soon.
Last Edit: March 09, 2017, 04:46:58 am

sabillano,

thanks for the reply dude, i saw in the forums that there were problems with the masks names and stuff.

But here it's not even the .json that bugs it seems. There is an error in the importer script i think.
I'm investigating too, but i hope they fix it soon too...

I guess a solution would be to roll back to a previous version of painter and see if it works until they fix the plugin.

Hi,

Very sorry for this issue. I am asking the devs to take a look at these posts.

Cheers,
Wes
Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Hi Wes,

I came to this thread via Googling the following error in Unity:

"
NullReferenceException
AlgLayeredMaterialEditor+MaterialLayeringData.Load (System.String jsonPath, System.String targetPath) (at Assets/Allegorithmic/MaterialLayering/Editor/AlgLayeredMaterialEditor.cs:210)
"
That's why I've reopened this old thread rather than starting a new one.

I notice in the AlgLayerMaterialEditor.cs file Allegorithmic provide, the issue mentioned around a mismatch between what Painter exports as the mask file names and what the plugin expects has been fixed, however the 'Import JSON' operation from the Unity inspector still fails. Is this a known issue?

My Unity material is the same name as the Painter material. I have all of the Substances imported in to Unity (in the same folder). The exported masks from Painter appear to match what's in the JSON file. I've followed your video tutorials. I'm using Unity 2017.3.

I'm not sure what the issue is.

Any help you could suggest would be much appreciated.

Thanks.

Hi Wes,

I came to this thread via Googling the following error in Unity:

"
NullReferenceException
AlgLayeredMaterialEditor+MaterialLayeringData.Load (System.String jsonPath, System.String targetPath) (at Assets/Allegorithmic/MaterialLayering/Editor/AlgLayeredMaterialEditor.cs:210)
"
That's why I've reopened this old thread rather than starting a new one.

I notice in the AlgLayerMaterialEditor.cs file Allegorithmic provide, the issue mentioned around a mismatch between what Painter exports as the mask file names and what the plugin expects has been fixed, however the 'Import JSON' operation from the Unity inspector still fails. Is this a known issue?

My Unity material is the same name as the Painter material. I have all of the Substances imported in to Unity (in the same folder). The exported masks from Painter appear to match what's in the JSON file. I've followed your video tutorials. I'm using Unity 2017.3.

I'm not sure what the issue is.

Any help you could suggest would be much appreciated.

Thanks.

Hi Paul,

I'm very sorry for the late reply on this. I am asking the devs to take a look at this issue.

Cheers,
Wes
Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Hi Wes,

Thanks for coming back on this.

There are couple of threads running so I'm cross-linking here:

If anyone else is having problems with the Json failing to load in Unity, this thread has a manual solution at the bottom:

https://forum.allegorithmic.com/index.php/topic,22645.msg92482/highlight,Material+layering+don’t+get.html#msg92482

Regards,
Paul

Hi Wes,

Thanks for coming back on this.

There are couple of threads running so I'm cross-linking here:

If anyone else is having problems with the Json failing to load in Unity, this thread has a manual solution at the bottom:

https://forum.allegorithmic.com/index.php/topic,22645.msg92482/highlight,Material+layering+don’t+get.html#msg92482

Regards,
Paul

Hi Paul,

I'm sorry for all of the delays. I spoke with the development team and we will no longer be supporting this material layering shader in Unity. Instead, we will be supporting Unity's layered shader as part of the HD render pipeline. This will make things easier as you will no longer need to use a custom shader we create.

https://blogs.unity3d.com/2018/03/12/photogrammetry-in-unity-making-real-world-objects-into-digital-assets/

Cheers,
Wes

Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Hi Wes,

Thanks for explaining.

Given the changes in Unity and Substance integration I get why you would no longer want to support a Unity shader for doing this. In fact, it's not hard to reproduce the Unity shader, only without the Substance packing: manually setting the texture files. So not much has been lost.

However can I ask you and the dev team to consider a couple of things?

  • Would you consider fixing the latest version of Substance Painter so it outputs the JSON file in the correct format? I cross posted an explainer of where the problem is earlier in this thread but let me know if you want me to recap here. It would be such an easy fix for you guys but make the workflow so much faster if I don't have to manually fix the JSON file each time I do an export.
  • You mention that you'll be supporting the HD SRP in Unity instead but this isn't a viable solution for most people. The HD SRP is no-where near ready and even then it will require people with existing projects to completely re-write ALL of their custom shaders. I also don't think everyone will use that pipeline. Having a solution for the core Unity render pipeline I still think is where Substance users will get the most value.
  • Put the YouTube video explaining how the workflow on the Painter side works back up and just make it clear the Unity shader is deprecated? There was some important info in there about the way the masks work that I hadn't committed to memory and suddenly finding it deleted caught me by surprise. I still intend to use material layering. I'm sure there will be other users who, like me before I found that video, didn't know how to do material layering with Painter (or even knew it was possible).
  • Please don't ever deprecate the shader on the Painter side :-)

I appreciate you being so responsive on this and hope you will give my feedback some thought.

Cheers,
Paul