ursina
ursina copied to clipboard
Exception: Error in Mesh. Ensure Mesh is valid and the inputs have same length
PS C:\Users\Shivam\Desktop\voxel 3d\Rally-master> py main.py
Hello from the Rally Server!
warning: Tried to instantiate Entity before Ursina. Please create an instance of Ursina first (app = Ursina()) Traceback(filename='C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\audio.py', lineno=17, function='init', code_context=[' super().init(**kwargs)\n'], index=0, positions=Positions(lineno=17, end_lineno=17, col_offset=8, end_col_offset=34)) no audio found with name: /ringtones/clicking.ogg supported formats: .ogg, .wav warning: missing audio clip: /ringtones/clicking.ogg warning: Tried to instantiate Entity before Ursina. Please create an instance of Ursina first (app = Ursina()) Traceback(filename='C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\audio.py', lineno=17, function='init', code_context=[' super().init(**kwargs)\n'], index=0, positions=Positions(lineno=17, end_lineno=17, col_offset=8, end_col_offset=34)) no audio found with name: /ringtones/subtle.ogg supported formats: .ogg, .wav warning: missing audio clip: /ringtones/subtle.ogg warning: Tried to instantiate Entity before Ursina. Please create an instance of Ursina first (app = Ursina()) Traceback(filename='C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\audio.py', lineno=17, function='init', code_context=[' super().init(**kwargs)\n'], index=0, positions=Positions(lineno=17, end_lineno=17, col_offset=8, end_col_offset=34)) no audio found with name: /ringtones/uplifting.ogg supported formats: .ogg, .wav warning: missing audio clip: /ringtones/uplifting.ogg warning: Tried to instantiate Entity before Ursina. Please create an instance of Ursina first (app = Ursina()) Traceback(filename='C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\ursinastuff.py', lineno=230, function='call', code_context=[' obj = type.call(cls, *args, **kwargs)\n'], index=0, positions=Positions(lineno=230, end_lineno=230, col_offset=14, end_col_offset=49)) info: Using primary monitor: Monitor(x=0, y=0, width=1366, height=768, width_mm=344, height_mm=193, name='\\.\DISPLAY1', is_primary=True) :prc(warning): Invalid integer value for ConfigVariable win-size: 614.4000244140625 :prc(warning): Invalid integer value for ConfigVariable win-size: 1092.800048828125 Known pipe types: wglGraphicsPipe (3 aux display modules not yet loaded.) set window position: Vec2(137, 77) :prc(warning): changing default value for ConfigVariable paste-emit-keystrokes from '1' to '0'. :pnmimage:png(warning): iCCP: known incorrect sRGB profile package_folder: C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina asset_folder: . set fullscreen to True Monitor(x=0, y=0, width=1366, height=768, width_mm=344, height_mm=193, name='\\.\DISPLAY1', is_primary=True) set window position: Vec2(0, 0) ---------------set size to: Vec2(1366, 768) read obj at: assets\cars\sports-car.obj read obj at: assets\cars\sports-car.obj Traceback (most recent call last): :thread(error): Exception occurred within PythonThread PythonThread-0 Traceback (most recent call last): File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\mesh.py", line 90, in _set_array_data File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\mesh.py", line 90, in _set_array_data vmem[:] = a vmem[:] = a ~~~~^^^ ~~~~^^^ ValueError: memoryview assignment: lvalue and rvalue have different structures
ValueError: memoryview assignment: lvalue and rvalue have different structures
During handling of the above exception, another exception occurred: During handling of the above exception, another exception occurred:
Traceback (most recent call last):
Traceback (most recent call last):
File "C:\Users\Shivam\Desktop\voxel 3d\Rally-master\main.py", line 106, in
car = Car()
^^^^^
function(*args, **kwargs)
File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\ursinastuff.py", line 230, in call
File "C:\Users\Shivam\Desktop\voxel 3d\Rally-master\main.py", line 95, in load_assets
obj = type.call(cls, *args, **kwargs)
load_model(m)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\mesh_importer.py", line 79, in load_model
File "C:\Users\Shivam\Desktop\voxel 3d\Rally-master\car.py", line 11, in init
m = obj_to_ursinamesh(path=path, name=name, return_mesh=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
super().init(
File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\mesh_importer.py", line 375, in obj_to_ursinamesh
File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\entity.py", line 107, in init
setattr(self, key, kwargs[key])
File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\entity.py", line 198, in model_setter
return Mesh(
^^^^^
File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\mesh.py", line 69, in init
m = load_model(value, application.asset_folder)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.generate()
File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\mesh_importer.py", line 79, in load_model
File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\mesh.py", line 180, in generate
m = obj_to_ursinamesh(path=path, name=name, return_mesh=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self._set_array_data(vdata.modify_array(color_attribute_index), self._ravel(self.colors), 'f')
File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\mesh_importer.py", line 375, in obj_to_ursinamesh
File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\mesh.py", line 92, in _set_array_data
return Mesh(
raise Exception(f'Error in Mesh. Ensure Mesh is valid and the inputs have same length: vertices:{len(self.vertices)}, triangles:{len(self.triangles)}, normals:{len(self.normals)}, colors:{len(self.colors)}, uvs:{len(self.uvs)}')
^^^^^
Exception: Error in Mesh. Ensure Mesh is valid and the inputs have same length: vertices:8724, triangles:0, normals:8724, colors:8548, uvs:8724
File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\mesh.py", line 69, in init
self.generate()
File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\mesh.py", line 180, in generate
self._set_array_data(vdata.modify_array(color_attribute_index), self._ravel(self.colors), 'f')
File "C:\Users\Shivam\AppData\Local\Programs\Python\Python312\Lib\site-packages\ursina\mesh.py", line 92, in _set_array_data
raise Exception(f'Error in Mesh. Ensure Mesh is valid and the inputs have same length: vertices:{len(self.vertices)}, triangles:{len(self.triangles)}, normals:{len(self.normals)}, colors:{len(self.colors)}, uvs:{len(self.uvs)}')
Exception: Error in Mesh. Ensure Mesh is valid and the inputs have same length: vertices:8724, triangles:0, normals:8724, colors:8548, uvs:8724
PS C:\Users\Shivam\Desktop\voxel 3d\Rally-master>