Parcourir la source

Blender: Moved index buffer out of attributes JSON.

tschw il y a 10 ans
Parent
commit
a4e892b5a3
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      utils/exporters/blender/addons/io_three/exporter/geometry.py

+ 4 - 1
utils/exporters/blender/addons/io_three/exporter/geometry.py

@@ -363,6 +363,9 @@ class Geometry(base_classes.BaseNode):
                 data[constants.DATA] = geometry_data = {}
                 data[constants.DATA] = geometry_data = {}
 
 
             geometry_data[constants.ATTRIBUTES] = component_data
             geometry_data[constants.ATTRIBUTES] = component_data
+            index = self.get(constants.INDEX)
+            if index is not None:
+                geometry_data[constants.INDEX] = index
             draw_calls = self.get(constants.DRAW_CALLS)
             draw_calls = self.get(constants.DRAW_CALLS)
             if draw_calls is not None:
             if draw_calls is not None:
                 geometry_data[constants.DRAW_CALLS] = draw_calls
                 geometry_data[constants.DRAW_CALLS] = draw_calls
@@ -495,7 +498,7 @@ class Geometry(base_classes.BaseNode):
                 array = attrib_data_out[i][0]
                 array = attrib_data_out[i][0]
                 self[constants.ATTRIBUTES][key][constants.ARRAY] = array
                 self[constants.ATTRIBUTES][key][constants.ARRAY] = array
 
 
-            self[constants.ATTRIBUTES][constants.INDEX] = {
+            self[constants.INDEX] = {
                 constants.ITEM_SIZE: 1,
                 constants.ITEM_SIZE: 1,
                 constants.TYPE: option_index_type,
                 constants.TYPE: option_index_type,
                 constants.ARRAY: index_data
                 constants.ARRAY: index_data