From 46eec18419d4e15848b4cf4325d9de3c1064b2be Mon Sep 17 00:00:00 2001 From: Julien Duroure Date: Sun, 18 Aug 2024 14:42:01 +0200 Subject: [PATCH 1/3] Update test to 4.3 on main branch --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37e21b06f..26890e400 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: env: CI: true BLENDER_MAJOR: 4 - BLENDER_MINOR: 2 + BLENDER_MINOR: 3 jobs: build: From 8db37273b5d9819d8e0d964874d77ff3268537fa Mon Sep 17 00:00:00 2001 From: Julien Duroure Date: Thu, 29 Aug 2024 17:27:05 +0200 Subject: [PATCH 2/3] Huge file renaming Very long path can be problematic when unziping on Windows --- Technical.md | 12 +++--- addons/io_scene_gltf2/__init__.py | 10 ++--- ..._blender_default.py => blender_default.py} | 0 ...f2_blender_conversion.py => conversion.py} | 2 +- ...ltf2_blender_data_path.py => data_path.py} | 18 ++++++++ .../{gltf2_blender_extras.py => extras.py} | 2 +- .../blender/com/gltf2_blender_math.py | 2 +- .../blender/com/gltf2_blender_ui.py | 2 +- .../{gltf2_blender_json.py => json_util.py} | 0 ...aterial_helpers.py => material_helpers.py} | 0 ...ender_gather_accessors.py => accessors.py} | 6 +-- ...tf2_blender_gather_action.py => action.py} | 30 ++++++------- ...ather_animation_utils.py => anim_utils.py} | 16 +++---- ...der_gather_animations.py => animations.py} | 6 +-- ...2_blender_gather_drivers.py => drivers.py} | 5 +-- ...ther_fcurves_animation.py => animation.py} | 6 +-- ...es_channel_target.py => channel_target.py} | 8 ++-- ...gather_fcurves_channels.py => channels.py} | 14 +++---- ...ther_fcurves_keyframes.py => keyframes.py} | 7 ++-- ...r_gather_fcurves_sampler.py => sampler.py} | 18 ++++---- ...ender_gather_keyframes.py => keyframes.py} | 0 ...re_action_sampled.py => action_sampled.py} | 8 ++-- ...re_channel_target.py => channel_target.py} | 6 +-- .../{armature_channels.py => channels.py} | 20 ++++----- .../{armature_keyframes.py => keyframes.py} | 6 +-- .../{armature_sampler.py => sampler.py} | 14 +++---- ...ta_channel_target.py => channel_target.py} | 2 +- ...er_gather_data_channels.py => channels.py} | 6 +-- ..._gather_data_keyframes.py => keyframes.py} | 8 ++-- ...nder_gather_data_sampler.py => sampler.py} | 10 ++--- ...ct_action_sampled.py => action_sampled.py} | 8 ++-- ...ct_channel_target.py => channel_target.py} | 4 +- ..._gather_object_channels.py => channels.py} | 13 +++--- ...ather_object_keyframes.py => keyframes.py} | 8 ++-- ...er_gather_object_sampler.py => sampler.py} | 16 +++---- ...on_sampling_cache.py => sampling_cache.py} | 10 ++--- ...sk_action_sampled.py => action_sampled.py} | 6 +-- ...sk_channel_target.py => channel_target.py} | 4 +- ...nder_gather_sk_channels.py => channels.py} | 8 ++-- ...er_gather_sk_keyframes.py => keyframes.py} | 16 +++---- ...lender_gather_sk_sampler.py => sampler.py} | 10 ++--- ..._scene_animation.py => scene_animation.py} | 16 +++---- ...tf2_blender_gather_tracks.py => tracks.py} | 12 +++--- ...gltf2_blender_gather_cache.py => cache.py} | 0 ...2_blender_gather_cameras.py => cameras.py} | 8 ++-- .../{gltf2_blender_export.py => export.py} | 14 +++---- ..._blender_gltf2_exporter.py => exporter.py} | 12 +++--- .../{gltf2_blender_gather.py => gather.py} | 16 +++---- .../blender/exp/gltf2_blender_get.py | 42 ------------------- ...tf2_blender_gather_joints.py => joints.py} | 8 ++-- ...r_gather_light_spots.py => light_spots.py} | 2 +- ...tf2_blender_gather_lights.py => lights.py} | 28 ++++++------- ...gltf2_blender_image.py => encode_image.py} | 0 ..._materials_anisotropy.py => anisotropy.py} | 9 ++-- ...er_materials_clearcoat.py => clearcoat.py} | 6 +-- ...ther_materials_emission.py => emission.py} | 4 +- ...blender_gather_materials_ior.py => ior.py} | 4 +- ...der_gather_materials_sheen.py => sheen.py} | 4 +- ...ther_materials_specular.py => specular.py} | 4 +- ...erials_transmission.py => transmission.py} | 4 +- ...ther_materials_variants.py => variants.py} | 4 +- ...r_gather_materials_volume.py => volume.py} | 4 +- ...gltf2_blender_gather_image.py => image.py} | 16 +++---- ...ender_gather_materials.py => materials.py} | 35 ++++++++-------- ...roughness.py => pbr_metallic_roughness.py} | 10 ++--- ...earch_node_tree.py => search_node_tree.py} | 6 +-- ...2_blender_gather_texture.py => texture.py} | 18 ++++---- ...gather_texture_info.py => texture_info.py} | 10 ++--- ...der_gather_materials_unlit.py => unlit.py} | 4 +- .../{gltf2_blender_gather_mesh.py => mesh.py} | 10 ++--- ...gltf2_blender_gather_nodes.py => nodes.py} | 20 ++++----- ..._attributes.py => primitive_attributes.py} | 8 ++-- ...itives_extract.py => primitive_extract.py} | 16 +++---- ...der_gather_primitives.py => primitives.py} | 20 ++++----- ...2_blender_gather_sampler.py => sampler.py} | 8 ++-- ...gltf2_blender_gather_skins.py => skins.py} | 14 +++---- .../{gltf2_blender_gather_tree.py => tree.py} | 12 +++--- ...sotropy.py => KHR_materials_anisotropy.py} | 4 +- ...=> KHR_materials_pbrSpecularGlossiness.py} | 8 ++-- ...erials_unlit.py => KHR_materials_unlit.py} | 2 +- ...ltf2_blender_animation.py => animation.py} | 12 +++--- ...er_animation_node.py => animation_node.py} | 6 +-- ...mation_pointer.py => animation_pointer.py} | 16 +++---- ..._animation_utils.py => animation_utils.py} | 0 ...nimation_weight.py => animation_weight.py} | 4 +- ...{gltf2_blender_gltf.py => blender_gltf.py} | 4 +- .../{gltf2_blender_camera.py => camera.py} | 4 +- ...sion.py => draco_compression_extension.py} | 2 +- .../imp/{gltf2_blender_image.py => image.py} | 4 +- .../imp/{gltf2_blender_light.py => light.py} | 6 +-- ...{gltf2_blender_material.py => material.py} | 10 ++--- ...er_material_utils.py => material_utils.py} | 2 +- .../imp/{gltf2_blender_mesh.py => mesh.py} | 12 +++--- .../imp/{gltf2_blender_node.py => node.py} | 14 +++---- ...icRoughness.py => pbrMetallicRoughness.py} | 10 ++--- .../imp/{gltf2_blender_scene.py => scene.py} | 10 ++--- .../{gltf2_blender_texture.py => texture.py} | 8 ++-- .../imp/{gltf2_blender_vnode.py => vnode.py} | 0 .../{gltf2_io_constants.py => constants.py} | 0 .../io/com/{gltf2_io_debug.py => debug.py} | 0 ...raco_compression_extension.py => draco.py} | 0 addons/io_scene_gltf2/io/com/gltf2_io.py | 2 +- ..._lights_punctual.py => lights_punctual.py} | 0 .../io/com/{gltf2_io_path.py => path.py} | 0 .../com/{gltf2_io_variants.py => variants.py} | 0 ...gltf2_io_binary_data.py => binary_data.py} | 2 +- .../io/exp/{gltf2_io_buffer.py => buffer.py} | 2 +- ...raco_compression_extension.py => draco.py} | 4 +- .../io/exp/{gltf2_io_export.py => export.py} | 2 +- .../{gltf2_io_image_data.py => image_data.py} | 0 ..._user_extensions.py => user_extensions.py} | 0 .../io_scene_gltf2/io/imp/gltf2_io_binary.py | 2 +- addons/io_scene_gltf2/io/imp/gltf2_io_gltf.py | 4 +- ..._user_extensions.py => user_extensions.py} | 0 114 files changed, 441 insertions(+), 470 deletions(-) rename addons/io_scene_gltf2/blender/com/{gltf2_blender_default.py => blender_default.py} (100%) rename addons/io_scene_gltf2/blender/com/{gltf2_blender_conversion.py => conversion.py} (99%) rename addons/io_scene_gltf2/blender/com/{gltf2_blender_data_path.py => data_path.py} (80%) rename addons/io_scene_gltf2/blender/com/{gltf2_blender_extras.py => extras.py} (98%) mode change 100755 => 100644 rename addons/io_scene_gltf2/blender/com/{gltf2_blender_json.py => json_util.py} (100%) rename addons/io_scene_gltf2/blender/com/{gltf2_blender_material_helpers.py => material_helpers.py} (100%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_accessors.py => accessors.py} (97%) rename addons/io_scene_gltf2/blender/exp/animation/{gltf2_blender_gather_action.py => action.py} (96%) rename addons/io_scene_gltf2/blender/exp/animation/{gltf2_blender_gather_animation_utils.py => anim_utils.py} (95%) rename addons/io_scene_gltf2/blender/exp/animation/{gltf2_blender_gather_animations.py => animations.py} (84%) rename addons/io_scene_gltf2/blender/exp/animation/{gltf2_blender_gather_drivers.py => drivers.py} (94%) rename addons/io_scene_gltf2/blender/exp/animation/fcurves/{gltf2_blender_gather_fcurves_animation.py => animation.py} (90%) rename addons/io_scene_gltf2/blender/exp/animation/fcurves/{gltf2_blender_gather_fcurves_channel_target.py => channel_target.py} (89%) rename addons/io_scene_gltf2/blender/exp/animation/fcurves/{gltf2_blender_gather_fcurves_channels.py => channels.py} (96%) rename addons/io_scene_gltf2/blender/exp/animation/fcurves/{gltf2_blender_gather_fcurves_keyframes.py => keyframes.py} (97%) rename addons/io_scene_gltf2/blender/exp/animation/fcurves/{gltf2_blender_gather_fcurves_sampler.py => sampler.py} (94%) rename addons/io_scene_gltf2/blender/exp/animation/{gltf2_blender_gather_keyframes.py => keyframes.py} (100%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/armature/{armature_action_sampled.py => action_sampled.py} (92%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/armature/{armature_channel_target.py => channel_target.py} (91%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/armature/{armature_channels.py => channels.py} (91%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/armature/{armature_keyframes.py => keyframes.py} (95%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/armature/{armature_sampler.py => sampler.py} (95%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/data/{gltf2_blender_gather_data_channel_target.py => channel_target.py} (97%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/data/{gltf2_blender_gather_data_channels.py => channels.py} (94%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/data/{gltf2_blender_gather_data_keyframes.py => keyframes.py} (96%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/data/{gltf2_blender_gather_data_sampler.py => sampler.py} (94%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/object/{gltf2_blender_gather_object_action_sampled.py => action_sampled.py} (90%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/object/{gltf2_blender_gather_object_channel_target.py => channel_target.py} (93%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/object/{gltf2_blender_gather_object_channels.py => channels.py} (89%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/object/{gltf2_blender_gather_object_keyframes.py => keyframes.py} (93%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/object/{gltf2_blender_gather_object_sampler.py => sampler.py} (92%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/{gltf2_blender_gather_animation_sampling_cache.py => sampling_cache.py} (98%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/{gltf2_blender_gather_sk_action_sampled.py => action_sampled.py} (91%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/{gltf2_blender_gather_sk_channel_target.py => channel_target.py} (92%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/{gltf2_blender_gather_sk_channels.py => channels.py} (89%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/{gltf2_blender_gather_sk_keyframes.py => keyframes.py} (90%) rename addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/{gltf2_blender_gather_sk_sampler.py => sampler.py} (92%) rename addons/io_scene_gltf2/blender/exp/animation/{gltf2_blender_gather_scene_animation.py => scene_animation.py} (94%) rename addons/io_scene_gltf2/blender/exp/animation/{gltf2_blender_gather_tracks.py => tracks.py} (98%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_cache.py => cache.py} (100%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_cameras.py => cameras.py} (95%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_export.py => export.py} (97%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gltf2_exporter.py => exporter.py} (98%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather.py => gather.py} (92%) delete mode 100644 addons/io_scene_gltf2/blender/exp/gltf2_blender_get.py rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_joints.py => joints.py} (95%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_light_spots.py => light_spots.py} (96%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_lights.py => lights.py} (88%) rename addons/io_scene_gltf2/blender/exp/material/{extensions/gltf2_blender_image.py => encode_image.py} (100%) rename addons/io_scene_gltf2/blender/exp/material/extensions/{gltf2_blender_gather_materials_anisotropy.py => anisotropy.py} (96%) rename addons/io_scene_gltf2/blender/exp/material/extensions/{gltf2_blender_gather_materials_clearcoat.py => clearcoat.py} (97%) rename addons/io_scene_gltf2/blender/exp/material/extensions/{gltf2_blender_gather_materials_emission.py => emission.py} (98%) rename addons/io_scene_gltf2/blender/exp/material/extensions/{gltf2_blender_gather_materials_ior.py => ior.py} (94%) rename addons/io_scene_gltf2/blender/exp/material/extensions/{gltf2_blender_gather_materials_sheen.py => sheen.py} (98%) rename addons/io_scene_gltf2/blender/exp/material/extensions/{gltf2_blender_gather_materials_specular.py => specular.py} (98%) rename addons/io_scene_gltf2/blender/exp/material/extensions/{gltf2_blender_gather_materials_transmission.py => transmission.py} (97%) rename addons/io_scene_gltf2/blender/exp/material/extensions/{gltf2_blender_gather_materials_variants.py => variants.py} (91%) rename addons/io_scene_gltf2/blender/exp/material/extensions/{gltf2_blender_gather_materials_volume.py => volume.py} (98%) rename addons/io_scene_gltf2/blender/exp/material/{gltf2_blender_gather_image.py => image.py} (96%) rename addons/io_scene_gltf2/blender/exp/material/{gltf2_blender_gather_materials.py => materials.py} (95%) rename addons/io_scene_gltf2/blender/exp/material/{gltf2_blender_gather_materials_pbr_metallic_roughness.py => pbr_metallic_roughness.py} (97%) rename addons/io_scene_gltf2/blender/exp/material/{gltf2_blender_search_node_tree.py => search_node_tree.py} (99%) rename addons/io_scene_gltf2/blender/exp/material/{gltf2_blender_gather_texture.py => texture.py} (93%) rename addons/io_scene_gltf2/blender/exp/material/{gltf2_blender_gather_texture_info.py => texture_info.py} (97%) rename addons/io_scene_gltf2/blender/exp/material/{gltf2_blender_gather_materials_unlit.py => unlit.py} (98%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_mesh.py => mesh.py} (95%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_nodes.py => nodes.py} (97%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_primitive_attributes.py => primitive_attributes.py} (97%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_primitives_extract.py => primitive_extract.py} (99%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_primitives.py => primitives.py} (94%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_sampler.py => sampler.py} (95%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_skins.py => skins.py} (94%) rename addons/io_scene_gltf2/blender/exp/{gltf2_blender_gather_tree.py => tree.py} (99%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_KHR_materials_anisotropy.py => KHR_materials_anisotropy.py} (97%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_KHR_materials_pbrSpecularGlossiness.py => KHR_materials_pbrSpecularGlossiness.py} (96%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_KHR_materials_unlit.py => KHR_materials_unlit.py} (97%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_animation.py => animation.py} (95%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_animation_node.py => animation_node.py} (97%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_animation_pointer.py => animation_pointer.py} (98%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_animation_utils.py => animation_utils.py} (100%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_animation_weight.py => animation_weight.py} (96%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_gltf.py => blender_gltf.py} (99%) mode change 100755 => 100644 rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_camera.py => camera.py} (96%) rename addons/io_scene_gltf2/blender/imp/{gltf2_io_draco_compression_extension.py => draco_compression_extension.py} (98%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_image.py => image.py} (96%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_light.py => light.py} (97%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_material.py => material.py} (92%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_material_utils.py => material_utils.py} (99%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_mesh.py => mesh.py} (98%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_node.py => node.py} (97%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_pbrMetallicRoughness.py => pbrMetallicRoughness.py} (99%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_scene.py => scene.py} (94%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_texture.py => texture.py} (97%) rename addons/io_scene_gltf2/blender/imp/{gltf2_blender_vnode.py => vnode.py} (100%) rename addons/io_scene_gltf2/io/com/{gltf2_io_constants.py => constants.py} (100%) rename addons/io_scene_gltf2/io/com/{gltf2_io_debug.py => debug.py} (100%) rename addons/io_scene_gltf2/io/com/{gltf2_io_draco_compression_extension.py => draco.py} (100%) rename addons/io_scene_gltf2/io/com/{gltf2_io_lights_punctual.py => lights_punctual.py} (100%) rename addons/io_scene_gltf2/io/com/{gltf2_io_path.py => path.py} (100%) rename addons/io_scene_gltf2/io/com/{gltf2_io_variants.py => variants.py} (100%) rename addons/io_scene_gltf2/io/exp/{gltf2_io_binary_data.py => binary_data.py} (96%) rename addons/io_scene_gltf2/io/exp/{gltf2_io_buffer.py => buffer.py} (97%) rename addons/io_scene_gltf2/io/exp/{gltf2_io_draco_compression_extension.py => draco.py} (98%) rename addons/io_scene_gltf2/io/exp/{gltf2_io_export.py => export.py} (98%) rename addons/io_scene_gltf2/io/exp/{gltf2_io_image_data.py => image_data.py} (100%) rename addons/io_scene_gltf2/io/exp/{gltf2_io_user_extensions.py => user_extensions.py} (100%) rename addons/io_scene_gltf2/io/imp/{gltf2_io_user_extensions.py => user_extensions.py} (100%) diff --git a/Technical.md b/Technical.md index 9bcc8a74f..cf045bd13 100644 --- a/Technical.md +++ b/Technical.md @@ -4,8 +4,8 @@ Here are the main step of the importer: -- Reading and parsing file (See *__init__.py* and *gltf2_blender_gltf.py* files) -- Creating virtual tree and compute nodes (see *gltf2_blender_vnode.py* file) +- Reading and parsing file (See *__init__.py* and *blender_gltf.py* files) +- Creating virtual tree and compute nodes (see *vnode.py* file) - Then Blender objects are created, based on virtual tree nodes (see all *create* static methods of *blender/imp/gltf2_blender_* files) - For animations, all gltf animations are created, but only the first one is then set as Blender active action. @@ -14,7 +14,7 @@ Here are the main step of the importer: If you want to add a new material extension, here are some steps you need to follow: - Add the extension in list of managed extensions, in *extensions_managed* list of *glTFImporter* class -- If your extension need a node that is not Principled Shader node, add it, and correspondance links, in *make_output_nodes* function, in *gltf2_blender_pbrMetallicRoughness.py* file +- If your extension need a node that is not Principled Shader node, add it, and correspondance links, in *make_output_nodes* function, in *pbrMetallicRoughness.py* file - Add your newly created nodes for textures in *calc_locations* function, in order to have the nodes correcly displayed without overlapping - Add you new function at end of *pbr_metallic_roughness* function. Create this function in a new file, on *blender/imp/* directory @@ -23,13 +23,13 @@ If you want to add a new material extension, here are some steps you need to fol Here are the main step of the exporter: -- A virtual node tree is created, then filtered (See *blender/exp/gltf2_blender_gather_tree.py* file) +- A virtual node tree is created, then filtered (See *blender/exp/tree.py* file) - Based on this tree, nodes are exported, with some cache, avoiding calculating multiple time the same things - At end of process, json tabs are created, replacing references to nodes by index in tabs (See multiple *traverse* functions) ### Adding a new material extension -- In *gltf2_blender_gather_materials.py/__gather_extensions*, add a function to manage your extension +- In *materials.py/__gather_extensions*, add a function to manage your extension - Create an *Extension* class to store your extension data. - Third parameter is used to set the extension required - If you need an extension at root of json, use ChildOfRootExtension instead @@ -42,4 +42,4 @@ Here are the main step of the exporter: - In this function, store needed data for calculation, by using *store_data* method - Create a new file in *blender/exp/*, storing your numpy calculation function. This function will use data stored in ExportImage class - Example: *Specular* -- If your extension manages some texture, make sure to manage active UVMaps checks in *gltf2_blender_gather_materials.py/gather_material* function \ No newline at end of file +- If your extension manages some texture, make sure to manage active UVMaps checks in *materials.py/gather_material* function diff --git a/addons/io_scene_gltf2/__init__.py b/addons/io_scene_gltf2/__init__.py index ae085cfab..3bfe0b372 100644 --- a/addons/io_scene_gltf2/__init__.py +++ b/addons/io_scene_gltf2/__init__.py @@ -165,7 +165,7 @@ def get_format_items(scene, context): def is_draco_available(): # Initialize on first use if not hasattr(is_draco_available, "draco_exists"): - from .io.com import gltf2_io_draco_compression_extension + from .io.com import draco as gltf2_io_draco_compression_extension is_draco_available.draco_exists = gltf2_io_draco_compression_extension.dll_exists() return is_draco_available.draco_exists @@ -1040,9 +1040,9 @@ def execute(self, context): import os import datetime import logging - from .io.com.gltf2_io_debug import Log - from .blender.exp import gltf2_blender_export - from .io.com.gltf2_io_path import path_to_uri + from .io.com.debug import Log + from .blender.exp import export as gltf2_blender_export + from .io.com.path import path_to_uri if self.will_save_settings: self.save_settings(context) @@ -1881,7 +1881,7 @@ def import_gltf2(self, context): def unit_import(self, filename, import_settings): import time from .io.imp.gltf2_io_gltf import glTFImporter, ImportError - from .blender.imp.gltf2_blender_gltf import BlenderGlTF + from .blender.imp.blender_gltf import BlenderGlTF try: gltf_importer = glTFImporter(filename, import_settings) diff --git a/addons/io_scene_gltf2/blender/com/gltf2_blender_default.py b/addons/io_scene_gltf2/blender/com/blender_default.py similarity index 100% rename from addons/io_scene_gltf2/blender/com/gltf2_blender_default.py rename to addons/io_scene_gltf2/blender/com/blender_default.py diff --git a/addons/io_scene_gltf2/blender/com/gltf2_blender_conversion.py b/addons/io_scene_gltf2/blender/com/conversion.py similarity index 99% rename from addons/io_scene_gltf2/blender/com/gltf2_blender_conversion.py rename to addons/io_scene_gltf2/blender/com/conversion.py index bb49cc7f9..925ca3a02 100644 --- a/addons/io_scene_gltf2/blender/com/gltf2_blender_conversion.py +++ b/addons/io_scene_gltf2/blender/com/conversion.py @@ -15,7 +15,7 @@ from math import sin, cos, tan, atan from mathutils import Matrix, Vector import numpy as np -from ...io.com import gltf2_io_constants +from ...io.com import constants as gltf2_io_constants PBR_WATTS_TO_LUMENS = 683 # Industry convention, biological peak at 555nm, scientific standard as part of SI candela definition. diff --git a/addons/io_scene_gltf2/blender/com/gltf2_blender_data_path.py b/addons/io_scene_gltf2/blender/com/data_path.py similarity index 80% rename from addons/io_scene_gltf2/blender/com/gltf2_blender_data_path.py rename to addons/io_scene_gltf2/blender/com/data_path.py index 2173f3743..6e62fcc27 100644 --- a/addons/io_scene_gltf2/blender/com/gltf2_blender_data_path.py +++ b/addons/io_scene_gltf2/blender/com/data_path.py @@ -79,3 +79,21 @@ def skip_sk(key_blocks, k): def is_first_index(key_blocks, k): return key_blocks[0].name == k.name + +def get_object_from_datapath(blender_object, data_path: str): + if "." in data_path: + # gives us: ('modifiers["Subsurf"]', 'levels') + path_prop, path_attr = data_path.rsplit(".", 1) + + # same as: prop = obj.modifiers["Subsurf"] + if path_attr in ["rotation", "scale", "location", + "rotation_axis_angle", "rotation_euler", "rotation_quaternion"]: + prop = blender_object.path_resolve(path_prop) + else: + prop = blender_object.path_resolve(data_path) + else: + prop = blender_object + # single attribute such as name, location... etc + # path_attr = data_path + + return prop diff --git a/addons/io_scene_gltf2/blender/com/gltf2_blender_extras.py b/addons/io_scene_gltf2/blender/com/extras.py old mode 100755 new mode 100644 similarity index 98% rename from addons/io_scene_gltf2/blender/com/gltf2_blender_extras.py rename to addons/io_scene_gltf2/blender/com/extras.py index 6c93e7b4d..8a952f9be --- a/addons/io_scene_gltf2/blender/com/gltf2_blender_extras.py +++ b/addons/io_scene_gltf2/blender/com/extras.py @@ -14,7 +14,7 @@ import bpy -from .gltf2_blender_json import is_json_convertible +from .json_util import is_json_convertible # Custom properties, which are in most cases present and should not be imported/exported. diff --git a/addons/io_scene_gltf2/blender/com/gltf2_blender_math.py b/addons/io_scene_gltf2/blender/com/gltf2_blender_math.py index b890ae59f..9db2a5ac0 100644 --- a/addons/io_scene_gltf2/blender/com/gltf2_blender_math.py +++ b/addons/io_scene_gltf2/blender/com/gltf2_blender_math.py @@ -16,7 +16,7 @@ import math from mathutils import Matrix, Vector, Quaternion, Euler -from .gltf2_blender_data_path import get_target_property_name +from .data_path import get_target_property_name def list_to_mathutils(values: typing.List[float], data_path: str) -> typing.Union[Vector, Quaternion, Euler]: diff --git a/addons/io_scene_gltf2/blender/com/gltf2_blender_ui.py b/addons/io_scene_gltf2/blender/com/gltf2_blender_ui.py index 5bee6d200..59c1f5083 100644 --- a/addons/io_scene_gltf2/blender/com/gltf2_blender_ui.py +++ b/addons/io_scene_gltf2/blender/com/gltf2_blender_ui.py @@ -13,7 +13,7 @@ # limitations under the License. import bpy -from ..com.gltf2_blender_material_helpers import get_gltf_node_name, create_settings_group +from ..com.material_helpers import get_gltf_node_name, create_settings_group ################ glTF Material Output node ########################################### diff --git a/addons/io_scene_gltf2/blender/com/gltf2_blender_json.py b/addons/io_scene_gltf2/blender/com/json_util.py similarity index 100% rename from addons/io_scene_gltf2/blender/com/gltf2_blender_json.py rename to addons/io_scene_gltf2/blender/com/json_util.py diff --git a/addons/io_scene_gltf2/blender/com/gltf2_blender_material_helpers.py b/addons/io_scene_gltf2/blender/com/material_helpers.py similarity index 100% rename from addons/io_scene_gltf2/blender/com/gltf2_blender_material_helpers.py rename to addons/io_scene_gltf2/blender/com/material_helpers.py diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_accessors.py b/addons/io_scene_gltf2/blender/exp/accessors.py similarity index 97% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_accessors.py rename to addons/io_scene_gltf2/blender/exp/accessors.py index 21a022814..edde147b1 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_accessors.py +++ b/addons/io_scene_gltf2/blender/exp/accessors.py @@ -15,9 +15,9 @@ import numpy as np from ...io.com import gltf2_io -from ...io.com import gltf2_io_constants -from ...io.exp import gltf2_io_binary_data -from .gltf2_blender_gather_cache import cached +from ...io.com import constants as gltf2_io_constants +from ...io.exp import binary_data as gltf2_io_binary_data +from .cache import cached @cached def gather_accessor(buffer_view: gltf2_io_binary_data.BinaryData, diff --git a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_action.py b/addons/io_scene_gltf2/blender/exp/animation/action.py similarity index 96% rename from addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_action.py rename to addons/io_scene_gltf2/blender/exp/animation/action.py index d43e1526f..09531be7d 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_action.py +++ b/addons/io_scene_gltf2/blender/exp/animation/action.py @@ -15,21 +15,21 @@ import bpy import typing from ....io.com import gltf2_io -from ....io.exp.gltf2_io_user_extensions import export_user_extensions -from ....blender.com.gltf2_blender_conversion import get_gltf_interpolation -from ...com.gltf2_blender_data_path import is_bone_anim_channel -from ...com.gltf2_blender_extras import generate_extras -from ..gltf2_blender_gather_cache import cached -from ..gltf2_blender_gather_tree import VExportNode -from .fcurves.gltf2_blender_gather_fcurves_animation import gather_animation_fcurves -from .sampled.armature.armature_action_sampled import gather_action_armature_sampled -from .sampled.armature.armature_channels import gather_sampled_bone_channel -from .sampled.object.gltf2_blender_gather_object_action_sampled import gather_action_object_sampled -from .sampled.shapekeys.gltf2_blender_gather_sk_action_sampled import gather_action_sk_sampled -from .sampled.object.gltf2_blender_gather_object_channels import gather_object_sampled_channels, gather_sampled_object_channel -from .sampled.shapekeys.gltf2_blender_gather_sk_channels import gather_sampled_sk_channel -from .gltf2_blender_gather_drivers import get_sk_drivers, get_driver_on_shapekey -from .gltf2_blender_gather_animation_utils import reset_bone_matrix, reset_sk_data, link_samplers, add_slide_data, merge_tracks_perform, bake_animation +from ....io.exp.user_extensions import export_user_extensions +from ....blender.com.conversion import get_gltf_interpolation +from ...com.data_path import is_bone_anim_channel +from ...com.extras import generate_extras +from ..cache import cached +from ..tree import VExportNode +from .fcurves.animation import gather_animation_fcurves +from .sampled.armature.action_sampled import gather_action_armature_sampled +from .sampled.armature.channels import gather_sampled_bone_channel +from .sampled.object.action_sampled import gather_action_object_sampled +from .sampled.shapekeys.action_sampled import gather_action_sk_sampled +from .sampled.object.channels import gather_object_sampled_channels, gather_sampled_object_channel +from .sampled.shapekeys.channels import gather_sampled_sk_channel +from .drivers import get_sk_drivers, get_driver_on_shapekey +from .anim_utils import reset_bone_matrix, reset_sk_data, link_samplers, add_slide_data, merge_tracks_perform, bake_animation def gather_actions_animations(export_settings): diff --git a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_animation_utils.py b/addons/io_scene_gltf2/blender/exp/animation/anim_utils.py similarity index 95% rename from addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_animation_utils.py rename to addons/io_scene_gltf2/blender/exp/animation/anim_utils.py index 1fd5138b8..75da29331 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_animation_utils.py +++ b/addons/io_scene_gltf2/blender/exp/animation/anim_utils.py @@ -15,15 +15,15 @@ import bpy import typing from mathutils import Matrix -from ....blender.com.gltf2_blender_data_path import get_sk_exported +from ....blender.com.data_path import get_sk_exported from ....io.com import gltf2_io -from ....io.exp.gltf2_io_user_extensions import export_user_extensions -from ..gltf2_blender_gather_tree import VExportNode -from .sampled.armature.armature_action_sampled import gather_action_armature_sampled -from .sampled.object.gltf2_blender_gather_object_action_sampled import gather_action_object_sampled -from .sampled.shapekeys.gltf2_blender_gather_sk_channels import gather_sampled_sk_channel -from .sampled.data.gltf2_blender_gather_data_channels import gather_data_sampled_channels -from .gltf2_blender_gather_drivers import get_sk_drivers +from ....io.exp.user_extensions import export_user_extensions +from ..tree import VExportNode +from .sampled.armature.action_sampled import gather_action_armature_sampled +from .sampled.object.action_sampled import gather_action_object_sampled +from .sampled.shapekeys.channels import gather_sampled_sk_channel +from .sampled.data.channels import gather_data_sampled_channels +from .drivers import get_sk_drivers def link_samplers(animation: gltf2_io.Animation, export_settings): """ diff --git a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_animations.py b/addons/io_scene_gltf2/blender/exp/animation/animations.py similarity index 84% rename from addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_animations.py rename to addons/io_scene_gltf2/blender/exp/animation/animations.py index 87e36d871..e422d7379 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_animations.py +++ b/addons/io_scene_gltf2/blender/exp/animation/animations.py @@ -13,9 +13,9 @@ # limitations under the License. -from .gltf2_blender_gather_action import gather_actions_animations -from .gltf2_blender_gather_scene_animation import gather_scene_animations -from .gltf2_blender_gather_tracks import gather_tracks_animations +from .action import gather_actions_animations +from .scene_animation import gather_scene_animations +from .tracks import gather_tracks_animations def gather_animations(export_settings): diff --git a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_drivers.py b/addons/io_scene_gltf2/blender/exp/animation/drivers.py similarity index 94% rename from addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_drivers.py rename to addons/io_scene_gltf2/blender/exp/animation/drivers.py index 007d2d90a..673242674 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_drivers.py +++ b/addons/io_scene_gltf2/blender/exp/animation/drivers.py @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ....blender.com.gltf2_blender_data_path import get_sk_exported, skip_sk -from ...com.gltf2_blender_data_path import get_target_object_path -from ..gltf2_blender_gather_cache import skdriverdiscovercache +from ....blender.com.data_path import get_sk_exported, skip_sk, get_target_object_path +from ..cache import skdriverdiscovercache @skdriverdiscovercache def get_sk_drivers(blender_armature_uuid, export_settings): diff --git a/addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_animation.py b/addons/io_scene_gltf2/blender/exp/animation/fcurves/animation.py similarity index 90% rename from addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_animation.py rename to addons/io_scene_gltf2/blender/exp/animation/fcurves/animation.py index 6e7dc223e..89a0d6fad 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_animation.py +++ b/addons/io_scene_gltf2/blender/exp/animation/fcurves/animation.py @@ -14,9 +14,9 @@ import bpy from .....io.com import gltf2_io -from .....io.exp.gltf2_io_user_extensions import export_user_extensions -from ....com.gltf2_blender_extras import generate_extras -from .gltf2_blender_gather_fcurves_channels import gather_animation_fcurves_channels +from .....io.exp.user_extensions import export_user_extensions +from ....com.extras import generate_extras +from .channels import gather_animation_fcurves_channels def gather_animation_fcurves( obj_uuid: str, diff --git a/addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_channel_target.py b/addons/io_scene_gltf2/blender/exp/animation/fcurves/channel_target.py similarity index 89% rename from addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_channel_target.py rename to addons/io_scene_gltf2/blender/exp/animation/fcurves/channel_target.py index 45cc5a317..5e0a5b9bf 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_channel_target.py +++ b/addons/io_scene_gltf2/blender/exp/animation/fcurves/channel_target.py @@ -15,10 +15,10 @@ import bpy import typing from .....io.com import gltf2_io -from .....io.exp.gltf2_io_user_extensions import export_user_extensions -from ....com.gltf2_blender_conversion import get_target -from ...gltf2_blender_gather_cache import cached -from ...gltf2_blender_gather_joints import gather_joint_vnode +from .....io.exp.user_extensions import export_user_extensions +from ....com.conversion import get_target +from ...cache import cached +from ...joints import gather_joint_vnode @cached def gather_fcurve_channel_target( diff --git a/addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_channels.py b/addons/io_scene_gltf2/blender/exp/animation/fcurves/channels.py similarity index 96% rename from addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_channels.py rename to addons/io_scene_gltf2/blender/exp/animation/fcurves/channels.py index 130e10cab..9172d56a9 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_channels.py +++ b/addons/io_scene_gltf2/blender/exp/animation/fcurves/channels.py @@ -14,15 +14,13 @@ import bpy import typing -from .....io.exp.gltf2_io_user_extensions import export_user_extensions -from .....blender.com.gltf2_blender_data_path import skip_sk +from .....io.exp.user_extensions import export_user_extensions from .....io.com import gltf2_io -from ....exp.gltf2_blender_gather_cache import cached -from ....com.gltf2_blender_data_path import get_target_object_path, get_target_property_name, get_rotation_modes -from ....com.gltf2_blender_conversion import get_target, get_channel_from_target -from ...gltf2_blender_get import get_object_from_datapath -from .gltf2_blender_gather_fcurves_channel_target import gather_fcurve_channel_target -from .gltf2_blender_gather_fcurves_sampler import gather_animation_fcurves_sampler +from ....exp.cache import cached +from ....com.data_path import get_target_object_path, get_target_property_name, get_rotation_modes, get_object_from_datapath, skip_sk +from ....com.conversion import get_target, get_channel_from_target +from .channel_target import gather_fcurve_channel_target +from .sampler import gather_animation_fcurves_sampler @cached diff --git a/addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_keyframes.py b/addons/io_scene_gltf2/blender/exp/animation/fcurves/keyframes.py similarity index 97% rename from addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_keyframes.py rename to addons/io_scene_gltf2/blender/exp/animation/fcurves/keyframes.py index c763c5538..47e55b2fa 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_keyframes.py +++ b/addons/io_scene_gltf2/blender/exp/animation/fcurves/keyframes.py @@ -14,10 +14,9 @@ import bpy import typing -from .....blender.com.gltf2_blender_data_path import get_sk_exported -from ....com.gltf2_blender_data_path import get_target_object_path -from ...gltf2_blender_gather_cache import cached -from ..gltf2_blender_gather_keyframes import Keyframe +from ....com.data_path import get_target_object_path, get_sk_exported +from ...cache import cached +from ..keyframes import Keyframe @cached diff --git a/addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_sampler.py b/addons/io_scene_gltf2/blender/exp/animation/fcurves/sampler.py similarity index 94% rename from addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_sampler.py rename to addons/io_scene_gltf2/blender/exp/animation/fcurves/sampler.py index 9d412c5ec..72587e76c 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/fcurves/gltf2_blender_gather_fcurves_sampler.py +++ b/addons/io_scene_gltf2/blender/exp/animation/fcurves/sampler.py @@ -16,16 +16,16 @@ import typing import mathutils from .....io.com import gltf2_io -from .....io.com import gltf2_io_constants -from .....blender.com.gltf2_blender_conversion import get_gltf_interpolation -from .....io.exp import gltf2_io_binary_data -from .....io.exp.gltf2_io_user_extensions import export_user_extensions -from ....com.gltf2_blender_data_path import get_target_property_name +from .....io.com import constants as gltf2_io_constants +from .....blender.com.conversion import get_gltf_interpolation +from .....io.exp import binary_data as gltf2_io_binary_data +from .....io.exp.user_extensions import export_user_extensions +from ....com.data_path import get_target_property_name from ....com import gltf2_blender_math -from ...gltf2_blender_gather_cache import cached -from ...gltf2_blender_gather_accessors import gather_accessor -from ...gltf2_blender_gather_tree import VExportNode -from .gltf2_blender_gather_fcurves_keyframes import gather_fcurve_keyframes +from ...cache import cached +from ...accessors import gather_accessor +from ...tree import VExportNode +from .keyframes import gather_fcurve_keyframes @cached def gather_animation_fcurves_sampler( diff --git a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_keyframes.py b/addons/io_scene_gltf2/blender/exp/animation/keyframes.py similarity index 100% rename from addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_keyframes.py rename to addons/io_scene_gltf2/blender/exp/animation/keyframes.py diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_action_sampled.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/action_sampled.py similarity index 92% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_action_sampled.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/armature/action_sampled.py index 01df890c9..9941b85aa 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_action_sampled.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/action_sampled.py @@ -14,11 +14,11 @@ import bpy import typing -from ......io.exp.gltf2_io_user_extensions import export_user_extensions +from ......io.exp.user_extensions import export_user_extensions from ......io.com import gltf2_io -from .....com.gltf2_blender_extras import generate_extras -from ...fcurves.gltf2_blender_gather_fcurves_sampler import gather_animation_fcurves_sampler -from .armature_channels import gather_armature_sampled_channels +from .....com.extras import generate_extras +from ...fcurves.sampler import gather_animation_fcurves_sampler +from .channels import gather_armature_sampled_channels diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_channel_target.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/channel_target.py similarity index 91% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_channel_target.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/armature/channel_target.py index 4f766f75a..38dd42952 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_channel_target.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/channel_target.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ......io.exp.gltf2_io_user_extensions import export_user_extensions +from ......io.exp.user_extensions import export_user_extensions from ......io.com import gltf2_io -from ....gltf2_blender_gather_cache import cached -from ....gltf2_blender_gather_joints import gather_joint_vnode +from ....cache import cached +from ....joints import gather_joint_vnode @cached def gather_armature_sampled_channel_target( diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_channels.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/channels.py similarity index 91% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_channels.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/armature/channels.py index a21512a50..cf02c8ca8 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_channels.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/channels.py @@ -15,16 +15,16 @@ import bpy import typing from ......io.com import gltf2_io -from ......io.exp.gltf2_io_user_extensions import export_user_extensions -from .....com.gltf2_blender_conversion import get_gltf_interpolation -from .....com.gltf2_blender_conversion import get_target, get_channel_from_target -from ...fcurves.gltf2_blender_gather_fcurves_channels import get_channel_groups -from ...fcurves.gltf2_blender_gather_fcurves_channels import needs_baking -from ...gltf2_blender_gather_drivers import get_sk_drivers -from ..object.gltf2_blender_gather_object_channels import gather_sampled_object_channel -from ..shapekeys.gltf2_blender_gather_sk_channels import gather_sampled_sk_channel -from .armature_channel_target import gather_armature_sampled_channel_target -from .armature_sampler import gather_bone_sampled_animation_sampler +from ......io.exp.user_extensions import export_user_extensions +from .....com.conversion import get_gltf_interpolation +from .....com.conversion import get_target, get_channel_from_target +from ...fcurves.channels import get_channel_groups +from ...fcurves.channels import needs_baking +from ...drivers import get_sk_drivers +from ..object.channels import gather_sampled_object_channel +from ..shapekeys.channels import gather_sampled_sk_channel +from .channel_target import gather_armature_sampled_channel_target +from .sampler import gather_bone_sampled_animation_sampler def gather_armature_sampled_channels(armature_uuid, blender_action_name, export_settings) -> typing.List[gltf2_io.AnimationChannel]: channels = [] diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_keyframes.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/keyframes.py similarity index 95% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_keyframes.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/armature/keyframes.py index e54f8fe3a..6403f9914 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_keyframes.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/keyframes.py @@ -14,9 +14,9 @@ import typing import numpy as np -from ....gltf2_blender_gather_cache import cached -from ...gltf2_blender_gather_keyframes import Keyframe -from ..gltf2_blender_gather_animation_sampling_cache import get_cache_data +from ....cache import cached +from ...keyframes import Keyframe +from ..sampling_cache import get_cache_data @cached def gather_bone_sampled_keyframes( diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_sampler.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/sampler.py similarity index 95% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_sampler.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/armature/sampler.py index 9ff7cb805..5cb6f5c79 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/armature_sampler.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/armature/sampler.py @@ -16,14 +16,14 @@ import typing import mathutils from ......io.com import gltf2_io -from ......io.exp.gltf2_io_user_extensions import export_user_extensions -from ......io.com import gltf2_io_constants -from ......io.exp import gltf2_io_binary_data +from ......io.exp.user_extensions import export_user_extensions +from ......io.com import constants as gltf2_io_constants +from ......io.exp import binary_data as gltf2_io_binary_data from .....com import gltf2_blender_math -from ....gltf2_blender_gather_accessors import gather_accessor -from ....gltf2_blender_gather_cache import cached -from ....gltf2_blender_gather_tree import VExportNode -from .armature_keyframes import gather_bone_sampled_keyframes +from ....accessors import gather_accessor +from ....cache import cached +from ....tree import VExportNode +from .keyframes import gather_bone_sampled_keyframes @cached def gather_bone_sampled_animation_sampler( diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/data/gltf2_blender_gather_data_channel_target.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/data/channel_target.py similarity index 97% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/data/gltf2_blender_gather_data_channel_target.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/data/channel_target.py index 1b075d5f8..c3aaa38da 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/data/gltf2_blender_gather_data_channel_target.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/data/channel_target.py @@ -13,7 +13,7 @@ # limitations under the License. from ......io.com import gltf2_io -from ....gltf2_blender_gather_cache import cached +from ....cache import cached @cached diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/data/gltf2_blender_gather_data_channels.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/data/channels.py similarity index 94% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/data/gltf2_blender_gather_data_channels.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/data/channels.py index afcff66b9..a53dfb331 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/data/gltf2_blender_gather_data_channels.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/data/channels.py @@ -15,9 +15,9 @@ import bpy import typing from ......io.com import gltf2_io -from ......blender.com.gltf2_blender_conversion import get_gltf_interpolation -from .gltf2_blender_gather_data_channel_target import gather_data_sampled_channel_target -from .gltf2_blender_gather_data_sampler import gather_data_sampled_animation_sampler +from ......blender.com.conversion import get_gltf_interpolation +from .channel_target import gather_data_sampled_channel_target +from .sampler import gather_data_sampled_animation_sampler def gather_data_sampled_channels(blender_type_data, blender_id, blender_action_name, additional_key, export_settings) -> typing.List[gltf2_io.AnimationChannel]: channels = [] diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/data/gltf2_blender_gather_data_keyframes.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/data/keyframes.py similarity index 96% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/data/gltf2_blender_gather_data_keyframes.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/data/keyframes.py index 1e934b3db..dd9927b70 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/data/gltf2_blender_gather_data_keyframes.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/data/keyframes.py @@ -16,10 +16,10 @@ import math import numpy as np import bpy -from .....com.gltf2_blender_conversion import PBR_WATTS_TO_LUMENS -from ....gltf2_blender_gather_cache import cached -from ...gltf2_blender_gather_keyframes import Keyframe -from ..gltf2_blender_gather_animation_sampling_cache import get_cache_data +from .....com.conversion import PBR_WATTS_TO_LUMENS +from ....cache import cached +from ...keyframes import Keyframe +from ..sampling_cache import get_cache_data @cached diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/data/gltf2_blender_gather_data_sampler.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/data/sampler.py similarity index 94% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/data/gltf2_blender_gather_data_sampler.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/data/sampler.py index ae90a13cf..b950c9ae1 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/data/gltf2_blender_gather_data_sampler.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/data/sampler.py @@ -15,11 +15,11 @@ import bpy import typing from ......io.com import gltf2_io -from ......io.exp import gltf2_io_binary_data -from ......io.com import gltf2_io_constants -from ....gltf2_blender_gather_cache import cached -from ....gltf2_blender_gather_accessors import gather_accessor -from .gltf2_blender_gather_data_keyframes import gather_data_sampled_keyframes +from ......io.exp import binary_data as gltf2_io_binary_data +from ......io.com import constants as gltf2_io_constants +from ....cache import cached +from ....accessors import gather_accessor +from .keyframes import gather_data_sampled_keyframes @cached def gather_data_sampled_animation_sampler( diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_action_sampled.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/object/action_sampled.py similarity index 90% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_action_sampled.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/object/action_sampled.py index a0127e074..9f6500774 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_action_sampled.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/object/action_sampled.py @@ -15,10 +15,10 @@ import bpy import typing from ......io.com import gltf2_io -from ......io.exp.gltf2_io_user_extensions import export_user_extensions -from .....com.gltf2_blender_extras import generate_extras -from ...fcurves.gltf2_blender_gather_fcurves_sampler import gather_animation_fcurves_sampler -from .gltf2_blender_gather_object_channels import gather_object_sampled_channels +from ......io.exp.user_extensions import export_user_extensions +from .....com.extras import generate_extras +from ...fcurves.sampler import gather_animation_fcurves_sampler +from .channels import gather_object_sampled_channels def gather_action_object_sampled(object_uuid: str, blender_action: typing.Optional[bpy.types.Action], cache_key: str, export_settings): diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_channel_target.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/object/channel_target.py similarity index 93% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_channel_target.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/object/channel_target.py index 87f29bdb5..05dee0ff3 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_channel_target.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/object/channel_target.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ......io.exp.gltf2_io_user_extensions import export_user_extensions +from ......io.exp.user_extensions import export_user_extensions from ......io.com import gltf2_io -from ....gltf2_blender_gather_cache import cached +from ....cache import cached @cached diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_channels.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/object/channels.py similarity index 89% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_channels.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/object/channels.py index db3a39a12..cfaa4c673 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_channels.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/object/channels.py @@ -15,13 +15,12 @@ import bpy import typing from ......io.com import gltf2_io -from ......io.exp.gltf2_io_user_extensions import export_user_extensions -from ......blender.com.gltf2_blender_conversion import get_gltf_interpolation -from .....com.gltf2_blender_conversion import get_target, get_channel_from_target -from ....gltf2_blender_gather_cache import cached -from ...fcurves.gltf2_blender_gather_fcurves_channels import get_channel_groups -from .gltf2_blender_gather_object_sampler import gather_object_sampled_animation_sampler -from .gltf2_blender_gather_object_channel_target import gather_object_sampled_channel_target +from ......io.exp.user_extensions import export_user_extensions +from ......blender.com.conversion import get_gltf_interpolation, get_target, get_channel_from_target +from ....cache import cached +from ...fcurves.channels import get_channel_groups +from .sampler import gather_object_sampled_animation_sampler +from .channel_target import gather_object_sampled_channel_target def gather_object_sampled_channels(object_uuid: str, blender_action_name: str, export_settings) -> typing.List[gltf2_io.AnimationChannel]: channels = [] diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_keyframes.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/object/keyframes.py similarity index 93% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_keyframes.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/object/keyframes.py index 35c70da2b..4cf508f04 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_keyframes.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/object/keyframes.py @@ -13,10 +13,10 @@ # limitations under the License. import numpy as np -from ....gltf2_blender_gather_tree import VExportNode -from ....gltf2_blender_gather_cache import cached -from ...gltf2_blender_gather_keyframes import Keyframe -from ..gltf2_blender_gather_animation_sampling_cache import get_cache_data +from ....tree import VExportNode +from ....cache import cached +from ...keyframes import Keyframe +from ..sampling_cache import get_cache_data @cached diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_sampler.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/object/sampler.py similarity index 92% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_sampler.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/object/sampler.py index 5e22f446c..d439f611e 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/object/gltf2_blender_gather_object_sampler.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/object/sampler.py @@ -15,15 +15,15 @@ import bpy import mathutils from ......io.com import gltf2_io -from ......io.com import gltf2_io_constants -from ......io.exp import gltf2_io_binary_data -from ......io.exp.gltf2_io_user_extensions import export_user_extensions -from .....com.gltf2_blender_data_path import get_target_object_path +from ......io.com import constants as gltf2_io_constants +from ......io.exp import binary_data as gltf2_io_binary_data +from ......io.exp.user_extensions import export_user_extensions +from .....com.data_path import get_target_object_path from .....com import gltf2_blender_math -from ....gltf2_blender_gather_tree import VExportNode -from ....gltf2_blender_gather_cache import cached -from ....gltf2_blender_gather_accessors import gather_accessor -from .gltf2_blender_gather_object_keyframes import gather_object_sampled_keyframes +from ....tree import VExportNode +from ....cache import cached +from ....accessors import gather_accessor +from .keyframes import gather_object_sampled_keyframes @cached def gather_object_sampled_animation_sampler( diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/gltf2_blender_gather_animation_sampling_cache.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/sampling_cache.py similarity index 98% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/gltf2_blender_gather_animation_sampling_cache.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/sampling_cache.py index b1454a2aa..9b0b1aad6 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/gltf2_blender_gather_animation_sampling_cache.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/sampling_cache.py @@ -15,11 +15,11 @@ import mathutils import bpy import typing -from .....blender.com.gltf2_blender_data_path import get_sk_exported -from .....blender.com.gltf2_blender_conversion import inverted_trs_mapping_node, texture_transform_blender_to_gltf, yvof_blender_to_gltf -from ...gltf2_blender_gather_cache import datacache -from ...gltf2_blender_gather_tree import VExportNode -from ..gltf2_blender_gather_drivers import get_sk_drivers +from .....blender.com.data_path import get_sk_exported +from .....blender.com.conversion import inverted_trs_mapping_node, texture_transform_blender_to_gltf, yvof_blender_to_gltf +from ...cache import datacache +from ...tree import VExportNode +from ..drivers import get_sk_drivers # Warning : If you change some parameter here, need to be changed in cache system @datacache diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_action_sampled.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/action_sampled.py similarity index 91% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_action_sampled.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/action_sampled.py index b44d86556..2b990f4b6 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_action_sampled.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/action_sampled.py @@ -14,10 +14,10 @@ import bpy import typing -from ......io.exp.gltf2_io_user_extensions import export_user_extensions +from ......io.exp.user_extensions import export_user_extensions from ......io.com import gltf2_io -from .....com.gltf2_blender_extras import generate_extras -from .gltf2_blender_gather_sk_channels import gather_sk_sampled_channels +from .....com.extras import generate_extras +from .channels import gather_sk_sampled_channels def gather_action_sk_sampled(object_uuid: str, blender_action: typing.Optional[bpy.types.Action], cache_key: str, export_settings): diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_channel_target.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/channel_target.py similarity index 92% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_channel_target.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/channel_target.py index 9d94a8a2d..d23670b56 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_channel_target.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/channel_target.py @@ -13,8 +13,8 @@ # limitations under the License. from ......io.com import gltf2_io -from ......io.exp.gltf2_io_user_extensions import export_user_extensions -from ....gltf2_blender_gather_cache import cached +from ......io.exp.user_extensions import export_user_extensions +from ....cache import cached @cached def gather_sk_sampled_channel_target( diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_channels.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/channels.py similarity index 89% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_channels.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/channels.py index f26911b17..923daded7 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_channels.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/channels.py @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ......io.exp.gltf2_io_user_extensions import export_user_extensions +from ......io.exp.user_extensions import export_user_extensions from ......io.com import gltf2_io -from ....gltf2_blender_gather_cache import cached -from .gltf2_blender_gather_sk_channel_target import gather_sk_sampled_channel_target -from .gltf2_blender_gather_sk_sampler import gather_sk_sampled_animation_sampler +from ....cache import cached +from .channel_target import gather_sk_sampled_channel_target +from .sampler import gather_sk_sampled_animation_sampler def gather_sk_sampled_channels( object_uuid: str, diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_keyframes.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/keyframes.py similarity index 90% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_keyframes.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/keyframes.py index 0e53adedd..ea8be6395 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_keyframes.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/keyframes.py @@ -15,14 +15,14 @@ import bpy import typing import numpy as np -from ......blender.com.gltf2_blender_data_path import get_sk_exported -from ....gltf2_blender_gather_cache import cached -from ....gltf2_blender_gather_tree import VExportNode -from ...gltf2_blender_gather_keyframes import Keyframe -from ...fcurves.gltf2_blender_gather_fcurves_channels import get_channel_groups -from ...fcurves.gltf2_blender_gather_fcurves_keyframes import gather_non_keyed_values -from ...gltf2_blender_gather_drivers import get_driver_on_shapekey -from ..gltf2_blender_gather_animation_sampling_cache import get_cache_data +from ......blender.com.data_path import get_sk_exported +from ....cache import cached +from ....tree import VExportNode +from ...keyframes import Keyframe +from ...fcurves.channels import get_channel_groups +from ...fcurves.keyframes import gather_non_keyed_values +from ...drivers import get_driver_on_shapekey +from ..sampling_cache import get_cache_data @cached diff --git a/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_sampler.py b/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/sampler.py similarity index 92% rename from addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_sampler.py rename to addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/sampler.py index 249e67016..43168869b 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/gltf2_blender_gather_sk_sampler.py +++ b/addons/io_scene_gltf2/blender/exp/animation/sampled/shapekeys/sampler.py @@ -13,12 +13,12 @@ # limitations under the License. import bpy -from ......io.com import gltf2_io, gltf2_io_constants -from ......io.exp import gltf2_io_binary_data -from ......io.exp.gltf2_io_user_extensions import export_user_extensions +from ......io.com import gltf2_io, constants as gltf2_io_constants +from ......io.exp import binary_data as gltf2_io_binary_data +from ......io.exp.user_extensions import export_user_extensions from .....com.gltf2_blender_math import mathutils_to_gltf -from ....gltf2_blender_gather_accessors import gather_accessor -from .gltf2_blender_gather_sk_keyframes import gather_sk_sampled_keyframes +from ....accessors import gather_accessor +from .keyframes import gather_sk_sampled_keyframes def gather_sk_sampled_animation_sampler( obj_uuid, diff --git a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_scene_animation.py b/addons/io_scene_gltf2/blender/exp/animation/scene_animation.py similarity index 94% rename from addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_scene_animation.py rename to addons/io_scene_gltf2/blender/exp/animation/scene_animation.py index bcf4417d8..f47f383d1 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_scene_animation.py +++ b/addons/io_scene_gltf2/blender/exp/animation/scene_animation.py @@ -14,14 +14,14 @@ import bpy from ....io.com import gltf2_io -from ...com.gltf2_blender_extras import generate_extras -from ..gltf2_blender_gather_tree import VExportNode -from .gltf2_blender_gather_drivers import get_sk_drivers -from .sampled.armature.armature_channels import gather_armature_sampled_channels -from .sampled.object.gltf2_blender_gather_object_channels import gather_object_sampled_channels -from .sampled.shapekeys.gltf2_blender_gather_sk_channels import gather_sk_sampled_channels -from .sampled.data.gltf2_blender_gather_data_channels import gather_data_sampled_channels -from .gltf2_blender_gather_animation_utils import link_samplers, add_slide_data +from ...com.extras import generate_extras +from ..tree import VExportNode +from .drivers import get_sk_drivers +from .sampled.armature.channels import gather_armature_sampled_channels +from .sampled.object.channels import gather_object_sampled_channels +from .sampled.shapekeys.channels import gather_sk_sampled_channels +from .sampled.data.channels import gather_data_sampled_channels +from .anim_utils import link_samplers, add_slide_data def gather_scene_animations(export_settings): diff --git a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_tracks.py b/addons/io_scene_gltf2/blender/exp/animation/tracks.py similarity index 98% rename from addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_tracks.py rename to addons/io_scene_gltf2/blender/exp/animation/tracks.py index 01e7f9df8..d13d78aca 100644 --- a/addons/io_scene_gltf2/blender/exp/animation/gltf2_blender_gather_tracks.py +++ b/addons/io_scene_gltf2/blender/exp/animation/tracks.py @@ -15,12 +15,12 @@ import bpy import typing from ....io.com import gltf2_io -from ....io.exp.gltf2_io_user_extensions import export_user_extensions -from ..gltf2_blender_gather_cache import cached -from ..gltf2_blender_gather_tree import VExportNode -from .gltf2_blender_gather_animation_utils import merge_tracks_perform, bake_animation, bake_data_animation, add_slide_data, reset_bone_matrix, reset_sk_data -from .gltf2_blender_gather_drivers import get_sk_drivers -from .sampled.gltf2_blender_gather_animation_sampling_cache import get_cache_data +from ....io.exp.user_extensions import export_user_extensions +from ..cache import cached +from ..tree import VExportNode +from .anim_utils import merge_tracks_perform, bake_animation, bake_data_animation, add_slide_data, reset_bone_matrix, reset_sk_data +from .drivers import get_sk_drivers +from .sampled.sampling_cache import get_cache_data def gather_tracks_animations(export_settings): diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py b/addons/io_scene_gltf2/blender/exp/cache.py similarity index 100% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cache.py rename to addons/io_scene_gltf2/blender/exp/cache.py diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py b/addons/io_scene_gltf2/blender/exp/cameras.py similarity index 95% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py rename to addons/io_scene_gltf2/blender/exp/cameras.py index 28d11276d..ebe4a7375 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py +++ b/addons/io_scene_gltf2/blender/exp/cameras.py @@ -15,10 +15,10 @@ import bpy import math from ...io.com import gltf2_io -from ...blender.com.gltf2_blender_conversion import yvof_blender_to_gltf -from ...io.exp.gltf2_io_user_extensions import export_user_extensions -from ..com.gltf2_blender_extras import generate_extras -from .gltf2_blender_gather_cache import cached +from ...blender.com.conversion import yvof_blender_to_gltf +from ...io.exp.user_extensions import export_user_extensions +from ..com.extras import generate_extras +from .cache import cached @cached diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py b/addons/io_scene_gltf2/blender/exp/export.py similarity index 97% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py rename to addons/io_scene_gltf2/blender/exp/export.py index 1d214f328..b24b85f60 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_export.py +++ b/addons/io_scene_gltf2/blender/exp/export.py @@ -20,12 +20,12 @@ import sys import traceback -from ...io.exp import gltf2_io_export -from ...io.exp import gltf2_io_draco_compression_extension -from ...io.exp.gltf2_io_user_extensions import export_user_extensions -from ..com import gltf2_blender_json -from . import gltf2_blender_gather -from .gltf2_blender_gltf2_exporter import GlTF2Exporter +from ...io.exp import export as gltf2_io_export +from ...io.exp import draco as gltf2_io_draco_compression_extension +from ...io.exp.user_extensions import export_user_extensions +from ..com import json_util +from . import gather as gltf2_blender_gather +from .exporter import GlTF2Exporter def save(context, export_settings): @@ -375,7 +375,7 @@ def __write_file(json, buffer, export_settings): gltf2_io_export.save_gltf( json, export_settings, - gltf2_blender_json.BlenderJSONEncoder, + json_util.BlenderJSONEncoder, buffer) if (export_settings['gltf_use_gltfpack'] == True): __postprocess_with_gltfpack(export_settings) diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gltf2_exporter.py b/addons/io_scene_gltf2/blender/exp/exporter.py similarity index 98% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gltf2_exporter.py rename to addons/io_scene_gltf2/blender/exp/exporter.py index fde28dc4b..5e8fd628d 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gltf2_exporter.py +++ b/addons/io_scene_gltf2/blender/exp/exporter.py @@ -19,12 +19,12 @@ from ... import get_version_string from ...io.com import gltf2_io, gltf2_io_extensions -from ...io.com.gltf2_io_path import path_to_uri, uri_to_path -from ...io.com.gltf2_io_constants import ComponentType, DataType -from ...io.exp import gltf2_io_binary_data, gltf2_io_buffer, gltf2_io_image_data -from ...io.exp.gltf2_io_user_extensions import export_user_extensions -from .gltf2_blender_gather_accessors import gather_accessor -from .material.gltf2_blender_gather_image import get_gltf_image_from_blender_image +from ...io.com.path import path_to_uri, uri_to_path +from ...io.com.constants import ComponentType, DataType +from ...io.exp import binary_data as gltf2_io_binary_data, buffer as gltf2_io_buffer, image_data as gltf2_io_image_data +from ...io.exp.user_extensions import export_user_extensions +from .accessors import gather_accessor +from .material.image import get_gltf_image_from_blender_image class AdditionalData: def __init__(self): diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py b/addons/io_scene_gltf2/blender/exp/gather.py similarity index 92% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py rename to addons/io_scene_gltf2/blender/exp/gather.py index 5004a8240..9d3b5a38d 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather.py +++ b/addons/io_scene_gltf2/blender/exp/gather.py @@ -15,14 +15,14 @@ import bpy from ...io.com import gltf2_io -from ...io.exp.gltf2_io_user_extensions import export_user_extensions -from ..com.gltf2_blender_extras import generate_extras -from .gltf2_blender_gather_cache import cached -from . import gltf2_blender_gather_nodes -from . import gltf2_blender_gather_joints -from . import gltf2_blender_gather_tree -from .animation.sampled.object.gltf2_blender_gather_object_keyframes import get_cache_data -from .animation.gltf2_blender_gather_animations import gather_animations +from ...io.exp.user_extensions import export_user_extensions +from ..com.extras import generate_extras +from .cache import cached +from . import nodes as gltf2_blender_gather_nodes +from . import joints as gltf2_blender_gather_joints +from . import tree as gltf2_blender_gather_tree +from .animation.sampled.object.keyframes import get_cache_data +from .animation.animations import gather_animations def gather_gltf2(export_settings): diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_get.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_get.py deleted file mode 100644 index 1dd0f66fe..000000000 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_get.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2018-2021 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 bpy -from mathutils import Vector, Matrix -from ...blender.com.gltf2_blender_conversion import texture_transform_blender_to_gltf -from ...io.com import gltf2_io_debug -from ..com.gltf2_blender_material_helpers import get_gltf_node_name, get_gltf_node_old_name -from .material import gltf2_blender_search_node_tree - -def get_animation_target(action_group: bpy.types.ActionGroup): - return action_group.channels[0].data_path.split('.')[-1] - - -def get_object_from_datapath(blender_object, data_path: str): - if "." in data_path: - # gives us: ('modifiers["Subsurf"]', 'levels') - path_prop, path_attr = data_path.rsplit(".", 1) - - # same as: prop = obj.modifiers["Subsurf"] - if path_attr in ["rotation", "scale", "location", - "rotation_axis_angle", "rotation_euler", "rotation_quaternion"]: - prop = blender_object.path_resolve(path_prop) - else: - prop = blender_object.path_resolve(data_path) - else: - prop = blender_object - # single attribute such as name, location... etc - # path_attr = data_path - - return prop diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_joints.py b/addons/io_scene_gltf2/blender/exp/joints.py similarity index 95% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_joints.py rename to addons/io_scene_gltf2/blender/exp/joints.py index 19a01a8b5..a43bca75d 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_joints.py +++ b/addons/io_scene_gltf2/blender/exp/joints.py @@ -14,10 +14,10 @@ from mathutils import Quaternion, Vector from ...io.com import gltf2_io -from ...io.exp.gltf2_io_user_extensions import export_user_extensions -from ..com.gltf2_blender_extras import generate_extras -from .gltf2_blender_gather_cache import cached -from . import gltf2_blender_gather_tree +from ...io.exp.user_extensions import export_user_extensions +from ..com.extras import generate_extras +from .cache import cached +from . import tree as gltf2_blender_gather_tree # TODO these 3 functions move to shared file diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_light_spots.py b/addons/io_scene_gltf2/blender/exp/light_spots.py similarity index 96% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_light_spots.py rename to addons/io_scene_gltf2/blender/exp/light_spots.py index 04b11acca..268838435 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_light_spots.py +++ b/addons/io_scene_gltf2/blender/exp/light_spots.py @@ -13,7 +13,7 @@ # limitations under the License. from typing import Optional -from ...io.com import gltf2_io_lights_punctual +from ...io.com import lights_punctual as gltf2_io_lights_punctual def gather_light_spot(blender_lamp, export_settings) -> Optional[gltf2_io_lights_punctual.LightSpot]: diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_lights.py b/addons/io_scene_gltf2/blender/exp/lights.py similarity index 88% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_lights.py rename to addons/io_scene_gltf2/blender/exp/lights.py index eb9d204c6..46a0983f8 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_lights.py +++ b/addons/io_scene_gltf2/blender/exp/lights.py @@ -15,14 +15,14 @@ import bpy import math from typing import Optional, List, Dict, Any -from ...io.com import gltf2_io_lights_punctual -from ...io.com import gltf2_io_debug -from ..com.gltf2_blender_extras import generate_extras -from ..com.gltf2_blender_conversion import PBR_WATTS_TO_LUMENS -from ..com.gltf2_blender_default import LIGHTS -from .gltf2_blender_gather_cache import cached -from . import gltf2_blender_gather_light_spots -from .material import gltf2_blender_search_node_tree +from ...io.com import lights_punctual as gltf2_io_lights_punctual +from ...io.com import debug as gltf2_io_debug +from ..com.extras import generate_extras +from ..com.conversion import PBR_WATTS_TO_LUMENS +from ..com.blender_default import LIGHTS +from .cache import cached +from . import light_spots as gltf2_blender_gather_light_spots +from .material import search_node_tree @cached @@ -81,9 +81,9 @@ def __gather_intensity(blender_lamp, export_settings) -> Optional[float]: if emission_node is not None: if blender_lamp.type != 'SUN': # When using cycles, the strength should be influenced by a LightFalloff node - result = gltf2_blender_search_node_tree.from_socket( - gltf2_blender_search_node_tree.NodeSocket(emission_node.inputs.get("Strength"), blender_lamp.node_tree), - gltf2_blender_search_node_tree.FilterByType(bpy.types.ShaderNodeLightFalloff) + result = search_node_tree.from_socket( + search_node_tree.NodeSocket(emission_node.inputs.get("Strength"), blender_lamp.node_tree), + search_node_tree.FilterByType(bpy.types.ShaderNodeLightFalloff) ) if result: quadratic_falloff_node = result[0].shader_node @@ -188,9 +188,9 @@ def __get_cycles_emission_node(blender_lamp) -> Optional[bpy.types.ShaderNodeEmi if is_shadernode_output: if not currentNode.is_active_output: continue - result = gltf2_blender_search_node_tree.from_socket( - gltf2_blender_search_node_tree.NodeSocket(currentNode.inputs.get("Surface"), blender_lamp.node_tree), - gltf2_blender_search_node_tree.FilterByType(bpy.types.ShaderNodeEmission) + result = search_node_tree.from_socket( + search_node_tree.NodeSocket(currentNode.inputs.get("Surface"), blender_lamp.node_tree), + search_node_tree.FilterByType(bpy.types.ShaderNodeEmission) ) if not result: continue diff --git a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_image.py b/addons/io_scene_gltf2/blender/exp/material/encode_image.py similarity index 100% rename from addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_image.py rename to addons/io_scene_gltf2/blender/exp/material/encode_image.py diff --git a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_anisotropy.py b/addons/io_scene_gltf2/blender/exp/material/extensions/anisotropy.py similarity index 96% rename from addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_anisotropy.py rename to addons/io_scene_gltf2/blender/exp/material/extensions/anisotropy.py index 2724f1672..be377bdfd 100644 --- a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_anisotropy.py +++ b/addons/io_scene_gltf2/blender/exp/material/extensions/anisotropy.py @@ -13,12 +13,13 @@ # limitations under the License. import bpy -from .gltf2_blender_image import TmpImageGuard, make_temp_image_copy, StoreImage, StoreData + import numpy as np from .....io.com.gltf2_io_extensions import Extension -from ....com.gltf2_blender_conversion import get_anisotropy_rotation_blender_to_gltf -from ...material import gltf2_blender_gather_texture_info -from ..gltf2_blender_search_node_tree import detect_anisotropy_nodes, get_socket, has_image_node_from_socket, get_factor_from_socket +from ....com.conversion import get_anisotropy_rotation_blender_to_gltf +from ...material import texture_info as gltf2_blender_gather_texture_info +from ..search_node_tree import detect_anisotropy_nodes, get_socket, has_image_node_from_socket, get_factor_from_socket +from ..encode_image import TmpImageGuard, make_temp_image_copy, StoreImage, StoreData def export_anisotropy(blender_material, export_settings): diff --git a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_clearcoat.py b/addons/io_scene_gltf2/blender/exp/material/extensions/clearcoat.py similarity index 97% rename from addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_clearcoat.py rename to addons/io_scene_gltf2/blender/exp/material/extensions/clearcoat.py index 2574c2108..62894c5d8 100644 --- a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_clearcoat.py +++ b/addons/io_scene_gltf2/blender/exp/material/extensions/clearcoat.py @@ -13,11 +13,11 @@ # limitations under the License. import bpy -from .....io.com.gltf2_io_constants import BLENDER_COAT_ROUGHNESS +from .....io.com.constants import BLENDER_COAT_ROUGHNESS from .....io.com.gltf2_io_extensions import Extension -from ...material import gltf2_blender_gather_texture_info +from ...material import texture_info as gltf2_blender_gather_texture_info -from ..gltf2_blender_search_node_tree import has_image_node_from_socket, get_socket, get_factor_from_socket +from ..search_node_tree import has_image_node_from_socket, get_socket, get_factor_from_socket def export_clearcoat(blender_material, export_settings): has_clearcoat_texture = False diff --git a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_emission.py b/addons/io_scene_gltf2/blender/exp/material/extensions/emission.py similarity index 98% rename from addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_emission.py rename to addons/io_scene_gltf2/blender/exp/material/extensions/emission.py index 6976b86c7..413b5f07d 100644 --- a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_emission.py +++ b/addons/io_scene_gltf2/blender/exp/material/extensions/emission.py @@ -14,8 +14,8 @@ import bpy from .....io.com.gltf2_io_extensions import Extension -from ...material import gltf2_blender_gather_texture_info -from ..gltf2_blender_search_node_tree import \ +from ...material import texture_info as gltf2_blender_gather_texture_info +from ..search_node_tree import \ get_const_from_default_value_socket, \ get_socket, \ get_factor_from_socket, \ diff --git a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_ior.py b/addons/io_scene_gltf2/blender/exp/material/extensions/ior.py similarity index 94% rename from addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_ior.py rename to addons/io_scene_gltf2/blender/exp/material/extensions/ior.py index 698d59c7b..ae1662aeb 100644 --- a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_ior.py +++ b/addons/io_scene_gltf2/blender/exp/material/extensions/ior.py @@ -13,8 +13,8 @@ # limitations under the License. from .....io.com.gltf2_io_extensions import Extension -from .....io.com.gltf2_io_constants import GLTF_IOR -from ..gltf2_blender_search_node_tree import get_socket +from .....io.com.constants import GLTF_IOR +from ..search_node_tree import get_socket def export_ior(blender_material, extensions, export_settings): ior_socket = get_socket(blender_material.node_tree, blender_material.use_nodes, 'IOR') diff --git a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_sheen.py b/addons/io_scene_gltf2/blender/exp/material/extensions/sheen.py similarity index 98% rename from addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_sheen.py rename to addons/io_scene_gltf2/blender/exp/material/extensions/sheen.py index 15ac319e1..52deace63 100644 --- a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_sheen.py +++ b/addons/io_scene_gltf2/blender/exp/material/extensions/sheen.py @@ -14,8 +14,8 @@ import bpy from .....io.com.gltf2_io_extensions import Extension -from ...material import gltf2_blender_gather_texture_info -from ..gltf2_blender_search_node_tree import \ +from ...material import texture_info as gltf2_blender_gather_texture_info +from ..search_node_tree import \ has_image_node_from_socket, \ get_socket, \ get_factor_from_socket diff --git a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_specular.py b/addons/io_scene_gltf2/blender/exp/material/extensions/specular.py similarity index 98% rename from addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_specular.py rename to addons/io_scene_gltf2/blender/exp/material/extensions/specular.py index 4d4e183b6..f42baeafa 100644 --- a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_specular.py +++ b/addons/io_scene_gltf2/blender/exp/material/extensions/specular.py @@ -14,8 +14,8 @@ import bpy from .....io.com.gltf2_io_extensions import Extension -from ...material.gltf2_blender_gather_texture_info import gather_texture_info -from ..gltf2_blender_search_node_tree import \ +from ...material.texture_info import gather_texture_info +from ..search_node_tree import \ has_image_node_from_socket, \ get_socket, \ get_factor_from_socket diff --git a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_transmission.py b/addons/io_scene_gltf2/blender/exp/material/extensions/transmission.py similarity index 97% rename from addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_transmission.py rename to addons/io_scene_gltf2/blender/exp/material/extensions/transmission.py index a4a00cbf7..a17efd67c 100644 --- a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_transmission.py +++ b/addons/io_scene_gltf2/blender/exp/material/extensions/transmission.py @@ -14,8 +14,8 @@ import bpy from .....io.com.gltf2_io_extensions import Extension -from ...material import gltf2_blender_gather_texture_info -from ..gltf2_blender_search_node_tree import \ +from ...material import texture_info as gltf2_blender_gather_texture_info +from ..search_node_tree import \ has_image_node_from_socket, \ get_socket, \ get_factor_from_socket diff --git a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_variants.py b/addons/io_scene_gltf2/blender/exp/material/extensions/variants.py similarity index 91% rename from addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_variants.py rename to addons/io_scene_gltf2/blender/exp/material/extensions/variants.py index 1cab92010..e6731e117 100644 --- a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_variants.py +++ b/addons/io_scene_gltf2/blender/exp/material/extensions/variants.py @@ -14,8 +14,8 @@ import bpy from typing import Dict, Any -from .....io.com import gltf2_io_variants -from ...gltf2_blender_gather_cache import cached +from .....io.com import variants as gltf2_io_variants +from ...cache import cached @cached diff --git a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_volume.py b/addons/io_scene_gltf2/blender/exp/material/extensions/volume.py similarity index 98% rename from addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_volume.py rename to addons/io_scene_gltf2/blender/exp/material/extensions/volume.py index 2c4961a1e..51c3878cf 100644 --- a/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_gather_materials_volume.py +++ b/addons/io_scene_gltf2/blender/exp/material/extensions/volume.py @@ -14,8 +14,8 @@ import bpy from .....io.com.gltf2_io_extensions import Extension -from ...material import gltf2_blender_gather_texture_info -from ..gltf2_blender_search_node_tree import \ +from ...material import texture_info as gltf2_blender_gather_texture_info +from ..search_node_tree import \ has_image_node_from_socket, \ get_const_from_default_value_socket, \ get_socket_from_gltf_material_node, \ diff --git a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_image.py b/addons/io_scene_gltf2/blender/exp/material/image.py similarity index 96% rename from addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_image.py rename to addons/io_scene_gltf2/blender/exp/material/image.py index 12eb41992..bdb841092 100644 --- a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_image.py +++ b/addons/io_scene_gltf2/blender/exp/material/image.py @@ -17,13 +17,13 @@ import os from ....io.com import gltf2_io -from ....io.com.gltf2_io_path import path_to_uri -from ....io.exp import gltf2_io_binary_data, gltf2_io_image_data -from ....io.com import gltf2_io_debug -from ....io.exp.gltf2_io_user_extensions import export_user_extensions -from ..gltf2_blender_gather_cache import cached -from .extensions.gltf2_blender_image import Channel, ExportImage, FillImage, FillImageTile, FillImageRGB2BW -from .gltf2_blender_search_node_tree import get_texture_node_from_socket, detect_anisotropy_nodes +from ....io.com.path import path_to_uri +from ....io.exp import binary_data as gltf2_io_binary_data, image_data as gltf2_io_image_data +from ....io.com import debug as gltf2_io_debug +from ....io.exp.user_extensions import export_user_extensions +from ..cache import cached +from .encode_image import Channel, ExportImage, FillImage, FillImageTile, FillImageRGB2BW +from .search_node_tree import get_texture_node_from_socket, detect_anisotropy_nodes @cached def gather_image( @@ -381,7 +381,7 @@ def __get_image_data_grayscale_anisotropy(sockets, results, export_settings) -> """ calculating Anisotropy Texture from grayscale textures, settings needed data """ - from .extensions.gltf2_blender_gather_materials_anisotropy import grayscale_anisotropy_calculation + from .extensions.anisotropy import grayscale_anisotropy_calculation composed_image = ExportImage() composed_image.set_calc(grayscale_anisotropy_calculation) diff --git a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_materials.py b/addons/io_scene_gltf2/blender/exp/material/materials.py similarity index 95% rename from addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_materials.py rename to addons/io_scene_gltf2/blender/exp/material/materials.py index 8c8e0e822..f69853816 100644 --- a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_materials.py +++ b/addons/io_scene_gltf2/blender/exp/material/materials.py @@ -17,22 +17,22 @@ from ....io.com import gltf2_io from ....io.com.gltf2_io_extensions import Extension -from ....io.exp.gltf2_io_user_extensions import export_user_extensions -from ...com.gltf2_blender_extras import generate_extras -from ..gltf2_blender_gather_cache import cached, cached_by_key -from . import gltf2_blender_gather_materials_unlit -from . import gltf2_blender_gather_texture_info -from . import gltf2_blender_gather_materials_pbr_metallic_roughness -from .extensions.gltf2_blender_gather_materials_volume import export_volume -from .extensions.gltf2_blender_gather_materials_emission import export_emission_factor, \ +from ....io.exp.user_extensions import export_user_extensions +from ...com.extras import generate_extras +from ..cache import cached, cached_by_key +from . import unlit as gltf2_unlit +from . import texture_info as gltf2_blender_gather_texture_info +from . import pbr_metallic_roughness as gltf2_pbr_metallic_roughness +from .extensions.volume import export_volume +from .extensions.emission import export_emission_factor, \ export_emission_texture, export_emission_strength_extension -from .extensions.gltf2_blender_gather_materials_sheen import export_sheen -from .extensions.gltf2_blender_gather_materials_specular import export_specular -from .extensions.gltf2_blender_gather_materials_transmission import export_transmission -from .extensions.gltf2_blender_gather_materials_clearcoat import export_clearcoat -from .extensions.gltf2_blender_gather_materials_anisotropy import export_anisotropy -from .extensions.gltf2_blender_gather_materials_ior import export_ior -from .gltf2_blender_search_node_tree import \ +from .extensions.sheen import export_sheen +from .extensions.specular import export_specular +from .extensions.transmission import export_transmission +from .extensions.clearcoat import export_clearcoat +from .extensions.anisotropy import export_anisotropy +from .extensions.ior import export_ior +from .search_node_tree import \ has_image_node_from_socket, \ get_socket_from_gltf_material_node, \ get_socket, \ @@ -166,7 +166,7 @@ def gather_material(blender_material, export_settings): # We need to set manually default values for # pbr_metallic_roughness.baseColor if material.emissive_factor is not None and get_node_socket(blender_material.node_tree, bpy.types.ShaderNodeBsdfPrincipled, "Base Color").socket is None: - material.pbr_metallic_roughness = gltf2_blender_gather_materials_pbr_metallic_roughness.get_default_pbr_for_emissive_node() + material.pbr_metallic_roughness = gltf2_pbr_metallic_roughness.get_default_pbr_for_emissive_node() export_user_extensions('gather_material_hook', export_settings, material, blender_material) @@ -444,13 +444,12 @@ def __gather_occlusion_texture(blender_material, orm_texture, export_settings): def __gather_pbr_metallic_roughness(blender_material, orm_texture, export_settings): - return gltf2_blender_gather_materials_pbr_metallic_roughness.gather_material_pbr_metallic_roughness( + return gltf2_pbr_metallic_roughness.gather_material_pbr_metallic_roughness( blender_material, orm_texture, export_settings) def __export_unlit(blender_material, export_settings): - gltf2_unlit = gltf2_blender_gather_materials_unlit info = gltf2_unlit.detect_shadeless_material(blender_material.node_tree, blender_material.use_nodes, export_settings) if info is None: diff --git a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_materials_pbr_metallic_roughness.py b/addons/io_scene_gltf2/blender/exp/material/pbr_metallic_roughness.py similarity index 97% rename from addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_materials_pbr_metallic_roughness.py rename to addons/io_scene_gltf2/blender/exp/material/pbr_metallic_roughness.py index fe641114c..05a507648 100644 --- a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_materials_pbr_metallic_roughness.py +++ b/addons/io_scene_gltf2/blender/exp/material/pbr_metallic_roughness.py @@ -15,11 +15,11 @@ import bpy from ....io.com import gltf2_io -from ....io.exp.gltf2_io_user_extensions import export_user_extensions -from ..gltf2_blender_gather_cache import cached -from .gltf2_blender_search_node_tree import get_vertex_color_info -from .gltf2_blender_gather_texture_info import gather_texture_info -from .gltf2_blender_search_node_tree import \ +from ....io.exp.user_extensions import export_user_extensions +from ..cache import cached +from .search_node_tree import get_vertex_color_info +from .texture_info import gather_texture_info +from .search_node_tree import \ get_socket_from_gltf_material_node, \ has_image_node_from_socket, \ get_const_from_default_value_socket, \ diff --git a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_search_node_tree.py b/addons/io_scene_gltf2/blender/exp/material/search_node_tree.py similarity index 99% rename from addons/io_scene_gltf2/blender/exp/material/gltf2_blender_search_node_tree.py rename to addons/io_scene_gltf2/blender/exp/material/search_node_tree.py index 91761c23a..61bddde84 100644 --- a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_search_node_tree.py +++ b/addons/io_scene_gltf2/blender/exp/material/search_node_tree.py @@ -18,9 +18,9 @@ import bpy from mathutils import Vector, Matrix -from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached -from ...com.gltf2_blender_material_helpers import get_gltf_node_name, get_gltf_node_old_name, get_gltf_old_group_node_name -from ....blender.com.gltf2_blender_conversion import texture_transform_blender_to_gltf, inverted_trs_mapping_node +from io_scene_gltf2.blender.exp.cache import cached +from ...com.material_helpers import get_gltf_node_name, get_gltf_node_old_name, get_gltf_old_group_node_name +from ....blender.com.conversion import texture_transform_blender_to_gltf, inverted_trs_mapping_node import typing diff --git a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_texture.py b/addons/io_scene_gltf2/blender/exp/material/texture.py similarity index 93% rename from addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_texture.py rename to addons/io_scene_gltf2/blender/exp/material/texture.py index c2e9245b0..3b89477b8 100644 --- a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_texture.py +++ b/addons/io_scene_gltf2/blender/exp/material/texture.py @@ -15,16 +15,16 @@ import typing import bpy -from ....io.exp.gltf2_io_user_extensions import export_user_extensions +from ....io.exp.user_extensions import export_user_extensions from ....io.com.gltf2_io_extensions import Extension -from ....io.exp.gltf2_io_image_data import ImageData -from ....io.exp.gltf2_io_binary_data import BinaryData -from ....io.com import gltf2_io_debug +from ....io.exp.image_data import ImageData +from ....io.exp.binary_data import BinaryData +from ....io.com import debug as gltf2_io_debug from ....io.com import gltf2_io -from ..gltf2_blender_gather_sampler import gather_sampler -from ..gltf2_blender_gather_cache import cached -from .gltf2_blender_search_node_tree import get_texture_node_from_socket, NodeSocket -from . import gltf2_blender_gather_image +from ..sampler import gather_sampler +from ..cache import cached +from .search_node_tree import get_texture_node_from_socket, NodeSocket +from . import image @cached @@ -212,7 +212,7 @@ def __gather_sampler(blender_shader_sockets, export_settings): def __gather_source(blender_shader_sockets, use_tile, export_settings): - source, image_data, factor, udim_image = gltf2_blender_gather_image.gather_image(blender_shader_sockets, use_tile, export_settings) + source, image_data, factor, udim_image = image.gather_image(blender_shader_sockets, use_tile, export_settings) if export_settings['gltf_keep_original_textures'] is False \ diff --git a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_texture_info.py b/addons/io_scene_gltf2/blender/exp/material/texture_info.py similarity index 97% rename from addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_texture_info.py rename to addons/io_scene_gltf2/blender/exp/material/texture_info.py index 218b7beae..5f04fc6a8 100644 --- a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_texture_info.py +++ b/addons/io_scene_gltf2/blender/exp/material/texture_info.py @@ -16,11 +16,11 @@ import typing from ....io.com import gltf2_io from ....io.com.gltf2_io_extensions import Extension -from ....io.exp.gltf2_io_user_extensions import export_user_extensions -from ..gltf2_blender_gather_sampler import detect_manual_uv_wrapping -from ..gltf2_blender_gather_cache import cached -from . import gltf2_blender_gather_texture -from .gltf2_blender_search_node_tree import \ +from ....io.exp.user_extensions import export_user_extensions +from ..sampler import detect_manual_uv_wrapping +from ..cache import cached +from . import texture as gltf2_blender_gather_texture +from .search_node_tree import \ get_texture_node_from_socket, \ from_socket, \ FilterByType, \ diff --git a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_materials_unlit.py b/addons/io_scene_gltf2/blender/exp/material/unlit.py similarity index 98% rename from addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_materials_unlit.py rename to addons/io_scene_gltf2/blender/exp/material/unlit.py index 844c4f5cb..91dfb9b6f 100644 --- a/addons/io_scene_gltf2/blender/exp/material/gltf2_blender_gather_materials_unlit.py +++ b/addons/io_scene_gltf2/blender/exp/material/unlit.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from . import gltf2_blender_gather_texture_info -from .gltf2_blender_search_node_tree import \ +from . import texture_info as gltf2_blender_gather_texture_info +from .search_node_tree import \ get_socket, \ NodeSocket, \ previous_socket, \ diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py b/addons/io_scene_gltf2/blender/exp/mesh.py similarity index 95% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py rename to addons/io_scene_gltf2/blender/exp/mesh.py index 4ec9ceda3..8e67aea0f 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_mesh.py +++ b/addons/io_scene_gltf2/blender/exp/mesh.py @@ -15,11 +15,11 @@ import bpy from typing import Optional, Dict, List, Any, Tuple from ...io.com import gltf2_io -from ...blender.com.gltf2_blender_data_path import get_sk_exported -from ...io.exp.gltf2_io_user_extensions import export_user_extensions -from ..com.gltf2_blender_extras import generate_extras -from . import gltf2_blender_gather_primitives -from .gltf2_blender_gather_cache import cached_by_key +from ...blender.com.data_path import get_sk_exported +from ...io.exp.user_extensions import export_user_extensions +from ..com.extras import generate_extras +from . import primitives as gltf2_blender_gather_primitives +from .cache import cached_by_key def get_mesh_cache_key(blender_mesh, blender_object, diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py b/addons/io_scene_gltf2/blender/exp/nodes.py similarity index 97% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py rename to addons/io_scene_gltf2/blender/exp/nodes.py index 0e6651627..4341033c3 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py +++ b/addons/io_scene_gltf2/blender/exp/nodes.py @@ -18,17 +18,17 @@ from ...io.com import gltf2_io from ...io.com import gltf2_io_extensions -from ...io.exp.gltf2_io_user_extensions import export_user_extensions -from ..com.gltf2_blender_extras import generate_extras, BLACK_LIST -from ..com.gltf2_blender_default import LIGHTS +from ...io.exp.user_extensions import export_user_extensions +from ..com.extras import generate_extras, BLACK_LIST +from ..com.blender_default import LIGHTS from ..com import gltf2_blender_math -from . import gltf2_blender_gather_tree -from . import gltf2_blender_gather_skins -from . import gltf2_blender_gather_cameras -from . import gltf2_blender_gather_mesh -from . import gltf2_blender_gather_joints -from . import gltf2_blender_gather_lights -from .gltf2_blender_gather_tree import VExportNode +from . import tree as gltf2_blender_gather_tree +from . import skins as gltf2_blender_gather_skins +from . import cameras as gltf2_blender_gather_cameras +from . import mesh as gltf2_blender_gather_mesh +from . import joints as gltf2_blender_gather_joints +from . import lights as gltf2_blender_gather_lights +from .tree import VExportNode def gather_node(vnode, export_settings): diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py b/addons/io_scene_gltf2/blender/exp/primitive_attributes.py similarity index 97% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py rename to addons/io_scene_gltf2/blender/exp/primitive_attributes.py index a9bb80922..01156fb2b 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitive_attributes.py +++ b/addons/io_scene_gltf2/blender/exp/primitive_attributes.py @@ -15,10 +15,10 @@ import numpy as np from math import ceil -from ...io.com import gltf2_io, gltf2_io_constants, gltf2_io_debug -from ...io.exp import gltf2_io_binary_data -from ...io.exp.gltf2_io_user_extensions import export_user_extensions -from .gltf2_blender_gather_accessors import array_to_accessor +from ...io.com import gltf2_io, constants as gltf2_io_constants, debug as gltf2_io_debug +from ...io.exp import binary_data as gltf2_io_binary_data +from ...io.exp.user_extensions import export_user_extensions +from .accessors import array_to_accessor def gather_primitive_attributes(blender_primitive, export_settings): diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives_extract.py b/addons/io_scene_gltf2/blender/exp/primitive_extract.py similarity index 99% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives_extract.py rename to addons/io_scene_gltf2/blender/exp/primitive_extract.py index 84d8454ad..1fdc5ded4 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives_extract.py +++ b/addons/io_scene_gltf2/blender/exp/primitive_extract.py @@ -15,15 +15,15 @@ import numpy as np from copy import deepcopy from mathutils import Vector -from ...blender.com.gltf2_blender_data_path import get_sk_exported -from ...io.com.gltf2_io_constants import ROUNDING_DIGIT -from ...io.exp.gltf2_io_user_extensions import export_user_extensions -from ...io.com import gltf2_io_constants -from ..com import gltf2_blender_conversion +from ...blender.com.data_path import get_sk_exported +from ...io.com.constants import ROUNDING_DIGIT +from ...io.exp.user_extensions import export_user_extensions +from ...io.com import constants as gltf2_io_constants +from ..com import conversion as gltf2_blender_conversion from ..com.gltf2_blender_utils import fast_structured_np_unique -from .material.gltf2_blender_gather_materials import get_base_material, get_material_from_idx, get_active_uvmap_index, get_new_material_texture_shared -from .material.gltf2_blender_gather_texture_info import gather_udim_texture_info -from . import gltf2_blender_gather_skins +from .material.materials import get_base_material, get_material_from_idx, get_active_uvmap_index, get_new_material_texture_shared +from .material.texture_info import gather_udim_texture_info +from . import skins as gltf2_blender_gather_skins def extract_primitives(materials, blender_mesh, uuid_for_skined_data, blender_vertex_groups, modifiers, export_settings): diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py b/addons/io_scene_gltf2/blender/exp/primitives.py similarity index 94% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py rename to addons/io_scene_gltf2/blender/exp/primitives.py index 38ad1f4ce..00f127de3 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py +++ b/addons/io_scene_gltf2/blender/exp/primitives.py @@ -15,15 +15,15 @@ import bpy from typing import List, Optional, Tuple import numpy as np -from ...io.com import gltf2_io, gltf2_io_constants, gltf2_io_extensions -from ...blender.com.gltf2_blender_data_path import get_sk_exported -from ...io.exp import gltf2_io_binary_data -from .gltf2_blender_gather_cache import cached, cached_by_key -from . import gltf2_blender_gather_primitives_extract -from . import gltf2_blender_gather_primitive_attributes -from .gltf2_blender_gather_accessors import gather_accessor, array_to_accessor -from .material.gltf2_blender_gather_materials import get_final_material, gather_material, get_base_material, get_material_from_idx -from .material.extensions import gltf2_blender_gather_materials_variants +from ...io.com import gltf2_io, constants as gltf2_io_constants, gltf2_io_extensions +from ...blender.com.data_path import get_sk_exported +from ...io.exp import binary_data as gltf2_io_binary_data +from .cache import cached, cached_by_key +from . import primitive_extract as gltf2_blender_gather_primitives_extract +from . import primitive_attributes as gltf2_blender_gather_primitive_attributes +from .accessors import gather_accessor, array_to_accessor +from .material.materials import get_final_material, gather_material, get_base_material, get_material_from_idx +from .material.extensions import variants as ext_variants @cached def gather_primitive_cache_key( @@ -296,7 +296,7 @@ def __gather_extensions(blender_mesh, if v.variant.variant_idx in [o.variant.variant_idx for o in i.variants[:idx]]: # Avoid duplicates continue - vari = gltf2_blender_gather_materials_variants.gather_variant(v.variant.variant_idx, export_settings) + vari = ext_variants.gather_variant(v.variant.variant_idx, export_settings) if vari is not None: variant_extension = gltf2_io_extensions.ChildOfRootExtension( name="KHR_materials_variants", diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_sampler.py b/addons/io_scene_gltf2/blender/exp/sampler.py similarity index 95% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_sampler.py rename to addons/io_scene_gltf2/blender/exp/sampler.py index 370ccd58f..4c9f1059d 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_sampler.py +++ b/addons/io_scene_gltf2/blender/exp/sampler.py @@ -14,10 +14,10 @@ import bpy from ...io.com import gltf2_io -from ...io.exp.gltf2_io_user_extensions import export_user_extensions -from ...io.com.gltf2_io_constants import TextureFilter, TextureWrap -from .gltf2_blender_gather_cache import cached -from .material.gltf2_blender_search_node_tree import previous_node, previous_socket, get_const_from_socket, NodeSocket +from ...io.exp.user_extensions import export_user_extensions +from ...io.com.constants import TextureFilter, TextureWrap +from .cache import cached +from .material.search_node_tree import previous_node, previous_socket, get_const_from_socket, NodeSocket @cached diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_skins.py b/addons/io_scene_gltf2/blender/exp/skins.py similarity index 94% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_skins.py rename to addons/io_scene_gltf2/blender/exp/skins.py index ec8de7335..4e40f64d6 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_skins.py +++ b/addons/io_scene_gltf2/blender/exp/skins.py @@ -13,13 +13,13 @@ # limitations under the License. import mathutils -from ...io.com import gltf2_io, gltf2_io_constants -from ...io.exp import gltf2_io_binary_data -from ...io.exp.gltf2_io_user_extensions import export_user_extensions -from . import gltf2_blender_gather_accessors -from . import gltf2_blender_gather_joints -from .gltf2_blender_gather_tree import VExportNode -from .gltf2_blender_gather_cache import cached +from ...io.com import gltf2_io, constants as gltf2_io_constants +from ...io.exp import binary_data as gltf2_io_binary_data +from ...io.exp.user_extensions import export_user_extensions +from . import accessors as gltf2_blender_gather_accessors +from . import joints as gltf2_blender_gather_joints +from .tree import VExportNode +from .cache import cached @cached def gather_skin(armature_uuid, export_settings): diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py b/addons/io_scene_gltf2/blender/exp/tree.py similarity index 99% rename from addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py rename to addons/io_scene_gltf2/blender/exp/tree.py index f8bb8f568..bdd15143f 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py +++ b/addons/io_scene_gltf2/blender/exp/tree.py @@ -16,13 +16,13 @@ import uuid import numpy as np from mathutils import Quaternion, Matrix, Vector -from ...io.exp.gltf2_io_user_extensions import export_user_extensions +from ...io.exp.user_extensions import export_user_extensions from ...io.com import gltf2_io from ...io.imp.gltf2_io_binary import BinaryData -from ...io.com import gltf2_io_constants -from ...io.exp import gltf2_io_binary_data -from ..com.gltf2_blender_default import BLENDER_GLTF_SPECIAL_COLLECTION -from . import gltf2_blender_gather_accessors +from ...io.com import constants as gltf2_io_constants +from ...io.exp import binary_data as gltf2_io_binary_data +from ..com.blender_default import BLENDER_GLTF_SPECIAL_COLLECTION +from . import accessors as gltf2_blender_gather_accessors class VExportNode: @@ -741,7 +741,7 @@ def add_neutral_bones(self): self.export_settings ) def get_unused_skins(self): - from .gltf2_blender_gather_skins import gather_skin + from .skins import gather_skin skins = [] for n in [n for n in self.nodes.values() if n.blender_type == VExportNode.ARMATURE]: if self.export_settings['gltf_armature_object_remove'] is True: diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_anisotropy.py b/addons/io_scene_gltf2/blender/imp/KHR_materials_anisotropy.py similarity index 97% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_anisotropy.py rename to addons/io_scene_gltf2/blender/imp/KHR_materials_anisotropy.py index 29b372dac..d1d709fba 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_anisotropy.py +++ b/addons/io_scene_gltf2/blender/imp/KHR_materials_anisotropy.py @@ -13,8 +13,8 @@ # limitations under the License. from ...io.com.gltf2_io import TextureInfo -from .gltf2_blender_texture import texture -from ..com.gltf2_blender_conversion import get_anisotropy_rotation_gltf_to_blender +from .texture import texture +from ..com.conversion import get_anisotropy_rotation_gltf_to_blender from math import pi from mathutils import Vector diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py b/addons/io_scene_gltf2/blender/imp/KHR_materials_pbrSpecularGlossiness.py similarity index 96% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py rename to addons/io_scene_gltf2/blender/imp/KHR_materials_pbrSpecularGlossiness.py index 7475461cc..9c26e6ff7 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_pbrSpecularGlossiness.py +++ b/addons/io_scene_gltf2/blender/imp/KHR_materials_pbrSpecularGlossiness.py @@ -14,11 +14,11 @@ import bpy from ...io.com.gltf2_io import TextureInfo -from .gltf2_blender_pbrMetallicRoughness import \ +from .pbrMetallicRoughness import \ base_color, emission, normal, occlusion, make_settings_node -from .gltf2_blender_material_utils import color_factor_and_texture -from .gltf2_blender_texture import texture, get_source -from .gltf2_blender_image import BlenderImage +from .material_utils import color_factor_and_texture +from .texture import texture, get_source +from .image import BlenderImage import numpy as np diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_unlit.py b/addons/io_scene_gltf2/blender/imp/KHR_materials_unlit.py similarity index 97% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_unlit.py rename to addons/io_scene_gltf2/blender/imp/KHR_materials_unlit.py index df6d3e56e..90d9564d1 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_KHR_materials_unlit.py +++ b/addons/io_scene_gltf2/blender/imp/KHR_materials_unlit.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from .gltf2_blender_pbrMetallicRoughness import base_color +from .pbrMetallicRoughness import base_color def unlit(mh): diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_animation.py b/addons/io_scene_gltf2/blender/imp/animation.py similarity index 95% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_animation.py rename to addons/io_scene_gltf2/blender/imp/animation.py index f1e8d3eed..e9bbf7fd3 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_animation.py +++ b/addons/io_scene_gltf2/blender/imp/animation.py @@ -13,12 +13,12 @@ # limitations under the License. import bpy -from ...io.imp.gltf2_io_user_extensions import import_user_extensions -from .gltf2_blender_animation_node import BlenderNodeAnim -from .gltf2_blender_animation_weight import BlenderWeightAnim -from .gltf2_blender_animation_pointer import BlenderPointerAnim -from .gltf2_blender_animation_utils import simulate_stash, restore_animation_on_object -from .gltf2_blender_vnode import VNode +from ...io.imp.user_extensions import import_user_extensions +from .animation_node import BlenderNodeAnim +from .animation_weight import BlenderWeightAnim +from .animation_pointer import BlenderPointerAnim +from .animation_utils import simulate_stash, restore_animation_on_object +from .vnode import VNode class BlenderAnimation(): """Dispatch Animation to node or morph weights animation, or via KHR_animation_pointer""" diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py b/addons/io_scene_gltf2/blender/imp/animation_node.py similarity index 97% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py rename to addons/io_scene_gltf2/blender/imp/animation_node.py index 4db938011..6eefeaee1 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py +++ b/addons/io_scene_gltf2/blender/imp/animation_node.py @@ -15,10 +15,10 @@ import bpy from mathutils import Vector -from ...io.imp.gltf2_io_user_extensions import import_user_extensions +from ...io.imp.user_extensions import import_user_extensions from ...io.imp.gltf2_io_binary import BinaryData -from .gltf2_blender_animation_utils import make_fcurve -from .gltf2_blender_vnode import VNode +from .animation_utils import make_fcurve +from .vnode import VNode class BlenderNodeAnim(): """Blender Object Animation.""" diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_animation_pointer.py b/addons/io_scene_gltf2/blender/imp/animation_pointer.py similarity index 98% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_animation_pointer.py rename to addons/io_scene_gltf2/blender/imp/animation_pointer.py index ac4491fab..f45630822 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_animation_pointer.py +++ b/addons/io_scene_gltf2/blender/imp/animation_pointer.py @@ -13,15 +13,15 @@ # limitations under the License. import bpy -from ...io.imp.gltf2_io_user_extensions import import_user_extensions +from ...io.imp.user_extensions import import_user_extensions from ...io.imp.gltf2_io_binary import BinaryData -from ..exp.material.gltf2_blender_search_node_tree import NodeSocket, previous_node, from_socket, get_socket, FilterByType, get_socket_from_gltf_material_node, get_texture_node_from_socket #TODO move to COM -from ..exp.gltf2_blender_gather_sampler import detect_manual_uv_wrapping #TODO move to COM -from ..exp.material.gltf2_blender_gather_materials_unlit import detect_shadeless_material #TODO move to COM -from ..com.gltf2_blender_conversion import texture_transform_gltf_to_blender -from .gltf2_blender_animation_utils import make_fcurve -from .gltf2_blender_light import BlenderLight -from .gltf2_blender_camera import BlenderCamera +from ..exp.material.search_node_tree import NodeSocket, previous_node, from_socket, get_socket, FilterByType, get_socket_from_gltf_material_node, get_texture_node_from_socket #TODO move to COM +from ..exp.sampler import detect_manual_uv_wrapping #TODO move to COM +from ..exp.material.unlit import detect_shadeless_material #TODO move to COM +from ..com.conversion import texture_transform_gltf_to_blender +from .animation_utils import make_fcurve +from .light import BlenderLight +from .camera import BlenderCamera class BlenderPointerAnim(): diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py b/addons/io_scene_gltf2/blender/imp/animation_utils.py similarity index 100% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py rename to addons/io_scene_gltf2/blender/imp/animation_utils.py diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_animation_weight.py b/addons/io_scene_gltf2/blender/imp/animation_weight.py similarity index 96% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_animation_weight.py rename to addons/io_scene_gltf2/blender/imp/animation_weight.py index 021e2d69c..eb9f86b53 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_animation_weight.py +++ b/addons/io_scene_gltf2/blender/imp/animation_weight.py @@ -14,9 +14,9 @@ import bpy -from ...io.imp.gltf2_io_user_extensions import import_user_extensions +from ...io.imp.user_extensions import import_user_extensions from ...io.imp.gltf2_io_binary import BinaryData -from .gltf2_blender_animation_utils import make_fcurve +from .animation_utils import make_fcurve class BlenderWeightAnim(): diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py b/addons/io_scene_gltf2/blender/imp/blender_gltf.py old mode 100755 new mode 100644 similarity index 99% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py rename to addons/io_scene_gltf2/blender/imp/blender_gltf.py index 2464c3c58..387b8c5b8 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py +++ b/addons/io_scene_gltf2/blender/imp/blender_gltf.py @@ -14,8 +14,8 @@ import bpy from mathutils import Vector, Quaternion, Matrix -from ...io.imp.gltf2_io_user_extensions import import_user_extensions -from .gltf2_blender_scene import BlenderScene +from ...io.imp.user_extensions import import_user_extensions +from .scene import BlenderScene class BlenderGlTF(): """Main glTF import class.""" diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_camera.py b/addons/io_scene_gltf2/blender/imp/camera.py similarity index 96% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_camera.py rename to addons/io_scene_gltf2/blender/imp/camera.py index 56fa14480..0a4a91faf 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_camera.py +++ b/addons/io_scene_gltf2/blender/imp/camera.py @@ -14,8 +14,8 @@ import bpy from math import tan -from ..com.gltf2_blender_extras import set_extras -from ...io.imp.gltf2_io_user_extensions import import_user_extensions +from ..com.extras import set_extras +from ...io.imp.user_extensions import import_user_extensions class BlenderCamera(): diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_io_draco_compression_extension.py b/addons/io_scene_gltf2/blender/imp/draco_compression_extension.py similarity index 98% rename from addons/io_scene_gltf2/blender/imp/gltf2_io_draco_compression_extension.py rename to addons/io_scene_gltf2/blender/imp/draco_compression_extension.py index 182abe2fa..d294d42a6 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_io_draco_compression_extension.py +++ b/addons/io_scene_gltf2/blender/imp/draco_compression_extension.py @@ -16,7 +16,7 @@ from ...io.com.gltf2_io import BufferView from ...io.imp.gltf2_io_binary import BinaryData -from ...io.com.gltf2_io_draco_compression_extension import dll_path +from ...io.com.draco import dll_path def decode_primitive(gltf, prim): diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_image.py b/addons/io_scene_gltf2/blender/imp/image.py similarity index 96% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_image.py rename to addons/io_scene_gltf2/blender/imp/image.py index 0be9d2acb..21f0920de 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_image.py +++ b/addons/io_scene_gltf2/blender/imp/image.py @@ -16,9 +16,9 @@ import os from os.path import dirname, join, basename -from ...io.com.gltf2_io_path import uri_to_path +from ...io.com.path import uri_to_path from ...io.imp.gltf2_io_binary import BinaryData -from ...io.imp.gltf2_io_user_extensions import import_user_extensions +from ...io.imp.user_extensions import import_user_extensions # Note that Image is not a glTF2.0 object diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_light.py b/addons/io_scene_gltf2/blender/imp/light.py similarity index 97% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_light.py rename to addons/io_scene_gltf2/blender/imp/light.py index dd1d28c1e..6f84e6764 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_light.py +++ b/addons/io_scene_gltf2/blender/imp/light.py @@ -15,9 +15,9 @@ import bpy from math import pi -from ...io.imp.gltf2_io_user_extensions import import_user_extensions -from ..com.gltf2_blender_conversion import PBR_WATTS_TO_LUMENS -from ..com.gltf2_blender_extras import set_extras +from ...io.imp.user_extensions import import_user_extensions +from ..com.conversion import PBR_WATTS_TO_LUMENS +from ..com.extras import set_extras class BlenderLight(): """Blender Light.""" diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_material.py b/addons/io_scene_gltf2/blender/imp/material.py similarity index 92% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_material.py rename to addons/io_scene_gltf2/blender/imp/material.py index 8008946f9..5f3e6e42b 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_material.py +++ b/addons/io_scene_gltf2/blender/imp/material.py @@ -14,11 +14,11 @@ import bpy -from ...io.imp.gltf2_io_user_extensions import import_user_extensions -from ..com.gltf2_blender_extras import set_extras -from .gltf2_blender_pbrMetallicRoughness import MaterialHelper, pbr_metallic_roughness -from .gltf2_blender_KHR_materials_pbrSpecularGlossiness import pbr_specular_glossiness -from .gltf2_blender_KHR_materials_unlit import unlit +from ...io.imp.user_extensions import import_user_extensions +from ..com.extras import set_extras +from .pbrMetallicRoughness import MaterialHelper, pbr_metallic_roughness +from .KHR_materials_pbrSpecularGlossiness import pbr_specular_glossiness +from .KHR_materials_unlit import unlit class BlenderMaterial(): diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_material_utils.py b/addons/io_scene_gltf2/blender/imp/material_utils.py similarity index 99% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_material_utils.py rename to addons/io_scene_gltf2/blender/imp/material_utils.py index c0941d4c9..e0a61264b 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_material_utils.py +++ b/addons/io_scene_gltf2/blender/imp/material_utils.py @@ -17,7 +17,7 @@ MaterialNormalTextureInfoClass, MaterialPBRMetallicRoughness, ) -from .gltf2_blender_texture import texture +from .texture import texture class MaterialHelper: diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py b/addons/io_scene_gltf2/blender/imp/mesh.py similarity index 98% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py rename to addons/io_scene_gltf2/blender/imp/mesh.py index 1e43a84b7..b1100d18f 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py +++ b/addons/io_scene_gltf2/blender/imp/mesh.py @@ -15,14 +15,14 @@ import bpy from mathutils import Matrix import numpy as np -from ...io.imp.gltf2_io_user_extensions import import_user_extensions +from ...io.imp.user_extensions import import_user_extensions from ...io.imp.gltf2_io_binary import BinaryData -from ...io.com.gltf2_io_constants import DataType, ComponentType -from ...blender.com.gltf2_blender_conversion import get_attribute_type -from ..com.gltf2_blender_extras import set_extras +from ...io.com.constants import DataType, ComponentType +from ...blender.com.conversion import get_attribute_type +from ..com.extras import set_extras from ..com.gltf2_blender_utils import fast_structured_np_unique -from .gltf2_blender_material import BlenderMaterial -from .gltf2_io_draco_compression_extension import decode_primitive +from .material import BlenderMaterial +from .draco_compression_extension import decode_primitive class BlenderMesh(): """Blender Mesh.""" diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py b/addons/io_scene_gltf2/blender/imp/node.py similarity index 97% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py rename to addons/io_scene_gltf2/blender/imp/node.py index 82ac62ae9..ba371adad 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py +++ b/addons/io_scene_gltf2/blender/imp/node.py @@ -14,13 +14,13 @@ import bpy from mathutils import Vector, Matrix -from ...io.imp.gltf2_io_user_extensions import import_user_extensions -from ..com.gltf2_blender_extras import set_extras -from ..com.gltf2_blender_default import BLENDER_GLTF_SPECIAL_COLLECTION -from .gltf2_blender_mesh import BlenderMesh -from .gltf2_blender_camera import BlenderCamera -from .gltf2_blender_light import BlenderLight -from .gltf2_blender_vnode import VNode +from ...io.imp.user_extensions import import_user_extensions +from ..com.extras import set_extras +from ..com.blender_default import BLENDER_GLTF_SPECIAL_COLLECTION +from .mesh import BlenderMesh +from .camera import BlenderCamera +from .light import BlenderLight +from .vnode import VNode class BlenderNode(): """Blender Node.""" diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py b/addons/io_scene_gltf2/blender/imp/pbrMetallicRoughness.py similarity index 99% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py rename to addons/io_scene_gltf2/blender/imp/pbrMetallicRoughness.py index f494235d7..e90dd8928 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_pbrMetallicRoughness.py +++ b/addons/io_scene_gltf2/blender/imp/pbrMetallicRoughness.py @@ -14,12 +14,12 @@ from re import M import bpy -from ...io.com.gltf2_io_constants import GLTF_IOR, BLENDER_COAT_ROUGHNESS +from ...io.com.constants import GLTF_IOR, BLENDER_COAT_ROUGHNESS from ...io.com.gltf2_io import TextureInfo, MaterialPBRMetallicRoughness -from ..com.gltf2_blender_material_helpers import get_gltf_node_name, create_settings_group -from .gltf2_blender_texture import texture -from .gltf2_blender_KHR_materials_anisotropy import anisotropy -from .gltf2_blender_material_utils import \ +from ..com.material_helpers import get_gltf_node_name, create_settings_group +from .texture import texture +from .KHR_materials_anisotropy import anisotropy +from .material_utils import \ MaterialHelper, scalar_factor_and_texture, color_factor_and_texture, normal_map diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_scene.py b/addons/io_scene_gltf2/blender/imp/scene.py similarity index 94% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_scene.py rename to addons/io_scene_gltf2/blender/imp/scene.py index d3755834b..f36da6b54 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_scene.py +++ b/addons/io_scene_gltf2/blender/imp/scene.py @@ -14,11 +14,11 @@ import bpy -from .gltf2_blender_node import BlenderNode -from .gltf2_blender_animation import BlenderAnimation -from .gltf2_blender_vnode import VNode, compute_vnodes -from ..com.gltf2_blender_extras import set_extras -from ...io.imp.gltf2_io_user_extensions import import_user_extensions +from .node import BlenderNode +from .animation import BlenderAnimation +from .vnode import VNode, compute_vnodes +from ..com.extras import set_extras +from ...io.imp.user_extensions import import_user_extensions class BlenderScene(): diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_texture.py b/addons/io_scene_gltf2/blender/imp/texture.py similarity index 97% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_texture.py rename to addons/io_scene_gltf2/blender/imp/texture.py index 6dfd79e1d..f51d1c265 100644 --- a/addons/io_scene_gltf2/blender/imp/gltf2_blender_texture.py +++ b/addons/io_scene_gltf2/blender/imp/texture.py @@ -14,10 +14,10 @@ import bpy from ...io.com.gltf2_io import Sampler -from ...io.com.gltf2_io_constants import TextureFilter, TextureWrap -from ...io.imp.gltf2_io_user_extensions import import_user_extensions -from ..com.gltf2_blender_conversion import texture_transform_gltf_to_blender -from .gltf2_blender_image import BlenderImage +from ...io.com.constants import TextureFilter, TextureWrap +from ...io.imp.user_extensions import import_user_extensions +from ..com.conversion import texture_transform_gltf_to_blender +from .image import BlenderImage def texture( mh, diff --git a/addons/io_scene_gltf2/blender/imp/gltf2_blender_vnode.py b/addons/io_scene_gltf2/blender/imp/vnode.py similarity index 100% rename from addons/io_scene_gltf2/blender/imp/gltf2_blender_vnode.py rename to addons/io_scene_gltf2/blender/imp/vnode.py diff --git a/addons/io_scene_gltf2/io/com/gltf2_io_constants.py b/addons/io_scene_gltf2/io/com/constants.py similarity index 100% rename from addons/io_scene_gltf2/io/com/gltf2_io_constants.py rename to addons/io_scene_gltf2/io/com/constants.py diff --git a/addons/io_scene_gltf2/io/com/gltf2_io_debug.py b/addons/io_scene_gltf2/io/com/debug.py similarity index 100% rename from addons/io_scene_gltf2/io/com/gltf2_io_debug.py rename to addons/io_scene_gltf2/io/com/debug.py diff --git a/addons/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py b/addons/io_scene_gltf2/io/com/draco.py similarity index 100% rename from addons/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py rename to addons/io_scene_gltf2/io/com/draco.py diff --git a/addons/io_scene_gltf2/io/com/gltf2_io.py b/addons/io_scene_gltf2/io/com/gltf2_io.py index 7d8747b95..92723b120 100644 --- a/addons/io_scene_gltf2/io/com/gltf2_io.py +++ b/addons/io_scene_gltf2/io/com/gltf2_io.py @@ -26,7 +26,7 @@ import sys import traceback -from ...io.com import gltf2_io_debug +from ...io.com import debug as gltf2_io_debug def from_int(x): diff --git a/addons/io_scene_gltf2/io/com/gltf2_io_lights_punctual.py b/addons/io_scene_gltf2/io/com/lights_punctual.py similarity index 100% rename from addons/io_scene_gltf2/io/com/gltf2_io_lights_punctual.py rename to addons/io_scene_gltf2/io/com/lights_punctual.py diff --git a/addons/io_scene_gltf2/io/com/gltf2_io_path.py b/addons/io_scene_gltf2/io/com/path.py similarity index 100% rename from addons/io_scene_gltf2/io/com/gltf2_io_path.py rename to addons/io_scene_gltf2/io/com/path.py diff --git a/addons/io_scene_gltf2/io/com/gltf2_io_variants.py b/addons/io_scene_gltf2/io/com/variants.py similarity index 100% rename from addons/io_scene_gltf2/io/com/gltf2_io_variants.py rename to addons/io_scene_gltf2/io/com/variants.py diff --git a/addons/io_scene_gltf2/io/exp/gltf2_io_binary_data.py b/addons/io_scene_gltf2/io/exp/binary_data.py similarity index 96% rename from addons/io_scene_gltf2/io/exp/gltf2_io_binary_data.py rename to addons/io_scene_gltf2/io/exp/binary_data.py index f8c488e3e..329cb0329 100644 --- a/addons/io_scene_gltf2/io/exp/gltf2_io_binary_data.py +++ b/addons/io_scene_gltf2/io/exp/binary_data.py @@ -14,7 +14,7 @@ import typing import array -from ...io.com import gltf2_io_constants +from ...io.com import constants as gltf2_io_constants class BinaryData: diff --git a/addons/io_scene_gltf2/io/exp/gltf2_io_buffer.py b/addons/io_scene_gltf2/io/exp/buffer.py similarity index 97% rename from addons/io_scene_gltf2/io/exp/gltf2_io_buffer.py rename to addons/io_scene_gltf2/io/exp/buffer.py index 3c1916f1b..dd7d6a27e 100644 --- a/addons/io_scene_gltf2/io/exp/gltf2_io_buffer.py +++ b/addons/io_scene_gltf2/io/exp/buffer.py @@ -15,7 +15,7 @@ import base64 from ...io.com import gltf2_io -from ...io.exp import gltf2_io_binary_data +from ...io.exp import binary_data as gltf2_io_binary_data class Buffer: diff --git a/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py b/addons/io_scene_gltf2/io/exp/draco.py similarity index 98% rename from addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py rename to addons/io_scene_gltf2/io/exp/draco.py index fd4b5aed3..f5bfa29da 100644 --- a/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py +++ b/addons/io_scene_gltf2/io/exp/draco.py @@ -15,8 +15,8 @@ from ctypes import * from pathlib import Path -from ...io.exp.gltf2_io_binary_data import BinaryData -from ...io.com.gltf2_io_draco_compression_extension import dll_path +from ...io.exp.binary_data import BinaryData +from ...io.com.draco import dll_path def encode_scene_primitives(scenes, export_settings): diff --git a/addons/io_scene_gltf2/io/exp/gltf2_io_export.py b/addons/io_scene_gltf2/io/exp/export.py similarity index 98% rename from addons/io_scene_gltf2/io/exp/gltf2_io_export.py rename to addons/io_scene_gltf2/io/exp/export.py index d39c8fc40..d39ca53fb 100644 --- a/addons/io_scene_gltf2/io/exp/gltf2_io_export.py +++ b/addons/io_scene_gltf2/io/exp/export.py @@ -18,7 +18,7 @@ import json import struct -from ...io.exp.gltf2_io_user_extensions import export_user_extensions +from ...io.exp.user_extensions import export_user_extensions # # Globals diff --git a/addons/io_scene_gltf2/io/exp/gltf2_io_image_data.py b/addons/io_scene_gltf2/io/exp/image_data.py similarity index 100% rename from addons/io_scene_gltf2/io/exp/gltf2_io_image_data.py rename to addons/io_scene_gltf2/io/exp/image_data.py diff --git a/addons/io_scene_gltf2/io/exp/gltf2_io_user_extensions.py b/addons/io_scene_gltf2/io/exp/user_extensions.py similarity index 100% rename from addons/io_scene_gltf2/io/exp/gltf2_io_user_extensions.py rename to addons/io_scene_gltf2/io/exp/user_extensions.py diff --git a/addons/io_scene_gltf2/io/imp/gltf2_io_binary.py b/addons/io_scene_gltf2/io/imp/gltf2_io_binary.py index 800614ea8..e9cd2869c 100644 --- a/addons/io_scene_gltf2/io/imp/gltf2_io_binary.py +++ b/addons/io_scene_gltf2/io/imp/gltf2_io_binary.py @@ -16,7 +16,7 @@ import numpy as np from ..com.gltf2_io import Accessor -from ..com.gltf2_io_constants import ComponentType, DataType +from ..com.constants import ComponentType, DataType class BinaryData(): diff --git a/addons/io_scene_gltf2/io/imp/gltf2_io_gltf.py b/addons/io_scene_gltf2/io/imp/gltf2_io_gltf.py index 81d494b1d..d83fe0354 100644 --- a/addons/io_scene_gltf2/io/imp/gltf2_io_gltf.py +++ b/addons/io_scene_gltf2/io/imp/gltf2_io_gltf.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ...io.com.gltf2_io_path import uri_to_path +from ...io.com.path import uri_to_path from ..com.gltf2_io import gltf_from_dict -from ..com.gltf2_io_debug import Log +from ..com.debug import Log import logging import json import struct diff --git a/addons/io_scene_gltf2/io/imp/gltf2_io_user_extensions.py b/addons/io_scene_gltf2/io/imp/user_extensions.py similarity index 100% rename from addons/io_scene_gltf2/io/imp/gltf2_io_user_extensions.py rename to addons/io_scene_gltf2/io/imp/user_extensions.py From faa2f2ab06d2dca74a6e89cb26998b1c0741433d Mon Sep 17 00:00:00 2001 From: Julien Duroure Date: Fri, 30 Aug 2024 05:56:38 +0200 Subject: [PATCH 3/3] Bump to 4.3.13 --- addons/io_scene_gltf2/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/io_scene_gltf2/__init__.py b/addons/io_scene_gltf2/__init__.py index 3bfe0b372..c895c098c 100644 --- a/addons/io_scene_gltf2/__init__.py +++ b/addons/io_scene_gltf2/__init__.py @@ -15,7 +15,7 @@ bl_info = { 'name': 'glTF 2.0 format', 'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', - "version": (4, 3, 12), + "version": (4, 3, 13), 'blender': (4, 2, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0',