diff --git a/.idea/abmatt.iml b/.idea/abmatt.iml
index 0931036..038e1f3 100644
--- a/.idea/abmatt.iml
+++ b/.idea/abmatt.iml
@@ -2,10 +2,10 @@
-
+
-
+
@@ -13,6 +13,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index 36d7e28..0000000
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 4bc962a..3b43af0 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/pytest_in_tests.xml b/.idea/runConfigurations/pytest_in_tests.xml
index 385775f..7ed1ac0 100644
--- a/.idea/runConfigurations/pytest_in_tests.xml
+++ b/.idea/runConfigurations/pytest_in_tests.xml
@@ -3,15 +3,15 @@
-
-
-
+
+
+
-
+
diff --git a/abmatt/build/config.txt b/abmatt/build/config.txt
index 07f79d1..250dfe0 100644
--- a/abmatt/build/config.txt
+++ b/abmatt/build/config.txt
@@ -1,5 +1,5 @@
build_name = main # build output name
build_type = onedir # the type of build, (auto|onefile|onedir)
-version = 1.3.0
+version = 1.3.1
run_integration_tests = False
run_unit_tests = False
diff --git a/abmatt/converters/dae.py b/abmatt/converters/dae.py
index d717c36..7d14331 100644
--- a/abmatt/converters/dae.py
+++ b/abmatt/converters/dae.py
@@ -354,14 +354,14 @@ def decode_geometries(self, xml_geometry, mat_names=None):
geo_name = geo_name[:len(replace) * -1]
geo_count = 0
for tri_node in mesh.iter('triangles'):
- if not mat_names:
- material_name = tri_node.attrib.get('material')
- if not material_name:
+ material_name = tri_node.attrib.get('material')
+ if not material_name:
+ if not mat_names:
for attrib in xml_geometry.attrib:
material_name = xml_geometry.attrib[attrib] + '-mat'
break
- else:
- material_name = mat_names[geo_count]
+ else:
+ material_name = mat_names[geo_count]
inputs = []
stride = 0
uniqueOffsets = []
@@ -597,7 +597,7 @@ def __initialize_libraries(self, initial_name):
def __initialize_assets(self, root):
asset = XMLNode('asset', parent=root)
contributor = XMLNode('contributor', parent=asset)
- authoring_tool = XMLNode('authoring_tool', 'ABMATT COLLADA exporter v1.3.0', parent=contributor)
+ authoring_tool = XMLNode('authoring_tool', 'ABMATT COLLADA exporter v1.3.1', parent=contributor)
time_stamp = datetime.now()
created = XMLNode('created', str(time_stamp), parent=asset)
modified = XMLNode('modified', str(time_stamp), parent=asset)
diff --git a/abmatt/converters/obj.py b/abmatt/converters/obj.py
index bd26721..9fc1060 100644
--- a/abmatt/converters/obj.py
+++ b/abmatt/converters/obj.py
@@ -143,7 +143,7 @@ def save(self):
self.save_obj()
def save_mtllib(self, folder):
- s = '# Wavefront MTL exported with ABMATT v1.3.0'
+ s = '# Wavefront MTL exported with ABMATT v1.3.1'
materials = self.materials
for x in materials:
s += '\n' + materials[x].get_save_str()
@@ -151,7 +151,7 @@ def save_mtllib(self, folder):
f.write(s)
def save_obj(self):
- s = '# Wavefront OBJ exported with ABMATT v1.3.0\n\nmtllib ' + self.mtllib + '\n\n'
+ s = '# Wavefront OBJ exported with ABMATT v1.3.1\n\nmtllib ' + self.mtllib + '\n\n'
vertex_index = 1
normal_index = 1
normal_offset = -1
diff --git a/abmatt/dist/install-ubu.txt b/abmatt/dist/install-ubu.txt
index 667b4eb..be7a796 100644
--- a/abmatt/dist/install-ubu.txt
+++ b/abmatt/dist/install-ubu.txt
@@ -1,6 +1,6 @@
====================================================================================
ANOOB'S BRRES MATERIAL TOOL
-Version: 1.3.0
+Version: 1.3.1
Author: Robert Nelson
OS: linux
Github: https://github.com/Robert-N7/abmatt
diff --git a/abmatt/dist/install-win.txt b/abmatt/dist/install-win.txt
index 7ac4e1b..ad6a24d 100644
--- a/abmatt/dist/install-win.txt
+++ b/abmatt/dist/install-win.txt
@@ -1,6 +1,6 @@
===================================================================================================
ANOOB'S BRRES MATERIAL TOOL
-Version 1.3.0
+Version 1.3.1
Robert Nelson
OS: Windows 10 64-bit
Github: https://github.com/Robert-N7/abmatt
diff --git a/abmatt/dist/make_installer.nsi b/abmatt/dist/make_installer.nsi
index 1ff7052..ae82163 100644
--- a/abmatt/dist/make_installer.nsi
+++ b/abmatt/dist/make_installer.nsi
@@ -1,4 +1,4 @@
-!define VERSION "1.3.0"
+!define VERSION "1.3.1"
!define PROGRAM_NAME "ANoob's Brres Material Tool ${VERSION}"
InstallDir "$Documents\abmatt"
Name "${PROGRAM_NAME}"
diff --git a/abmatt/load_config.py b/abmatt/load_config.py
index c3a8204..33a9d1f 100644
--- a/abmatt/load_config.py
+++ b/abmatt/load_config.py
@@ -117,7 +117,7 @@ def load_config(app_dir=None, loudness=None, autofix_level=None):
return conf
-VERSION = '1.3.0'
+VERSION = '1.3.1'
USAGE = "USAGE: abmatt [command_line][--interactive -f -b -d --overwrite]"
diff --git a/requirements.txt b/requirements.txt
index c06ad80..cb6d942 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,7 +6,7 @@ fuzzywuzzy~=0.18.0
python-levenshtein~=0.12.0
pycollada~=0.7.1
numpy~=1.19.5
-pillow~=8.2.0
+pillow~=8.3.2
pyinstaller~=4.0
ifilter~=0.2
diff --git a/setup.py b/setup.py
index 7c4f652..322351a 100755
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@
# calling the setup function
setup(name='abmatt',
- version='1.3.0',
+ version='1.3.1',
entry_points={
'console_scripts': [
'abmatt = abmatt.__main__:main'
diff --git a/test_files/blender-unused-mat.dae b/test_files/blender-unused-mat.dae
new file mode 100644
index 0000000..713e839
--- /dev/null
+++ b/test_files/blender-unused-mat.dae
@@ -0,0 +1,207 @@
+
+
+
+ Blender User
+ Blender 2.93.1 commit date:2021-06-22, commit time:05:57, hash:1b8d33b18c2f
+
+ 2021-08-16T16:17:29
+ 2021-08-16T16:17:29
+
+ Z_UP
+
+
+
+
+
+ 1 1 1
+
+
+
+
+ 1
+ 0
+ 1
+ 1
+ 1
+ 1
+ 1
+ 0
+ 0
+ 0
+ 1
+ 12.5
+ 45
+ 0.15
+ 0
+ 1
+ 2
+ 0.04999995
+ 40
+ 1
+ 3
+ 512
+ 3
+ 1
+ 0
+ 0.125
+ 0.125
+ 0.125
+
+
+
+
+
+
+
+
+
+ ct_hwall02_color02_alb_png
+
+
+
+
+ ct_hwall02_color02_alb_png-surface
+
+
+
+
+
+ 0 0 0 1
+
+
+
+
+
+ 1.5
+
+
+
+
+
+
+
+
+
+ ct_road03_alb_png
+
+
+
+
+ ct_road03_alb_png-surface
+
+
+
+
+
+ 0 0 0 1
+
+
+
+
+
+ 1.5
+
+
+
+
+
+
+
+
+ ct_hwall02_color02_alb.png
+
+
+ ct_road03_alb.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -1122.358 -593.0255 1894.748 -1094.68 -593.0255 1542.113 -1413.46 -593.0255 1493.876 -1444.759 -593.0254 1892.65
+
+
+
+
+
+
+
+
+
+ 1.79282e-7 1 -1.32648e-7 3.80426e-7 1 -2.42943e-7 2.16824e-7 1 -1.53234e-7 0 1 0
+
+
+
+
+
+
+
+
+
+ 0 13.9074 0.9953 13.9214 0.938 10.0083 0 13.9074 0.938 10.0083 0.06199997 9.9935
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2 0 0 3 1 1 0 2 2 2 0 3 0 2 4 1 3 5
+
+
+
+
+
+
+
+ 0.02423656 0 0 0 0 -1.05941e-9 -0.02423656 0 0 0.02423656 -1.05941e-9 20 0 0 0 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.1525574 0.5484338 0 -5.540346 -0.5484338 0.1525574 0 -3.175668 0 0 0.5692569 101.7593 0 0 0 1
+
+
+ 0.1525574 0.5484338 0 -2.70586 -0.5484338 0.1525574 0 -2.387201 0 0 0.5692569 101.7593 0 0 0 1
+
+
+ 1 0 0 -52.28759 0 1 0 -39.57203 0 0 1 5.693993 0 0 0 1
+
+
+ 10 0 0 -30.46458 0 10 0 -41.27719 0 0 10 6.149744 0 0 0 1
+
+
+ 7.477443 8.92125e-7 -6.639868 0.008330668 -8.92125e-7 10 3.38928e-7 -0.01009264 6.639868 3.38928e-7 7.477443 3.991563 0 0 0 1
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/converters/dae.py b/tests/converters/dae.py
new file mode 100644
index 0000000..f7a83a0
--- /dev/null
+++ b/tests/converters/dae.py
@@ -0,0 +1,11 @@
+from converters.dae import Dae
+from tests.lib import AbmattTest
+
+
+class DaeConverterTest(AbmattTest):
+ def test_blender_unused_mat_loads_correct_material(self):
+ dae = Dae(self._get_test_fname('blender-unused-mat.dae'))
+ for node in dae.get_scene():
+ if node.geometries:
+ for geometry in node.geometries:
+ self.assertEqual('Material__454-material', geometry.material_name)
\ No newline at end of file