diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-03-12 19:36:02 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-03-12 19:36:02 +0300 |
commit | 9c76d5b39aa7d3531781637b93bd744849af4e3d (patch) | |
tree | 6354027743a096bf70a31913d7683f9c0c8d23ac /io_scene_gltf2/blender/exp/gltf2_blender_gather_accessors.py | |
parent | e5afe16b5bdaa7b8627e706335dc68c8d4c21e16 (diff) |
glTF exporter: Deduplicate cameras, animation sampler and accessors
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_accessors.py')
-rw-r--r-- | io_scene_gltf2/blender/exp/gltf2_blender_gather_accessors.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_accessors.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_accessors.py new file mode 100644 index 00000000..949720d1 --- /dev/null +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_accessors.py @@ -0,0 +1,48 @@ +# Copyright 2018 The glTF-Blender-IO authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import typing + +import bpy +from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached +from io_scene_gltf2.io.com import gltf2_io +from io_scene_gltf2.io.com import gltf2_io_constants +from io_scene_gltf2.io.exp import gltf2_io_binary_data +from . import gltf2_blender_export_keys + + +@cached +def gather_accessor(buffer_view: gltf2_io_binary_data.BinaryData, + component_type: gltf2_io_constants.ComponentType, + count, + max, + min, + type: gltf2_io_constants.DataType, + export_settings) -> gltf2_io.Accessor: + return gltf2_io.Accessor( + buffer_view=buffer_view, + byte_offset=None, + component_type=component_type, + count=count, + extensions=None, + extras=None, + max=list(max) if max is not None else None, + min=list(min) if min is not None else None, + name=None, + normalized=None, + sparse=None, + type=type + ) + |