diff --git a/scripts/addons_core/io_scene_gltf2/__init__.py b/scripts/addons_core/io_scene_gltf2/__init__.py index d4d2f835ea1..e6a002fbbc1 100755 --- a/scripts/addons_core/io_scene_gltf2/__init__.py +++ b/scripts/addons_core/io_scene_gltf2/__init__.py @@ -1721,8 +1721,8 @@ def export_panel_gltfpack(layout, operator): col.prop(operator, 'export_gltfpack_vc') col = body.column(heading="Vertex positions", align=True) col.prop(operator, 'export_gltfpack_vpi') - #col = body.column(heading = "Animations", align = True) - #col = body.column(heading = "Scene", align = True) + # col = body.column(heading = "Animations", align = True) + # col = body.column(heading = "Scene", align = True) col = body.column(heading="Miscellaneous", align=True) col.prop(operator, 'export_gltfpack_noq') diff --git a/scripts/addons_core/io_scene_gltf2/blender/exp/animation/action.py b/scripts/addons_core/io_scene_gltf2/blender/exp/animation/action.py index 069296c9415..849155296ea 100644 --- a/scripts/addons_core/io_scene_gltf2/blender/exp/animation/action.py +++ b/scripts/addons_core/io_scene_gltf2/blender/exp/animation/action.py @@ -55,7 +55,7 @@ def gather_actions_animations(export_settings): # Fake an animation with all animations of the scene merged_tracks = {} merged_tracks_name = 'Animation' - if(len(export_settings['gltf_nla_strips_merged_animation_name']) > 0): + if (len(export_settings['gltf_nla_strips_merged_animation_name']) > 0): merged_tracks_name = export_settings['gltf_nla_strips_merged_animation_name'] merged_tracks[merged_tracks_name] = [] for idx, animation in enumerate(animations): @@ -490,7 +490,7 @@ def gather_action_animations(obj_uuid: int, and export_settings['gltf_morph_anim'] \ and blender_object.type == "MESH" \ and blender_object.data is not None \ - and blender_object.data.shape_keys is not None: + and blender_object.data.shape_keys is not None: if export_settings['gltf_bake_animation'] is True and export_settings['gltf_force_sampling'] is True: # We need to check that this mesh is not driven by armature parent # In that case, no need to bake, because animation is already baked by driven sk armature diff --git a/scripts/addons_core/io_scene_gltf2/blender/exp/material/materials.py b/scripts/addons_core/io_scene_gltf2/blender/exp/material/materials.py index c6ada823edf..7bcd945cdc6 100644 --- a/scripts/addons_core/io_scene_gltf2/blender/exp/material/materials.py +++ b/scripts/addons_core/io_scene_gltf2/blender/exp/material/materials.py @@ -69,7 +69,7 @@ def gather_material(blender_material, export_settings): nodes = [] for node in nodes: if node[0].get("used", None) is not None: - del(node[0]['used']) + del (node[0]['used']) mat_unlit, uvmap_info, vc_info, udim_info = __export_unlit(blender_material, export_settings) if mat_unlit is not None: @@ -128,7 +128,7 @@ def gather_material(blender_material, export_settings): cpt_additional = 0 for node in nodes: if node[0].get("used", None) is not None: - del(node[0]['used']) + del (node[0]['used']) continue s = NodeSocket(node[0].outputs[0], node[1]) @@ -150,7 +150,7 @@ def gather_material(blender_material, export_settings): nodes = [] for node in nodes: if node[0].get("used", None) is not None: - del(node[0]['used']) + del (node[0]['used']) uvmap_infos.update(uvmap_info_emissive) uvmap_infos.update(uvmap_info_extensions) diff --git a/scripts/addons_core/io_scene_gltf2/blender/exp/material/search_node_tree.py b/scripts/addons_core/io_scene_gltf2/blender/exp/material/search_node_tree.py index eeb57b207b4..f2449c56f3b 100644 --- a/scripts/addons_core/io_scene_gltf2/blender/exp/material/search_node_tree.py +++ b/scripts/addons_core/io_scene_gltf2/blender/exp/material/search_node_tree.py @@ -734,8 +734,8 @@ def get_socket(blender_material_nodetree, use_nodes: bool, name: str, volume=Fal :return: a blender NodeSocket """ if blender_material_nodetree and use_nodes: - #i = [input for input in blender_material.node_tree.inputs] - #o = [output for output in blender_material.node_tree.outputs] + # i = [input for input in blender_material.node_tree.inputs] + # o = [output for output in blender_material.node_tree.outputs] if name == "Emissive": # Check for a dedicated Emission node first, it must supersede the newer built-in one # because the newer one is always present in all Principled BSDF materials. @@ -854,11 +854,11 @@ def get_texture_transform_from_mapping_node(mapping_node, export_settings): texture_transform = texture_transform_blender_to_gltf(mapping_transform) if all([component == 0 for component in texture_transform["offset"]]): - del(texture_transform["offset"]) + del (texture_transform["offset"]) if all([component == 1 for component in texture_transform["scale"]]): - del(texture_transform["scale"]) + del (texture_transform["scale"]) if texture_transform["rotation"] == 0: - del(texture_transform["rotation"]) + del (texture_transform["rotation"]) # glTF Offset needs: offset, rotation, scale (note that Offset is not used for Vector mapping) # glTF Rotation needs: rotation @@ -869,22 +869,22 @@ def get_texture_transform_from_mapping_node(mapping_node, export_settings): path_['length'] = 2 path_['path'] = "/materials/XXX/YYY/KHR_texture_transform/offset" path_['vector_type'] = mapping_node.node.vector_type - export_settings['current_texture_transform']["node_tree." + \ - mapping_node.node.inputs['Location'].path_from_id() + ".default_value"] = path_ + export_settings['current_texture_transform']["node_tree." + + mapping_node.node.inputs['Location'].path_from_id() + ".default_value"] = path_ path_ = {} path_['length'] = 2 path_['path'] = "/materials/XXX/YYY/KHR_texture_transform/scale" path_['vector_type'] = mapping_node.node.vector_type - export_settings['current_texture_transform']["node_tree." + \ - mapping_node.node.inputs['Scale'].path_from_id() + ".default_value"] = path_ + export_settings['current_texture_transform']["node_tree." + + mapping_node.node.inputs['Scale'].path_from_id() + ".default_value"] = path_ path_ = {} path_['length'] = 1 path_['path'] = "/materials/XXX/YYY/KHR_texture_transform/rotation" path_['vector_type'] = mapping_node.node.vector_type - export_settings['current_texture_transform']["node_tree." + \ - mapping_node.node.inputs['Rotation'].path_from_id() + ".default_value[2]"] = path_ + export_settings['current_texture_transform']["node_tree." + + mapping_node.node.inputs['Rotation'].path_from_id() + ".default_value[2]"] = path_ return texture_transform diff --git a/scripts/addons_core/io_scene_gltf2/blender/imp/animation_node.py b/scripts/addons_core/io_scene_gltf2/blender/imp/animation_node.py index 75049f3620a..ce143d64d27 100644 --- a/scripts/addons_core/io_scene_gltf2/blender/imp/animation_node.py +++ b/scripts/addons_core/io_scene_gltf2/blender/imp/animation_node.py @@ -39,7 +39,7 @@ class BlenderNodeAnim(): if channel.target.path == "pointer": pointer_tab = channel.target.extensions["KHR_animation_pointer"]["pointer"].split("/") - if not( + if not ( len(pointer_tab) >= 4 and pointer_tab[1] == "nodes" and pointer_tab[3] in [ "translation", "rotation", diff --git a/scripts/addons_core/io_scene_gltf2/blender/imp/blender_gltf.py b/scripts/addons_core/io_scene_gltf2/blender/imp/blender_gltf.py index 8f6ba70016e..ec1bb24bbf8 100644 --- a/scripts/addons_core/io_scene_gltf2/blender/imp/blender_gltf.py +++ b/scripts/addons_core/io_scene_gltf2/blender/imp/blender_gltf.py @@ -312,7 +312,7 @@ class BlenderGlTF(): pointer_tab = channel.target.extensions["KHR_animation_pointer"]["pointer"].split("/") - ### Nodes and Meshes + # Nodes and Meshes if len(pointer_tab) >= 4 and pointer_tab[1] == "nodes" and pointer_tab[3] in [ "translation", "rotation", "scale", "weights"]: if anim_idx not in gltf.data.nodes[int(pointer_tab[2])].animations.keys():