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-04-18 10:29:51 +0300
committerJulien Duroure <julien.duroure@gmail.com>2020-04-18 10:29:51 +0300
commit4ef5cd10f6895fbee5704d088fdbc493c0874dd9 (patch)
tree42baad4073c5216d36e8ab89c909b7d3abcc5be6
parent15d56ea627d9f07b02521dfce09e9dce01647ef1 (diff)
glTF exporter: do not raise error when some not known properties are animated
-rwxr-xr-xio_scene_gltf2/__init__.py2
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channel_target.py2
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py39
3 files changed, 23 insertions, 20 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index df89d6e6..ea3aa8ae 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (1, 2, 66),
+ "version": (1, 2, 67),
'blender': (2, 83, 9),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channel_target.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channel_target.py
index 6edf52cc..488f09ea 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channel_target.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channel_target.py
@@ -122,6 +122,6 @@ def __gather_path(channels: typing.Tuple[bpy.types.FCurve],
}.get(target)
if target is None:
- raise RuntimeError("Cannot export an animation with {} target".format(target))
+ return None
return path
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py
index 6868047e..cf23ead1 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py
@@ -191,25 +191,28 @@ def __gather_animation_channel(channels: typing.Tuple[bpy.types.FCurve],
if not __filter_animation_channel(channels, blender_object, export_settings):
return None
- animation_channel = gltf2_io.AnimationChannel(
- extensions=__gather_extensions(channels, blender_object, export_settings, bake_bone),
- extras=__gather_extras(channels, blender_object, export_settings, bake_bone),
- sampler=__gather_sampler(channels, blender_object, export_settings, bake_bone, bake_channel, bake_range_start, bake_range_end, action_name, driver_obj),
- target=__gather_target(channels, blender_object, export_settings, bake_bone, bake_channel, driver_obj)
- )
+ __target= __gather_target(channels, blender_object, export_settings, bake_bone, bake_channel, driver_obj)
+ if __target.path is not None:
+ animation_channel = gltf2_io.AnimationChannel(
+ extensions=__gather_extensions(channels, blender_object, export_settings, bake_bone),
+ extras=__gather_extras(channels, blender_object, export_settings, bake_bone),
+ sampler=__gather_sampler(channels, blender_object, export_settings, bake_bone, bake_channel, bake_range_start, bake_range_end, action_name, driver_obj),
+ target=__target
+ )
+
+ export_user_extensions('gather_animation_channel_hook',
+ export_settings,
+ animation_channel,
+ channels,
+ blender_object,
+ bake_bone,
+ bake_channel,
+ bake_range_start,
+ bake_range_end,
+ action_name)
- export_user_extensions('gather_animation_channel_hook',
- export_settings,
- animation_channel,
- channels,
- blender_object,
- bake_bone,
- bake_channel,
- bake_range_start,
- bake_range_end,
- action_name)
-
- return animation_channel
+ return animation_channel
+ return None
def __filter_animation_channel(channels: typing.Tuple[bpy.types.FCurve],