mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
Don't set half baked arrays into mesh data resource.
This commit is contained in:
parent
5a56b91e6a
commit
670a059fbd
@ -888,17 +888,12 @@ static func apply_seam(mdr : MeshDataResource) -> void:
|
||||
new_vert_size += 2
|
||||
|
||||
arrays[ArrayMesh.ARRAY_INDEX] = indices
|
||||
mdr.array = arrays
|
||||
#mdr.array = arrays
|
||||
|
||||
seam_apply_duplicate_vertices(mdr, duplicate_verts_indices)
|
||||
mdr.array = seam_apply_duplicate_vertices(arrays, duplicate_verts_indices)
|
||||
|
||||
# This will not touch the indices!
|
||||
static func seam_apply_duplicate_vertices(mdr : MeshDataResource, duplicate_verts_indices : PoolIntArray) -> void:
|
||||
var arrays : Array = mdr.get_array()
|
||||
|
||||
if arrays.size() != ArrayMesh.ARRAY_MAX:
|
||||
arrays.resize(ArrayMesh.ARRAY_MAX)
|
||||
|
||||
static func seam_apply_duplicate_vertices(arrays : Array, duplicate_verts_indices : PoolIntArray) -> Array:
|
||||
var vertices : PoolVector3Array = arrays[ArrayMesh.ARRAY_VERTEX]
|
||||
|
||||
var normals : PoolVector3Array
|
||||
@ -989,4 +984,4 @@ static func seam_apply_duplicate_vertices(mdr : MeshDataResource, duplicate_vert
|
||||
if arrays[ArrayMesh.ARRAY_WEIGHTS] != null:
|
||||
arrays[ArrayMesh.ARRAY_WEIGHTS] = weights
|
||||
|
||||
mdr.set_array(arrays)
|
||||
return arrays
|
||||
|
Loading…
Reference in New Issue
Block a user