瀏覽代碼

Use the name of the .zip, not the .obj, for models

master
Fen Dweller 3 年之前
父節點
當前提交
8cbc6e07d9
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. +2
    -1
      scripts/blender/addons/macrovision/ops.py

+ 2
- 1
scripts/blender/addons/macrovision/ops.py 查看文件

@@ -497,12 +497,13 @@ class MVImportObj(bpy.types.Operator, ImportHelper):
glob_pattern = dir.joinpath("*.zip").__str__()
for file in glob.glob(glob_pattern):
zip = zipfile.ZipFile(file)
name = pathlib.Path(file).with_suffix("").name

tmpdir = pathlib.Path(tempfile.mkdtemp())
zip.extractall(tmpdir.__str__())
obj_glob_pattern = tmpdir.joinpath("*.obj").__str__()
obj = glob.glob(obj_glob_pattern)[0]
obj_path = pathlib.Path(obj)
name = obj_path.with_suffix("").name
if name in bpy.data.collections:
continue


Loading…
取消
儲存