Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2020-07-21 21:19:01 +0300
committerJulien Duroure <julien.duroure@gmail.com>2020-07-21 21:19:01 +0300
commit3ea1673580ab68ecb713da3233a4f6beaafff5d9 (patch)
tree2464ed49e12a5d244b5003013b45f085cea63893 /io_scene_gltf2/io
parent2b4bf943d0a323e6b0430179cee7fa7ffb5907d3 (diff)
glTF exporter: performance: using numpy
Thanks scurest!
Diffstat (limited to 'io_scene_gltf2/io')
-rwxr-xr-xio_scene_gltf2/io/com/gltf2_io_constants.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/io_scene_gltf2/io/com/gltf2_io_constants.py b/io_scene_gltf2/io/com/gltf2_io_constants.py
index 873e004e..983fe9ab 100755
--- a/io_scene_gltf2/io/com/gltf2_io_constants.py
+++ b/io_scene_gltf2/io/com/gltf2_io_constants.py
@@ -35,6 +35,18 @@ class ComponentType(IntEnum):
}[component_type]
@classmethod
+ def to_numpy_dtype(cls, component_type):
+ import numpy as np
+ return {
+ ComponentType.Byte: np.int8,
+ ComponentType.UnsignedByte: np.uint8,
+ ComponentType.Short: np.int16,
+ ComponentType.UnsignedShort: np.uint16,
+ ComponentType.UnsignedInt: np.uint32,
+ ComponentType.Float: np.float32,
+ }[component_type]
+
+ @classmethod
def from_legacy_define(cls, type_define):
return {
GLTF_COMPONENT_TYPE_BYTE: ComponentType.Byte,