-
Notifications
You must be signed in to change notification settings - Fork 496
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
Shader value always null #393
Comments
I have the same issue, using the latest Unity (2019.1) with the latest unitypackage release on Linux. |
For me the root problem was that I used https://github.com/KhronosGroup/UnityGLTF/releases/download/v1.0.1/UnityGLTF.unitypackage to add GLTF capability to a new, existing project. It turns out that this is not enough. The gltf export also needs a copy of the Resources folder from the repo or source.zip (https://github.com/KhronosGroup/UnityGLTF/archive/v1.0.1.zip) to be available in the project's Assets folder. Without it line 90 in GLTFSceneExporter.cs does not find the "MetalGlossChannelSwap" shader resource and Resources.Load returns null (should there be guard ?). Ultimately, that is a packaging issue since neither UnityGLTF.unitypackage nor the upm package at https://github.com/KhronosGroup/UnityGLTF/releases/download/v1.0.1/org.khronos.UnityGLTF.zip currently contain the Resources folder although they probably should. In other words, it might work to move the Resources folder into the Assets/UnityGLTF folder, in the repo ? |
I moved the Resources folder into Assets/UnityGLTF folder in this branch: |
@andreasplesch , it sounds like you have a fix in your fork. Can you create a pull request so we can get this fix into master? Once this change and pull #406 go in, it might be a good time to create a new release. |
@AdamMitchell-ms , my linux-build branch moved the Resources folder into Assets/UnityGLTF but also has a number of linux specific changes:
Unfortunately, I do not have a way to build and test on MacOSX or Windows. Do you still want me to PR, perhaps for cherry picking ? |
Hey @andreasplesch , I tested your Unity package on MacOSX with Unity 2019.1.3. There are some absolute paths pointing towards your local machine, I got this error: Can you help me to solve this? I think then it might work for importing GLTF from a URL. |
Still getting this with the latest unitypackage on Unity 2019.2.8f1 |
Yep. Still getting this one year after the initial report. Is anyone actually using this? |
I added all shaders from the resources and the gltfutility plugin im using to the Always include shaders list |
Please update to the latest version and open a new issue if the problem persists. Thanks! |
When trying to export any model the exporter always gives an exception that Shader value cannot be null when creating a new material.
The error lies in GLTFSceneExporter.cs line 90
This is on the latest release. Any idea on how I can make it work?
The text was updated successfully, but these errors were encountered: