mirror of
https://github.com/Relintai/broken_seals.git
synced 2025-01-08 01:49:35 +01:00
Fix 2 errors in mesh_data_resource_editor when a mesh data resource is empty.
This commit is contained in:
parent
19820f1522
commit
991f327682
@ -101,6 +101,9 @@ func redraw():
|
|||||||
if !mdr:
|
if !mdr:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if mdr.array.size() != ArrayMesh.ARRAY_MAX:
|
||||||
|
return
|
||||||
|
|
||||||
var handles_material : SpatialMaterial = get_plugin().get_material("handles", self)
|
var handles_material : SpatialMaterial = get_plugin().get_material("handles", self)
|
||||||
|
|
||||||
if vertices.size() == 0:
|
if vertices.size() == 0:
|
||||||
|
@ -20,6 +20,9 @@ func on_mdr_changed():
|
|||||||
func _draw():
|
func _draw():
|
||||||
if !mesh_data_resource:
|
if !mesh_data_resource:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if mesh_data_resource.array.size() != ArrayMesh.ARRAY_MAX:
|
||||||
|
return
|
||||||
|
|
||||||
var uvs : PoolVector2Array = mesh_data_resource.array[ArrayMesh.ARRAY_TEX_UV]
|
var uvs : PoolVector2Array = mesh_data_resource.array[ArrayMesh.ARRAY_TEX_UV]
|
||||||
var indices : PoolIntArray = mesh_data_resource.array[ArrayMesh.ARRAY_INDEX]
|
var indices : PoolIntArray = mesh_data_resource.array[ArrayMesh.ARRAY_INDEX]
|
||||||
|
15
game/test_mdr/Spatial.tscn
Normal file
15
game/test_mdr/Spatial.tscn
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://modules/planets/test_planet/voxel_library/textures/grass_mossy_albedo.png" type="Texture" id=1]
|
||||||
|
|
||||||
|
[sub_resource type="MeshDataResource" id=1]
|
||||||
|
|
||||||
|
[sub_resource type="SpatialMaterial" id=2]
|
||||||
|
albedo_texture = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="Spatial" type="Spatial"]
|
||||||
|
|
||||||
|
[node name="MeshDataInstance" type="MeshDataInstance" parent="."]
|
||||||
|
mesh_data = SubResource( 1 )
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
material = SubResource( 2 )
|
Loading…
Reference in New Issue
Block a user