mirror of
https://github.com/godotengine/collada-exporter.git
synced 2026-01-01 01:48:22 +03:00
Merge pull request #22 from paper-pauper/empty-fix
Fixed empty nodes validation issue
This commit is contained in:
@@ -159,6 +159,13 @@ class DaeExporter:
|
||||
line = "{}{}".format(indent * "\t", text)
|
||||
self.sections[section].append(line)
|
||||
|
||||
def purge_empty_nodes(self):
|
||||
sections = {}
|
||||
for k, v in self.sections.items():
|
||||
if not (len(v) == 2 and v[0][1:] == v[1][2:]):
|
||||
sections[k] = v
|
||||
self.sections = sections
|
||||
|
||||
def export_image(self, image):
|
||||
img_id = self.image_cache.get(image)
|
||||
if img_id:
|
||||
@@ -1961,6 +1968,8 @@ class DaeExporter:
|
||||
self.writel(S_MATS, 0, "</library_materials>")
|
||||
self.writel(S_FX, 0, "</library_effects>")
|
||||
|
||||
self.purge_empty_nodes()
|
||||
|
||||
if (self.config["use_anim"]):
|
||||
self.export_animations()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user