Browse Source

Merge pull request #215 from TikiBear/patch-2

Fix bugs caused by using Decimate modifier
pull/218/head
Adam Johnson 4 years ago committed by GitHub
parent
commit
36b798c253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      korman/exporter/mesh.py

5
korman/exporter/mesh.py

@ -174,11 +174,12 @@ class _MeshManager:
trash_mesh, bo.data = bo.data, data_meshes.get(override["mesh"]) trash_mesh, bo.data = bo.data, data_meshes.get(override["mesh"])
data_meshes.remove(trash_mesh) data_meshes.remove(trash_mesh)
# If modifiers were removed, reapply them now. # If modifiers were removed, reapply them now unless they're read-only.
readonly_attributes = {("DECIMATE", "face_count"),}
for cached_mod in override["modifiers"]: for cached_mod in override["modifiers"]:
mod = bo.modifiers.new(cached_mod["name"], cached_mod["type"]) mod = bo.modifiers.new(cached_mod["name"], cached_mod["type"])
for key, value in cached_mod.items(): for key, value in cached_mod.items():
if key in {"name", "type"}: if key in {"name", "type"} or (cached_mod["type"], key) in readonly_attributes:
continue continue
setattr(mod, key, value) setattr(mod, key, value)

Loading…
Cancel
Save