Selaa lähdekoodia

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

master
Fen Dweller 3 vuotta sitten
vanhempi
commit
8cbc6e07d9
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. +2
    -1
      scripts/blender/addons/macrovision/ops.py

+ 2
- 1
scripts/blender/addons/macrovision/ops.py Näytä tiedosto

@@ -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…
Peruuta
Tallenna