diff --git a/addons/bitsquid/import_bsi.py b/addons/bitsquid/import_bsi.py index b775b46..896d78f 100644 --- a/addons/bitsquid/import_bsi.py +++ b/addons/bitsquid/import_bsi.py @@ -18,7 +18,7 @@ import zlib import json import bpy -import mathutils +from mathutils import Vector, Matrix def parse_sjson(file_path, skip_editor_data=True): @@ -181,9 +181,9 @@ def create_object(self, context, name, node_data, geometries): and additional data from the file. """ print("[create_object]", name, node_data) - # A list of tuples, where each tuple represents a Vector3(x, y, z). + # A list of vectors that represent vertex locations. vertices = [] - # A list of tuples, where each tuple contains three indices into `vertices`. + # A list of vectors, where each vector contains three indices into `vertices`. # Those three indices define the vertices that make up the face. faces = [] @@ -207,20 +207,20 @@ def create_object(self, context, name, node_data, geometries): # Iterate over data in sets of three values that represent # `x`, `y` and `z`. for j in range(0, len(stream_data), 3): - vertices.append(( + vertices.append(Vector(( stream_data[j], stream_data[j + 1], stream_data[j + 2], - )) + ))) # Get face definitions. Values are vertex indices. # Iteration works just like vertices above. for j in range(0, len(index_stream), 3): - faces.append(( + faces.append(Vector(( index_stream[j], index_stream[j + 1], index_stream[j + 2], - )) + ))) else: # TODO: Implement other channel types self.report( @@ -249,7 +249,7 @@ def import_node(self, context, name, node_data, global_data): # Needs to happen before scaling can be applied. # TODO: Check if above is true, was seen on Stackoverflow. - obj.matrix_world = mathutils.Matrix() + obj.matrix_world = Matrix() # TODO: Apply tranformation matrix in `node_data["local"]` if "children" in node_data: