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

Namespace Gradient makes tool incompatible with Unity 2019.3 #25

Closed
maxiboch opened this issue Feb 5, 2020 · 4 comments
Closed

Namespace Gradient makes tool incompatible with Unity 2019.3 #25

maxiboch opened this issue Feb 5, 2020 · 4 comments
Milestone

Comments

@maxiboch
Copy link

maxiboch commented Feb 5, 2020

Unity has an internal type called Gradient, which it references in scripts that are automatically generated by Unity 2019.3's package manager. As such, it's impossible to use Gradient with Unity 2019.3.

Given that the source isn't available, would it be possible for you to compile & provide another version of this library with an alternate, less generic namespace?

@lostmsu lostmsu modified the milestone: Preview 7 Feb 5, 2020
@lostmsu
Copy link
Contributor

lostmsu commented Feb 5, 2020

This will probably miss Preview 7, but we are planning to switch the namespace to LostTech.TensorFlow and LostTech.Gradient in subsequent releases.

Was this type introduced in Unity recently? This would help to decide severity of the issue.

Also, in C# you can refer to specific names via global:: prefix and extern alias keyword. E.g. using global::Gradient; should import Gradient's types even if Unity has a class with the same name.

If the problem is in the generated scripts, which you can't control, this issue should be reported to Unity too, as generated code should always use fully qualified names (e.g. with global:: prefix) to avoid conflicts like this.

@lostmsu
Copy link
Contributor

lostmsu commented Feb 5, 2020

I must also warn you, that there's a known issue with Unity and Python.Runtime package Gradient uses, that leads to crashes in Unity, which is related to domain reloading.

@maxiboch
Copy link
Author

maxiboch commented Feb 5, 2020

Thanks for the prompt reply! Glad to hear about the upcoming changes.

This type is long-standing in Unity, but I was able to get around it using prefixes & the like, but with 2019.3, they've introduced some generated scripts related to the UI for UnityEngine.Gradients.

I've let my Unity rep know about this issue as well.

I was previously using TensorSharp, but was transitioning to Gradient when I upgraded the engine to the latest release. Can you avoid the issues with the Python.Runtime by disabling Domain Reloading?

@lostmsu
Copy link
Contributor

lostmsu commented Feb 5, 2020

At this moment you will just have to try it. I believe it should alleviate the problem, but from the documentation it looks like this might complicate game development loop, as you'd have to write code resetting state correctly when playback is started/stopped in the IDE.

We have not actually tried to use Gradient inside Unity yet, but I am working closely with a team within Unity, who are using Python.Runtime themselves, and are thus working on the domain reloading problem.

@lostmsu lostmsu added this to the RC0 milestone Feb 7, 2020
@lostmsu lostmsu added the fix ready Fix has been commited for the upcoming release label Jun 23, 2020
@lostmsu lostmsu removed the fix ready Fix has been commited for the upcoming release label Sep 1, 2020
@lostmsu lostmsu closed this as completed Sep 1, 2020
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

2 participants