Cleanup: trailing space

This commit is contained in:
Campbell Barton 2022-03-10 13:19:55 +11:00
parent 1cf57247c7
commit b12dd385eb
8 changed files with 12 additions and 13 deletions

View File

@ -179,7 +179,7 @@ def gather_animation_channels(obj_uuid: int,
blender_action.name,
None,
False #If Object is not animated, don't keep animation for this channel
)
)
if channel is not None:
channels.append(channel)

View File

@ -138,7 +138,7 @@ def get_object_matrix(blender_obj_uuid: str,
data = {}
# TODO : bake_range_start & bake_range_end are no more needed here
# Because we bake, we don't know exactly the frame range,
# Because we bake, we don't know exactly the frame range,
# So using min / max of all actions
start_frame = min([v[0] for v in [a.frame_range for a in bpy.data.actions]])
@ -168,7 +168,7 @@ def get_object_matrix(blender_obj_uuid: str,
((1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, -1.0, 0.0, 0.0), (0.0, 0.0, 0.0, 1.0)))
parent_mat = armature_object.matrix_world @ blender_bone.matrix @ axis_basis_change
#For object inside collection (at root), matrix world is already expressed regarding collection parent
if export_settings['vtree'].nodes[obj_uuid].parent_uuid is not None and export_settings['vtree'].nodes[export_settings['vtree'].nodes[obj_uuid].parent_uuid].blender_type == VExportNode.COLLECTION:
parent_mat = mathutils.Matrix.Identity(4).freeze()
@ -177,7 +177,7 @@ def get_object_matrix(blender_obj_uuid: str,
if obj_uuid not in data.keys():
data[obj_uuid] = {}
if blender_obj.animation_data and blender_obj.animation_data.action:
if blender_obj.animation_data.action.name not in data[obj_uuid].keys():
data[obj_uuid][blender_obj.animation_data.action.name] = {}

View File

@ -34,11 +34,11 @@ def __gather_channels_baked(obj_uuid, export_settings):
obj_uuid, # Use obj uuid as action name for caching
None,
False #If Object is not animated, don't keep animation for this channel
)
)
if channel is not None:
channels.append(channel)
return channels if len(channels) > 0 else None
return channels if len(channels) > 0 else None
def gather_animations( obj_uuid: int,
tracks: typing.Dict[str, typing.List[int]],
@ -61,7 +61,7 @@ def gather_animations( obj_uuid: int,
if len([a for a in blender_actions if a[2] == "OBJECT"]) == 0:
# No TRS animation are found for this object.
# But we need to bake, in case we export selection
if export_settings['gltf_selected'] is True and blender_object.type != "ARMATURE":
if export_settings['gltf_selected'] is True and blender_object.type != "ARMATURE":
channels = __gather_channels_baked(obj_uuid, export_settings)
if channels is not None:
animation = gltf2_io.Animation(

View File

@ -56,7 +56,7 @@ def gather_material(blender_material, export_settings):
)
# If emissive is set, from an emissive node (not PBR)
# We need to set manually default values for
# We need to set manually default values for
# pbr_metallic_roughness.baseColor
if material.emissive_factor is not None and gltf2_blender_get.get_node_socket(blender_material, bpy.types.ShaderNodeBsdfPrincipled, "Base Color") is None:
material.pbr_metallic_roughness = gltf2_blender_gather_materials_pbr_metallic_roughness.get_default_pbr_for_emissive_node()

View File

@ -365,11 +365,10 @@ class VExportTree:
return False
return True
def search_missing_armature(self):
for n in [n for n in self.nodes.values() if hasattr(n, "armature_needed") is True]:
candidates = [i for i in self.nodes.values() if i.blender_type == VExportNode.ARMATURE and i.blender_object.name == n.armature_needed]
if len(candidates) > 0:
n.armature = candidates[0].uuid
del n.armature_needed

View File

@ -72,7 +72,7 @@ def get_socket(blender_material: bpy.types.Material, name: str):
name = "Color"
else:
type = bpy.types.ShaderNodeBsdfPrincipled
return get_node_socket(blender_material, type, name)
return None

View File

@ -69,7 +69,7 @@ def ami_args_as_data(ami):
def ami_data_from_args(ami, args):
ami.type = args["type"]
for path in args["user_paths"]:
ami.user_paths.new(path)

View File

@ -93,7 +93,7 @@ def vr_defaults_action_add(am,
ami = am.actionmap_items.new(name, True)
if ami:
ami.type = 'FLOAT'
ami.type = 'FLOAT'
for path in user_paths:
ami.user_paths.new(path)
ami.op = op