googlevr / tilt-brush-toolkit

Scripts and assets that help you use Tilt Brush data in your creative projects.
Apache License 2.0
744 stars 164 forks source link

Import Errors #43

Open mrlinds opened 4 years ago

mrlinds commented 4 years ago

When upgrading unity, or opening the project for the first time, tiltbrush models always fail to import properly. After initial import has completed, we then need to reimport all the tiltbrush assets again. I assume it's an order of import with the models importing before the brush definitions are available.

InvalidOperationException: Cannot find TiltBrushToolkitSettings.asset TiltBrushToolkit.TbtSettings.get_Instance () (at Assets/ThirdParty/TiltBrush/Scripts/TbtSettings.cs:30) TiltBrushToolkit.TbtSettings.get_BrushManifest () (at Assets/ThirdParty/TiltBrush/Scripts/TbtSettings.cs:42) TiltBrushToolkit.ModelImportSettings.GetDescriptorForStroke (System.String oldMaterialName) (at Assets/ThirdParty/TiltBrush/Scripts/Editor/ModelImportSettings.cs:451) TiltBrushToolkit.ModelImportSettings.OnAssignMaterialModel (UnityEngine.Material material, UnityEngine.Renderer renderer) (at Assets/ThirdParty/TiltBrush/Scripts/Editor/ModelImportSettings.cs:228) System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0) UnityEditor.AssetPostprocessingInternal.InvokeMethodIfAvailable (System.Object target, System.String methodName, System.Object[] args) (at <6f28216fea9f453abf2e05b770ed3ee4>:0) UnityEditor.AssetPostprocessingInternal.ProcessMeshAssignMaterial (UnityEngine.Renderer renderer, UnityEngine.Material material) (at <6f28216fea9f453abf2e05b770ed3ee4>:0)

dubois commented 4 years ago

Yeah; editor extensions are really supposed to be distributed as dlls. On initial import, the C#, the models, the ScriptableObjects, etc are all getting imported at the same time and Unity doesn't know anything about dependencies. IIRC there are also restrictions on when you can import new assets.

In this case, I am not sure that compiling into a .dll would fix it since it's a dependency from the C# code to a ScriptableObject. It's quite irritating, I agree; and I haven't thought of a reasonable fix.

DeepChallengerVR commented 1 year ago

Hi, I am running into this issue. Any ideas for work arounds / fixes?

Edit: After better understanding above messages I realize re-importing tiltbrush assets is an ok workaround. If anyone else finds this thread: