Browse Source

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

master
Fen Dweller 3 years ago
parent
commit
8cbc6e07d9
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      scripts/blender/addons/macrovision/ops.py

+ 2
- 1
scripts/blender/addons/macrovision/ops.py View File

@@ -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…
Cancel
Save