Issue #67 resolved
Former user created an issue

When importing for the first time or even going into preferences and doing a "recompile editor" I'm getting all sorts of errors, basically Odin is broken for me. The inspector does not work Odin attributes don't compile. example:

/Users/bywright/Projects/bits3d2\Temp\CodeGeneration-d4e1a0cd-f846-43af-922e-718a1731728c\Drawers.cs(1971,31): error CS1031: Type expected UnityEngine.Debug:LogError(Object) Sirenix.Utilities.Editor.CodeGeneration.AssemblyGenerator:Compile(String, Boolean) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.Utilities.Editor/Code Generation/AssemblyGenerator.cs:374) Sirenix.OdinInspector.Editor.EditorCompilation:CompileEditors(TypeDrawerPair[]) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/EditorCompilation.cs:396) Sirenix.OdinInspector.Editor.EditorCompilation:TriggerAutomaticRecompile(TypeDrawerPair[]) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/EditorCompilation.cs:299) Sirenix.OdinInspector.Editor.EditorCompilation:RecompileAsSoonAsPossibleIfEditorsChanged() (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/EditorCompilation.cs:247) UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

/Users/bywright/Projects/bits3d2\Temp\CodeGeneration-9a5f8b5a-6da2-4ffe-9203-878d84a605d0\CompiledEditorContainer.cs(6,33): error CS0234: The type or namespace name Editor' does not exist in the namespaceSirenix.OdinInspector'. Are you missing an assembly reference? UnityEngine.Debug:LogError(Object) Sirenix.Utilities.Editor.CodeGeneration.AssemblyGenerator:Compile(String, Boolean) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.Utilities.Editor/Code Generation/AssemblyGenerator.cs:374) Sirenix.OdinInspector.Editor.EditorCompilation:CompileEditors(TypeDrawerPair[]) (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Misc/EditorCompilation.cs:396) Sirenix.OdinInspector.Editor.<>c:<DrawPropertyLayout>b__18_0() (at C:/Users/Bjarke/Desktop/Projects/Sirenix Development Framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Config/InspectorTypeDrawingConfigDrawer.cs:489) UnityEditor.EditorApplication:Internal_CallDelayFunctions()

Comments (9)

  1. Tor Esa Vestergaard
    • changed status to open

    Thank you for reporting this issue, and sorry for the inconvenience. That's odd - it almost looks like some of Odin's assemblies are missing. Could I ask which version of Unity this is happening in?

  2. Tor Esa Vestergaard

    Also, could you please go into the temp folder of your project after you've received this error (while Unity is still running) and send the contents of one of the code generation folders?

  3. Tor Esa Vestergaard

    It seems like you have a type called "switch" which we are trying to generate an editor for. As switch is an invalid type name, the code refuses to compile. I'm not sure how it happened that you have such a type in your project somewhere, but it seems you do. This isn't a case we considered could ever happen, but we can check for such invalid type names that are taken by language keywords and make sure to never generate editors for them.

    Meanwhile, if you find the type named "switch" in the preferences, and disable Odin editor generation for it, the issue should be resolved.

  4. Tor Esa Vestergaard

    We've implemented a check for types with the names of reserved keywords now - it should make it into the patch after 1.0.0.3a.

    Also, the path in the zip file looks correct enough. The "Temp" folder should lie at the same level as the "Assets", "Library" and "ProjectSettings" folder - IE, in your project's root level folder. It should not be part of your actual project assets. Did you correct the path for the zip file, or was temp actually located in the "bits3d2" folder? If it was, then that is the correct path.

  5. Byron Wright

    okay unchecking "switch" in the types fixed it! "bits3d2" is the project folder. The temp files are getting generated at the same level at the project root folder and not in the project root folder. If you look at the screenshot, the file seperate ("\") is part of the filename and does not create sub folders. There's clearly an issue with the file seperator windows/unix.

  6. Tor Esa Vestergaard

    I see - whoops! Sorry about causing that kind of mess! I've made some additional corrections that should fix that - those will likewise make it into the patch after 1.0.0.3a.

  7. Log in to comment