Skip to content

Commit

Permalink
Fix duplicate materials for every frame when importing a second vehic…
Browse files Browse the repository at this point in the history
…le. Hide render for sequence collection. Increment version.
  • Loading branch information
oli-caon committed Sep 19, 2024
1 parent 7fb4857 commit b8312f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def execute(self, context):

sequence_collection = bpy.data.collections.new(name=f"{name} sequence")
scene.collection.children.link(sequence_collection)
sequence_collection.hide_render = True

prior_materials = set(bpy.data.materials.values())
keep_materials = set()
Expand Down Expand Up @@ -162,7 +163,8 @@ def execute(self, context):
m_new: m_og
for m_new in new_materials
for m_og in keep_materials
if os.path.splitext(m_new.name)[0] == m_og.name
if os.path.splitext(m_new.name)[0] == os.path.splitext(m_og.name)[0]
# compare material names without duplicate suffix
}
image_dupes = {
i_new: i_og
Expand Down
2 changes: 1 addition & 1 deletion blender_manifest.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
schema_version = "1.0.0"

id = "beamng_gltf_sequence_importer"
version = "0.1.0"
version = "0.1.1"
name = "BeamNG glTF Sequence Importer"
tagline = "Imports glTF sequences that were exported from BeamNG"
maintainer = "Oli Caon <oli.caon@gmail.com>"
Expand Down

0 comments on commit b8312f7

Please sign in to comment.