Fix: ensure loaded path is folder and not file #104812

Closed
Daniel Grauer wants to merge 4 commits from DanielGrauer:fix-error-when-file-is-selected into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit 1b985c5ed7 - Show all commits

View File

@ -13,7 +13,6 @@
#---------------------------------------------# #---------------------------------------------#
import bpy import bpy
import os import os
from bpy.props import *
# addon description # addon description
bl_info = { bl_info = {
@ -145,16 +144,14 @@ classes = (
def register(): def register():
from bpy.utils import register_class
for cls in classes: for cls in classes:
register_class(cls) bpy.utils.register_class(cls)
bpy.types.TOPBAR_MT_file_import.append(menu_func) bpy.types.TOPBAR_MT_file_import.append(menu_func)
def unregister(): def unregister():
from bpy.utils import unregister_class
for cls in reversed(classes): for cls in reversed(classes):
unregister_class(cls) bpy.utils.unregister_class(cls)
bpy.types.TOPBAR_MT_file_import.remove(menu_func) bpy.types.TOPBAR_MT_file_import.remove(menu_func)