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

UniGLTF / VRMShader assembly file autoReference setting needs to be true for UPM package import #993

Closed
dblatner opened this issue May 31, 2021 · 5 comments

Comments

@dblatner
Copy link

dblatner commented May 31, 2021

VRMShader assembly definition file needs to set "autoReference" property to "true" .

Otherwise, when importing UniGLTF/VRMShaders as UPM package, Unity throws an error that type references are missing. (e.g. when using gltfExporter.Export(...) method).

I checked latest pre-release version 0.75 .

Should be a very quick fix :-)

@ousttrue
Copy link
Contributor

ousttrue commented Jun 8, 2021

I don't know how to reproduce the problem.
Please tell me the details 👀

@dblatner
Copy link
Author

dblatner commented Jun 10, 2021

@ousttrue : steps for reproduction:

  1. import VRMshaders and UniGLTF as packages into Unity
  2. create a script for runtime importing a GLB file (using ImporterContext etc.)

-> Unity shows an error in the console similar to this
error CS0012: The type 'SubAssetKey' is defined in an assembly that is not referenced. You must add a reference to assembly 'VRMShaders.GLTF.IO.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

Then, if you set VRMshaders assembly definition file "autoReference", Unity will work with UniGLTF/VRMshaders as expected.

Most of the time, "autoReference" should be enabled on asmdef files.

image

@Santarh
Copy link
Contributor

Santarh commented Jun 15, 2021

Thanks your description!

For the clean code design, we use the Assembly Definition and disallow the Auto Referenced property explicitly. ​
You need to use the Assembly Definition file in your own code.

refs: https://docs.unity3d.com/2019.4/Documentation/Manual/ScriptCompilationAssemblyDefinitionFiles.htm

@naninunenoy
Copy link

It seems too advanced to force everyone to use asmdef. 🤯
I also think asmdef is useful, but I think autoReference=true is better because it gives the choice to use or not use asmdef.

@Santarh
Copy link
Contributor

Santarh commented Sep 3, 2021

Some asmdef files has been set Auto Referenced true since v0.79.0 !

@Santarh Santarh closed this as completed Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants