소스 검색

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


불러오는 중...
취소
저장