# HG changeset patch # User Sam # Date 1695225166 -25200 # Node ID 5341af5b9b2b8abea32d5b85ad1d895731d7f118 # Parent 6a09fe5dc99bab176e45bb5b92c065a3a6d0a1e5 add: consider multiple materials when loading gltf diff -r 6a09fe5dc99b -r 5341af5b9b2b src/semicongine/resources/mesh.nim --- a/src/semicongine/resources/mesh.nim Wed Sep 20 22:35:04 2023 +0700 +++ b/src/semicongine/resources/mesh.nim Wed Sep 20 22:52:46 2023 +0700 @@ -227,9 +227,9 @@ # but or current mesh/rendering implementation is only designed for a single material # currently this is usually handled by adding the values as shader globals # TODO: this is bad - mesh[].materials = @[material] + mesh[].materials.add material else: - mesh[].materials = @[DEFAULT_MATERIAL] + mesh[].materials.add DEFAULT_MATERIAL if primitiveNode.hasKey("indices"): assert mesh[].indexType != None