UnityGLTF icon indicating copy to clipboard operation
UnityGLTF copied to clipboard

Using substance archive texture make the export fail

Open ultrasuperpingu opened this issue 8 years ago • 7 comments

In method: private ImageId ExportImage(Texture texture, TextureMapType texturMapType)

texture = texture as Texture2D, returns null when using sbsar file.

ultrasuperpingu avatar Nov 06 '18 11:11 ultrasuperpingu

Could you share an example sbsar file?

ericob avatar Nov 12 '18 19:11 ericob

Sorry, I use file found at https://share.allegorithmic.com (material section). I'm not sure I can publish it here but you can download one by creating a free account.

ultrasuperpingu avatar Nov 12 '18 20:11 ultrasuperpingu

I'll try to fix it and provide a pull request when I'll find some time to do it if you want but it will not be this week I guess.

ultrasuperpingu avatar Nov 12 '18 21:11 ultrasuperpingu

@ultrasuperpingu any update on a PR to fix this issue?

ericob avatar Jan 04 '19 22:01 ericob

Ok, I just took a look at this. The problem is more general. sbsar material are ProceduralTexture in Unity. The case of sbsar material is probably not a big problem since its support was removed in Unity 2018 but the problem still remains for other ProceduralTexture. I guess the quick fix would be to ignore them and log an error. That means in method : private MaterialId ExportMaterial(Material materialObj)` for each texture (emissive, normal, basecolor, etc), if texture is a ProceduralTexture, don't export it and log an error.

A more general fix would be to extract a regular texture from the procedural to export it but it's a bit complicated and I'm not sure it make sense in most cases.

Do you want me to implement the ignore and log behaviour and to submit a PR with it?

ultrasuperpingu avatar Jan 05 '19 11:01 ultrasuperpingu

I made PR #336 for this. Hope this helps :)

ultrasuperpingu avatar Jan 05 '19 11:01 ultrasuperpingu

Deprecated

robertdorn83 avatar Feb 09 '24 08:02 robertdorn83