diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-01-25 04:33:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-01-25 04:33:59 +0300 |
commit | 425a3f6a705beab849cab36d2ca2ae43726d700f (patch) | |
tree | 00802f0b1efac9d9fc8b7b4062ab5349ca90722d /io_scene_gltf2 | |
parent | 3c6e9c26bc6b35399dfbc38c3116b1375fa6f53c (diff) |
Cleanup: strip trailing space
Diffstat (limited to 'io_scene_gltf2')
4 files changed, 13 insertions, 13 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gltf2_exporter.py b/io_scene_gltf2/blender/exp/gltf2_blender_gltf2_exporter.py index d2a2cf3a..bd4f6a96 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gltf2_exporter.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gltf2_exporter.py @@ -45,7 +45,7 @@ class GlTF2Exporter: generator='Khronos glTF Blender I/O v' + get_version_string(), min_version=None, version='2.0') - + export_user_extensions('gather_asset_hook', export_settings, asset) self.__gltf = gltf2_io.Gltf( @@ -106,7 +106,7 @@ class GlTF2Exporter: gltf2_io.MaterialNormalTextureInfoClass, gltf2_io.MaterialOcclusionTextureInfoClass ] - + self.__traverse(asset) @property diff --git a/io_scene_gltf2/blender/imp/gltf2_io_draco_compression_extension.py b/io_scene_gltf2/blender/imp/gltf2_io_draco_compression_extension.py index 5a93673f..42c1af6b 100644 --- a/io_scene_gltf2/blender/imp/gltf2_io_draco_compression_extension.py +++ b/io_scene_gltf2/blender/imp/gltf2_io_draco_compression_extension.py @@ -64,7 +64,7 @@ def decode_primitive(gltf, prim): dll.decoderCopyIndices.restype = None dll.decoderCopyIndices.argtypes = [c_void_p, c_void_p] - + decoder = dll.decoderCreate() extension = prim.extensions['KHR_draco_mesh_compression'] @@ -82,7 +82,7 @@ def decode_primitive(gltf, prim): for existing_buffer_idx in gltf.buffers: if base_buffer_idx <= existing_buffer_idx: base_buffer_idx = existing_buffer_idx + 1 - + # Read indices. index_accessor = gltf.data.accessors[prim.indices] if dll.decoderGetIndexCount(decoder) != index_accessor.count: @@ -91,7 +91,7 @@ def decode_primitive(gltf, prim): if not dll.decoderReadIndices(decoder, index_accessor.component_type): print_console('ERROR', 'Draco Decoder: Unable to decode indices. Skipping primitive {}.'.format(name)) return - + indices_byte_length = dll.decoderGetIndicesByteLength(decoder) decoded_data = bytes(indices_byte_length) dll.decoderCopyIndices(decoder, decoded_data) @@ -107,14 +107,14 @@ def decode_primitive(gltf, prim): # Update accessor to point to the new buffer view. index_accessor.buffer_view = len(gltf.data.buffer_views) - 1 - + # Read each attribute. for attr_idx, attr in enumerate(extension['attributes']): dracoId = extension['attributes'][attr] if attr not in prim.attributes: print_console('ERROR', 'Draco Decoder: Draco attribute {} not in primitive attributes. Skipping primitive {}.'.format(attr, name)) return - + accessor = gltf.data.accessors[prim.attributes[attr]] if dll.decoderGetVertexCount(decoder) != accessor.count: print_console('WARNING', 'Draco Decoder: Vertex count of accessor and decoded vertex count does not match for attribute {}. Updating accessor.'.format(attr, name)) @@ -122,7 +122,7 @@ def decode_primitive(gltf, prim): if not dll.decoderReadAttribute(decoder, dracoId, accessor.component_type, accessor.type.encode()): print_console('ERROR', 'Draco Decoder: Could not decode attribute {}. Skipping primitive {}.'.format(attr, name)) return - + byte_length = dll.decoderGetAttributeByteLength(decoder, dracoId) decoded_data = bytes(byte_length) dll.decoderCopyAttribute(decoder, dracoId, decoded_data) @@ -130,7 +130,7 @@ def decode_primitive(gltf, prim): # Generate a new buffer holding the decoded vertex data. buffer_idx = base_buffer_idx + 1 + attr_idx gltf.buffers[buffer_idx] = decoded_data - + # Create a buffer view referencing the new buffer. gltf.data.buffer_views.append(BufferView.from_dict({ 'buffer': buffer_idx, diff --git a/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py b/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py index 51359f82..fc57a1e5 100644 --- a/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py +++ b/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py @@ -39,7 +39,7 @@ def dll_path() -> Path: }.get(sys.platform) else: path = Path(path) - + library_name = { 'win32': '{}.dll'.format(lib_name), 'linux': 'lib{}.so'.format(lib_name), diff --git a/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py b/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py index 613bd231..0c6bfaf4 100644 --- a/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py +++ b/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py @@ -40,7 +40,7 @@ def encode_scene_primitives(scenes, export_settings): dll.encoderSetQuantizationBits.restype = None dll.encoderSetQuantizationBits.argtypes = [c_void_p, c_uint32, c_uint32, c_uint32, c_uint32, c_uint32] - + dll.encoderSetIndices.restype = None dll.encoderSetIndices.argtypes = [c_void_p, c_size_t, c_uint32, c_void_p] @@ -114,7 +114,7 @@ def __encode_primitive(primitive, dll, export_settings): export_settings['gltf_draco_texcoord_quantization'], export_settings['gltf_draco_color_quantization'], export_settings['gltf_draco_generic_quantization']) - + if not dll.encoderEncode(encoder, primitive.targets is not None and len(primitive.targets) > 0): print_console('ERROR', 'Could not encode primitive. Skipping primitive.') @@ -124,7 +124,7 @@ def __encode_primitive(primitive, dll, export_settings): if primitive.extensions is None: primitive.extensions = {} - + primitive.extensions['KHR_draco_mesh_compression'] = { 'bufferView': BinaryData(encoded_data), 'attributes': draco_ids |