Skip to content

Commit

Permalink
use object for < 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarcontar committed Jan 27, 2024
1 parent ee93475 commit ac750d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions tests/common/cases/utils/test_mesh_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,12 @@ def test_mesh_export_invalid_surface_types(self):
m = get_mesh('mesh')
create_mesh(self, m, get_collection())

mesh = bpy.data.meshes['mesh']
mesh.face_maps.clear()
if bpy.app.version < (4, 0, 0):
mesh = bpy.data.objects['mesh']
mesh.face_maps.clear()
else:
mesh = bpy.data.meshes['mesh']
mesh.face_maps.clear()

if bpy.app.version < (4, 0, 0):
mesh.face_maps.new(name='InvalidSurfaceType')
Expand Down
5 changes: 4 additions & 1 deletion tests/common/cases/utils/test_mesh_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ def test_mesh_import_invalid_surface_types(self):
create_mesh(self, mesh_struct, bpy.context.scene.collection)
report_func.assert_any_call('triangle 0 has an invalid surface type \'255\'')

mesh = bpy.data.meshes[mesh_name]
if bpy.app.version < (4, 0, 0):
mesh = bpy.data.objects[mesh_name]
else:
mesh = bpy.data.meshes[mesh_name]

self.assertEqual(1, len(mesh.face_maps))
self.assertEqual('Default', mesh.face_maps[0].name)
Expand Down

0 comments on commit ac750d4

Please sign in to comment.