Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Export from Unity with materials #654

Closed
MatthieuKiskonen opened this issue Oct 27, 2023 · 15 comments
Closed

Unable to Export from Unity with materials #654

MatthieuKiskonen opened this issue Oct 27, 2023 · 15 comments
Labels
bug Something isn't working

Comments

@MatthieuKiskonen
Copy link

Describe the bug
Trying to export a gameObject from Unity scene (imported glb) does not include the material.

I tried to look at export example ( https://github.com/atteneder/glTFast/blob/main/Documentation%7E/ExportRuntime.md ) and trying to use the SimpleExport example. But It returns an error that it can't find GLTFast.Exports from using nor GameObjectExport class.

Files
Due to confidential glb I managed to reproduce the issue with GLBs from a different issue

GLB.zip

To Reproduce
Steps to reproduce the behavior:

  1. Import assert into the project
  2. Place glb in scene and select it
  3. Go to GameObject > Export gltf > gltf-Binary (.glb)
  4. Open generated glb and see lack of materials.

Expected behavior
The GameObject is exported with material

Screenshots

image
image

export.zip

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • glTFast version v6.0.1
  • Unity Editor version 2022.2.4f1
  • Render Pipeline and version HDRP 14.0.5
  • Platform: Editor

Additional context
Add any other context about the problem here.
MeshMerger.zip

This is the script I am trying to run, I have gltFast v6.0.1 added as package in package manager.

@MatthieuKiskonen MatthieuKiskonen added the bug Something isn't working label Oct 27, 2023
@atteneder
Copy link
Owner

Hi,

I assume you're not using HDRP Lit shaders (since the sources are glTFast imported glbs). It's a known issue that the glTFast shaders won't export well at the moment and thus round-trips are prone to errors.

See #385 and #351

Always curious what your use-case is. It helps me prioritize working on a solution. Thanks!

@MatthieuKiskonen
Copy link
Author

Hi,

Our use case is that we create high fidelity rendering of furnished apartments, for this we use Unity to prepare the shots and then we need to export the scene to go through a distributed rendering system.

We also use a lot of tooling to prepare this as well as blend shapes that we need to convert to static meshes and alike as can be seen in the example script.

@MatthieuKiskonen
Copy link
Author

Hi,

Is there an option to unpack the glb content on import? Or import using HDRP Lit Shader?
This way I could create the copy with a HDRP Lit shader using the textures and would allow to export an imported glb.

@Sov3rain
Copy link

Sov3rain commented Nov 23, 2023

Hey @atteneder, any news on the ability to do round-trips import/export at runtime? This feature would be greatly appreciated. Our use case is to be able to import multiple glb files at runtime and reexport them in one scene (bundling them). Avoiding the pain of changing all the materials and swapping maps channels around would be great!

@d4n3x
Copy link

d4n3x commented Jan 16, 2024

Also have the same problem with importing an object during runtime but with URP. Same gltfast version.
Any updates on this?

@slonepro
Copy link

Same problems here... Big mystery, the missing textures...

@youdonotexist
Copy link

Any update on this? @atteneder with the GltFast library going to Unity, is this being worked on internally? Or are you looking for a community PR to solve this issue?

I am interested in round-trip runtime import/export/import using Unity's URP Materials. Right now, importing with URP textures works, but export of that same model fails to export textures/materials.

@atteneder
Copy link
Owner

The next release will festure export of materials based on glTFast's shaders and shader graphs, this enabling import-export round-trips.

Probably comes next week.

Hth

@Sov3rain
Copy link

Sov3rain commented May 7, 2024

The next release will festure export of materials based on glTFast's shaders and shader graphs, this enabling import-export round-trips.

Probably comes next week.

Hth

That's a really good news! We'll test it as soon as it drops 🙂

@youdonotexist
Copy link

6.5 dropped

https://docs.unity3d.com/Packages/com.unity.cloud.gltfast@6.5/changelog/CHANGELOG.html

Will test & report back. Thanks @atteneder & Unity Team!

@flogli
Copy link

flogli commented May 21, 2024

Hi,
I've just tried new 6.5 version
Same problem,
it seems that when I export the model that has glTF/PbrMetallicRoughness (at runtime) and open it on an external gltf/glb viewer the baked material is not displayed, only the mesh with none material or texture.

The same happens when I use the function in editor (right-click > export glTF)

@vini-guerrero
Copy link

vini-guerrero commented Jun 13, 2024

Hello.
Just tested both C# and Editor export, having same issue with v6.6.0 · June 03, 2024 - Unity v2022.3.33f1
Export, import in Blender, materials exist but no textures.

@atteneder
Copy link
Owner

Sorry to hear it's not resolved yet.

Can y'all please look if you have the Image Conversion built-in package enabled (in the Package Manager) and tell me what render pipeline and shaders you are using?

@atteneder
Copy link
Owner

There's a bug where materials are not exported properly when URP/HDRP are both NOT installed.

If that's the case on your end, a fix is incoming.

@atteneder
Copy link
Owner

It's live!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants