Skip to content

Commit

Permalink
More Reverts
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiderguy-F committed Mar 20, 2024
1 parent 18b06c7 commit aab05c5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions addons/io_hubs_addon/components/definitions/media_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


def is_bone(ob):
return type(ob) is EditBone or type(ob) is Bone
return type(ob) == EditBone or type(ob) == Bone


class MediaFrameGizmo(Gizmo):
Expand Down Expand Up @@ -157,7 +157,7 @@ def migrate(self, migration_type, panel_type, instance_version, host, migration_
bounds = Vector((bounds.x, bounds.z, bounds.y))
self.bounds = bounds

if migration_type != MigrationType.GLOBAL or is_linked(ob) or type(ob) is bpy.types.Armature:
if migration_type != MigrationType.GLOBAL or is_linked(ob) or type(ob) == bpy.types.Armature:
host_reference = get_host_reference_message(panel_type, host, ob=ob)
migration_report.append(
f"Warning: The Media Frame component's Y and Z bounds on the {panel_type.value} {host_reference} may not have migrated correctly")
Expand Down
2 changes: 1 addition & 1 deletion addons/io_hubs_addon/components/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def migrate(component, migration_type, panel_type, host, migration_report, ob=No
was_migrated = component.migrate(
migration_type, panel_type, instance_version, host, migration_report, ob=ob)

if type(was_migrated) is not bool:
if type(was_migrated) != bool:
print(f"Warning: the {component.get_display_name()} component didn't return whether a migration occurred.")
# Fall back to assuming there was a migration since the version increased.
was_migrated = True
Expand Down
2 changes: 1 addition & 1 deletion addons/io_hubs_addon/components/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def display_wrapped_text(layout, wrapped_text, *, heading_icon='NONE'):
def get_host_reference_message(panel_type, host, ob=None):
'''The ob argument is used for bone hosts and is the armature object, but will fall back to the armature if the armature object isn't available.'''
if panel_type == PanelType.BONE:
ob_type = "armature" if type(ob) is bpy.types.Armature else "object"
ob_type = "armature" if type(ob) == bpy.types.Armature else "object"
host_reference = f"\"{host.name}\" in {ob_type} \"{ob.name_full}\""
else:
host_reference = f"\"{host.name_full}\""
Expand Down
13 changes: 6 additions & 7 deletions addons/io_hubs_addon/io/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ def gather_image(blender_image, export_settings):
mime_type = "image/png"
else:
mime_type = "image/jpeg"
d1 = HubsExportImage.from_blender_image(blender_image)
data = d1.encode(mime_type, export_settings)
if type(data) is tuple:
data = HubsExportImage.from_blender_image(blender_image).encode(mime_type, export_settings)
if type(data) == tuple:
data = data[0]

if export_settings['gltf_format'] == 'GLTF_SEPARATE':
Expand Down Expand Up @@ -157,13 +156,13 @@ def gather_property(export_settings, blender_object, target, property_name):
return gather_vec_property(export_settings, blender_object, target, property_name)

elif (property_definition.bl_rna.identifier == 'PointerProperty'):
if type(property_value) is bpy.types.Object:
if type(property_value) == bpy.types.Object:
return gather_node_property(export_settings, blender_object, target, property_name)
elif type(property_value) is bpy.types.Material:
elif type(property_value) == bpy.types.Material:
return gather_material_property(export_settings, blender_object, target, property_name)
elif type(property_value) is bpy.types.Image:
elif type(property_value) == bpy.types.Image:
return gather_image_property(export_settings, blender_object, target, property_name)
elif type(property_value) is bpy.types.Texture:
elif type(property_value) == bpy.types.Texture:
return gather_texture_property(export_settings, blender_object, target, property_name)

return gltf2_blender_extras.__to_json_compatible(property_value)
Expand Down

0 comments on commit aab05c5

Please sign in to comment.