浏览代码

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


正在加载...
取消
保存