diff --git a/leenkx/blender/lnx/props_traits.py b/leenkx/blender/lnx/props_traits.py index 809608e..5db9309 100644 --- a/leenkx/blender/lnx/props_traits.py +++ b/leenkx/blender/lnx/props_traits.py @@ -516,7 +516,10 @@ class LeenkxGenerateNavmeshButton(bpy.types.Operator): proc = subprocess.Popen(args, cwd=nav_full_path) proc.wait() - navmesh = bpy.ops.import_scene.obj(filepath=mesh_path) + if bpy.app.version[0] >= 4: + navmesh = bpy.ops.wm.obj_import(filepath=mesh_path) + else: + navmesh = bpy.ops.import_scene.obj(filepath=mesh_path) navmesh = bpy.context.selected_objects[0] # NavMesh preview settings, cleanup