Skip to content

Commit

Permalink
Cleanup: trailing space
Browse files Browse the repository at this point in the history
  • Loading branch information
ideasman42 committed Mar 10, 2022
1 parent 1cf5724 commit b12dd38
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]])
Expand Down Expand Up @@ -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()
Expand All @@ -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] = {}
Expand Down
6 changes: 3 additions & 3 deletions io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]],
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 1 addition & 2 deletions io_scene_gltf2/blender/exp/gltf2_blender_gather_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,10 @@ def node_filter_inheritable_is_kept(self, uuid):
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

2 changes: 1 addition & 1 deletion io_scene_gltf2/blender/exp/gltf2_blender_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion viewport_vr_preview/action_map_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion viewport_vr_preview/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b12dd38

Please sign in to comment.