UnityTech / UIWidgets

UIWidget is a Unity Package which helps developers to create, debug and deploy efficient, cross-platform Apps.
Other
1.97k stars 256 forks source link

UIWidgets.widgets.Texture gives an error and is not displayed. #413

Closed ghost closed 4 years ago

ghost commented 4 years ago

When I use new Texture (texture: _img), the following error is displayed. _img is Texture2D.

Mesh '': abnormal mesh bounds - most likely it has some invalid vertices (+/-inifinity or NANs) due to errors exporting.
Mesh bounds min=(0.00, -nan(ind), 0.00), max=(898.00, inf, 0.00). Please make sure the mesh is exported without any errors.
UnityEngine.Graphics:ExecuteCommandBuffer(CommandBuffer)
Unity.UIWidgets.ui.PictureFlusher:flush(uiPicture) (at Assets/ExternalAsset/UIWidgets/Runtime/ui/renderer/cmdbufferCanvas/rendering/canvas_impl.cs:1283)
Unity.UIWidgets.ui.CommandBufferCanvas:flush() (at Assets/ExternalAsset/UIWidgets/Runtime/ui/renderer/cmdbufferCanvas/command_buffer_canvas.cs:18)
Unity.UIWidgets.editor.WindowSurfaceImpl:_presentSurface(Canvas) (at Assets/ExternalAsset/UIWidgets/Runtime/editor/surface.cs:135)
Unity.UIWidgets.editor.WindowSurfaceImpl:<acquireFrame>b__9_0(SurfaceFrame, Canvas) (at Assets/ExternalAsset/UIWidgets/Runtime/editor/surface.cs:111)
Unity.UIWidgets.editor.SurfaceFrame:_performSubmit() (at Assets/ExternalAsset/UIWidgets/Runtime/editor/surface.cs:48)
Unity.UIWidgets.editor.SurfaceFrame:submit() (at Assets/ExternalAsset/UIWidgets/Runtime/editor/surface.cs:38)
Unity.UIWidgets.editor.Rasterizer:_drawToSurface(LayerTree) (at Assets/ExternalAsset/UIWidgets/Runtime/editor/rasterizer.cs:75)
Unity.UIWidgets.editor.Rasterizer:_doDraw(LayerTree) (at Assets/ExternalAsset/UIWidgets/Runtime/editor/rasterizer.cs:57)
Unity.UIWidgets.editor.Rasterizer:draw(LayerTree) (at Assets/ExternalAsset/UIWidgets/Runtime/editor/rasterizer.cs:41)
Unity.UIWidgets.editor.WindowAdapter:render(Scene) (at Assets/ExternalAsset/UIWidgets/Runtime/editor/editor_window.cs:548)
Unity.UIWidgets.rendering.RenderView:compositeFrame() (at Assets/ExternalAsset/UIWidgets/Runtime/rendering/view.cs:120)
Unity.UIWidgets.rendering.RendererBinding:drawFrame() (at Assets/ExternalAsset/UIWidgets/Runtime/rendering/binding.cs:90)
Unity.UIWidgets.widgets.WidgetsBinding:drawFrame() (at Assets/ExternalAsset/UIWidgets/Runtime/widgets/binding.cs:153)
Unity.UIWidgets.rendering.RendererBinding:_handlePersistentFrameCallback(TimeSpan) (at Assets/ExternalAsset/UIWidgets/Runtime/rendering/binding.cs:73)
Unity.UIWidgets.scheduler.SchedulerBinding:_invokeFrameCallback(FrameCallback, TimeSpan, String) (at Assets/ExternalAsset/UIWidgets/Runtime/scheduler/binding.cs:356)
Unity.UIWidgets.scheduler.SchedulerBinding:handleDrawFrame() (at Assets/ExternalAsset/UIWidgets/Runtime/scheduler/binding.cs:297)
Unity.UIWidgets.scheduler.SchedulerBinding:_handleDrawFrame() (at Assets/ExternalAsset/UIWidgets/Runtime/scheduler/binding.cs:234)
Unity.UIWidgets.editor.WindowAdapter:_beginFrame() (at Assets/ExternalAsset/UIWidgets/Runtime/editor/editor_window.cs:365)
Unity.UIWidgets.editor.WindowAdapter:_doOnGUI(Event) (at Assets/ExternalAsset/UIWidgets/Runtime/editor/editor_window.cs:373)
Unity.UIWidgets.editor.WindowAdapter:OnGUI(Event) (at Assets/ExternalAsset/UIWidgets/Runtime/editor/editor_window.cs:341)
Unity.UIWidgets.engine.UIWidgetWindowAdapter:OnGUI(Event) (at Assets/ExternalAsset/UIWidgets/Runtime/engine/UIWidgetsPanel.cs:54)
Unity.UIWidgets.engine.UIWidgetsPanel:Update() (at Assets/ExternalAsset/UIWidgets/Runtime/engine/UIWidgetsPanel.cs:245)

Texture

zhuxingwei commented 4 years ago

Hi Thanks for the reporting ! According to the traceback, the cause should be some invalid data (e.g., vertice ) of the Texture2D mesh. To troubleshot it, please first make sure that the texture is correctly displayed in Unity without UIWidgets. if it is ok, then please send us the minimal code snippets that would trigger this error. We will give it a look asap. Thanks for the help!

ghost commented 4 years ago

Thank you for your response. I checked how to use Flutter Texture. When I placed the Texture inside the Container with the specified width and height, it worked properly.