diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2022-02-06 18:51:03 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2022-02-06 18:51:03 +0300 |
commit | 6da09c309d756cecac66ac27257414c36f9b51b7 (patch) | |
tree | 5794a53b78a7a1fa66cd65027c66a208bc0a1580 /io_scene_gltf2/blender | |
parent | 713854cc2b230712a154a57b434f8d029fb5873d (diff) |
glTF exporter: remove proxy management
Diffstat (limited to 'io_scene_gltf2/blender')
5 files changed, 11 insertions, 21 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py index 6f68c19e..3a33c074 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py @@ -51,9 +51,8 @@ def __gather_scene(blender_scene, export_settings): nodes=[] ) - for _blender_object in [obj for obj in blender_scene.objects if obj.proxy is None]: - if _blender_object.parent is None: - blender_object = _blender_object.proxy if _blender_object.proxy else _blender_object + for blender_object in blender_scene.objects: + if blender_object.parent is None: node = gltf2_blender_gather_nodes.gather_node( blender_object, blender_object.library.name if blender_object.library else None, @@ -70,17 +69,14 @@ def __gather_animations(blender_scene, export_settings): animations = [] merged_tracks = {} - for _blender_object in blender_scene.objects: - - blender_object = _blender_object.proxy if _blender_object.proxy else _blender_object + for blender_object in blender_scene.objects: # First check if this object is exported or not. Do not export animation of not exported object obj_node = gltf2_blender_gather_nodes.gather_node(blender_object, blender_object.library.name if blender_object.library else None, blender_scene, None, export_settings) if obj_node is not None: - # Check was done on armature, but use here the _proxy object, because this is where the animation is - animations_, merged_tracks = gltf2_blender_gather_animations.gather_animations(_blender_object, merged_tracks, len(animations), export_settings) + animations_, merged_tracks = gltf2_blender_gather_animations.gather_animations(blender_object, merged_tracks, len(animations), export_settings) animations += animations_ if export_settings['gltf_nla_strips'] is False: 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 890ce0ab..ed9c5f8c 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 @@ -86,13 +86,11 @@ def __gather_node(channels: typing.Tuple[bpy.types.FCurve], if isinstance(blender_bone, bpy.types.PoseBone): if export_settings["gltf_def_bones"] is False: - obj = blender_object.proxy if blender_object.proxy else blender_object - return gltf2_blender_gather_joints.gather_joint(obj, blender_bone, export_settings) + return gltf2_blender_gather_joints.gather_joint(blender_object, blender_bone, export_settings) else: bones, _, _ = gltf2_blender_gather_skins.get_bone_tree(None, blender_object) if blender_bone.name in [b.name for b in bones]: - obj = blender_object.proxy if blender_object.proxy else blender_object - return gltf2_blender_gather_joints.gather_joint(obj, blender_bone, export_settings) + return gltf2_blender_gather_joints.gather_joint(blender_object, blender_bone, export_settings) return gltf2_blender_gather_nodes.gather_node(blender_object, blender_object.library.name if blender_object.library else None, 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 726104f4..004e8d64 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 @@ -112,8 +112,7 @@ def gather_animation_channels(blender_action: bpy.types.Action, # Retrieve channels for drivers, if needed - obj_driver = blender_object.proxy if blender_object.proxy else blender_object - drivers_to_manage = gltf2_blender_gather_drivers.get_sk_drivers(obj_driver) + drivers_to_manage = gltf2_blender_gather_drivers.get_sk_drivers(blender_object) for obj, fcurves in drivers_to_manage: channel = __gather_animation_channel( fcurves, diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py index caf14217..bd0ce305 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py @@ -174,8 +174,7 @@ def get_bone_matrix(blender_object_if_armature: typing.Optional[bpy.types.Object # If some drivers must be evaluated, do it here, to avoid to have to change frame by frame later - obj_driver = blender_object_if_armature.proxy if blender_object_if_armature.proxy else blender_object_if_armature - drivers_to_manage = get_sk_drivers(obj_driver) + drivers_to_manage = get_sk_drivers(blender_object_if_armature) for dr_obj, dr_fcurves in drivers_to_manage: vals = get_sk_driver_values(dr_obj, frame, dr_fcurves) diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py index 13c347dc..d94b8c07 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py @@ -166,15 +166,13 @@ def __gather_children(blender_object, blender_scene, export_settings): children = [] only_bone_children = True # True by default, will be set to False if needed # standard children - for _child_object in blender_object.children: - if _child_object.parent_bone: + for child_object in blender_object.children: + if child_object.parent_bone: # this is handled further down, # as the object should be a child of the specific bone, # not the Armature object continue - child_object = _child_object.proxy if _child_object.proxy else _child_object - node = gather_node(child_object, child_object.library.name if child_object.library else None, blender_scene, None, export_settings) @@ -187,7 +185,7 @@ def __gather_children(blender_object, blender_scene, export_settings): if dupli_object.parent is not None: continue if dupli_object.type == "ARMATURE": - continue # There is probably a proxy + continue # There is probably a proxy (no more existing) node = gather_node(dupli_object, dupli_object.library.name if dupli_object.library else None, blender_scene, blender_object.name, export_settings) |