-
Notifications
You must be signed in to change notification settings - Fork 226
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
Error opening Creator Window #30
Comments
Sorry to hear that! I'll do my best to get to the bottom of it. Can you walk me through the exact steps you took to install Deform? |
All I did was add this line to manifest.json: |
I'm able to add the various deform components to objects manually and it works. So far the UI is the only issue I'm seeing. |
Thanks for the info. I'll see if I can reproduce the error when I get home from work. What were the exact version numbers of Unity that you used? |
I'm using 2019.3.0f3. I also tried it on 2019.2.6f1 with the same error. Thanks for looking into it! |
Hmmm I made new projects on both versions of Unity, installed Deform as a package via the manifest file and was able to open and use the Creator Window without any issues. It appears the exception that's getting thrown on your end happens when classes in a module cannot be loaded. I'm not sure why this is happening for you though. Here's the things I'd recommend trying (some of which you may have tried already):
If nothing changes after trying these things, try cloning the repo into your Packages folder (after removing it from the manifest), opening the CreatorWindow.cs file and pasting these two methods over the public static IEnumerable<DeformerAttribute> GetAllDeformerAttributes ()
{
var assemblies = AppDomain.CurrentDomain.GetAssemblies ();
foreach (var assembly in assemblies)
{
foreach (var type in GetLoadableTypes (assembly))
{
if (type.IsSubclassOf (typeof (Deformer)))
{
var attribute = type.GetCustomAttribute<DeformerAttribute> (false);
if (attribute != null)
yield return attribute;
}
}
}
}
public static IEnumerable<Type> GetLoadableTypes(Assembly assembly)
{
try
{
return assembly.GetTypes();
}
catch (ReflectionTypeLoadException e)
{
return e.Types.Where(t => t != null);
}
} I have no idea if it will fix anything since I cannot reproduce the error, but it's the best I can do. If the error still persists I'm not sure I can do anything further without you sending me a repro. Apologies for the trouble this is causing you, but hopefully we can find a fix! |
We use unity assembly definitions to split our project into multiple assemblies. I suspect the issue is related to how we divide it up, but your change to CreatorWindow.cs fixed it! Any chance this change will make it into the main branch? That would allow us to switch back to the package version :) Thanks for your help! |
I'm glad it worked! I'll try and make a new release today. Does it look like all the deformers are present in the Creator Window? |
Yea, it's a long list with Normal, Noise, Mask and Utility sections. All the deformers I've tested are working. The only minor issue I've noticed it Create Deformable comes in with a pink material since I'm using URP. Easy enough to swap out the material. Thanks again for your help! |
I created another issue to look into allowing the user to change the default material here #31. If it's cloned into your Packages folder you can change it (I think), but I'm not so sure if it'll work if Deform is installed via git url in the manifest. |
Creator Window fix is in the newest release/on the master branch. |
We installed Deform as a package in both Unity 2019.2 and 2019.3. The Creator Window says "No deformers found." and throws an exception:
ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
System.Reflection.Assembly.GetTypes () (at <437ba245d8404784b9fbab9b439ac908>:0)
DeformEditor.CreatorWindow+d__18.MoveNext () (at Library/PackageCache/com.beans.deform@5c7ccda4236aec3ff1e7ada04879bca945eba466/Code/Editor/CreatorWindow.cs:317)
System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable
1[T] source, System.Int32& length) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) System.Linq.Buffer
1[TElement]..ctor (System.Collections.Generic.IEnumerable1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) System.Linq.OrderedEnumerable
1[TElement].ToArray () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)System.Linq.Buffer
1[TElement]..ctor (System.Collections.Generic.IEnumerable
1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)System.Linq.OrderedEnumerable
1[TElement].ToList () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0) System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable
1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)DeformEditor.CreatorWindow.UpdateDeformerAttributes () (at Library/PackageCache/com.beans.deform@5c7ccda4236aec3ff1e7ada04879bca945eba466/Code/Editor/CreatorWindow.cs:62)
DeformEditor.CreatorWindow.OnEnable () (at Library/PackageCache/com.beans.deform@5c7ccda4236aec3ff1e7ada04879bca945eba466/Code/Editor/CreatorWindow.cs:69)
UnityEditor.EditorWindow:GetWindow(String, Boolean)
DeformEditor.CreatorWindow:ShowWindow() (at Library/PackageCache/com.beans.deform@5c7ccda4236aec3ff1e7ada04879bca945eba466/Code/Editor/CreatorWindow.cs:56)
The text was updated successfully, but these errors were encountered: