Skip to content

Commit

Permalink
Merge pull request #65 from Robert-N7/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Robert-N7 authored Jun 15, 2021
2 parents 927fceb + c72944d commit e5664d5
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion abmatt/build/config.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build_name = main # build output name
build_type = onedir # the type of build, (auto|onefile|onedir)
version = 1.1.0
version = 1.2.0
run_integration_tests = False
run_unit_tests = False
3 changes: 0 additions & 3 deletions abmatt/converters/convert_dae.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ def __add_bone(self, node, parent_bone=None, matrix=None):
return bone

def __add_geometry(self, geometry, material_geometry_map):
replace = 'Mesh'
if geometry.name.endswith(replace) and len(replace) < len(geometry.name):
geometry.name = geometry.name[:len(replace) * -1]
if not self._should_include_geometry(geometry):
return
geo = material_geometry_map.get(geometry.material_name)
Expand Down
3 changes: 3 additions & 0 deletions abmatt/converters/convert_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from abmatt.autofix import AutoFix
from abmatt.brres import Brres
from abmatt.converters.error import ConvertError
from abmatt.brres.lib.matching import fuzzy_match
from abmatt.brres.material_library import MaterialLibrary
from abmatt.brres.mdl0.material import material
Expand Down Expand Up @@ -113,6 +114,8 @@ def _start_loading(self, model_name):
return self._init_mdl0(brres_name, os.path.splitext(name)[0], model_name)

def _before_encoding(self):
if not self.geometries:
raise ConvertError('No geometries found to encode!')
if self.patch_existing:
replace_names = [x.name for x in self.geometries]
for poly in [x for x in self.replacement_model.objects if x.name in replace_names]:
Expand Down
5 changes: 4 additions & 1 deletion abmatt/converters/dae.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ def decode_geometries(self, xml_geometry, mat_names=None):
geo_name = xml_geometry.attrib.get('name')
if not geo_name:
geo_name = get_id(xml_geometry)
replace = 'Mesh'
if geo_name.endswith(replace) and len(replace) < len(geo_name):
geo_name = geo_name[:len(replace) * -1]
geo_count = 0
for tri_node in mesh.iter('triangles'):
if not mat_names:
Expand Down Expand Up @@ -594,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.1.0', parent=contributor)
authoring_tool = XMLNode('authoring_tool', 'ABMATT COLLADA exporter v1.2.0', parent=contributor)
time_stamp = datetime.now()
created = XMLNode('created', str(time_stamp), parent=asset)
modified = XMLNode('modified', str(time_stamp), parent=asset)
Expand Down
4 changes: 2 additions & 2 deletions abmatt/converters/obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ def save(self):
self.save_obj()

def save_mtllib(self, folder):
s = '# Wavefront MTL exported with ABMATT v1.1.0'
s = '# Wavefront MTL exported with ABMATT v1.2.0'
materials = self.materials
for x in materials:
s += '\n' + materials[x].get_save_str()
with open(os.path.join(folder, self.mtllib), 'w') as f:
f.write(s)

def save_obj(self):
s = '# Wavefront OBJ exported with ABMATT v1.1.0\n\nmtllib ' + self.mtllib + '\n\n'
s = '# Wavefront OBJ exported with ABMATT v1.2.0\n\nmtllib ' + self.mtllib + '\n\n'
vertex_index = 1
normal_index = 1
normal_offset = -1
Expand Down
5 changes: 1 addition & 4 deletions abmatt/converters/points.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,8 @@ def get_format_divisor(minimum, maximum):
is_signed = True if point_min < 0 else False
point_max = max(point_max, abs(point_min))
max_shift = 16 - math.frexp(point_max)[1] - is_signed
if max_shift <= 6: # guarantee 6 decimals of precision
if max_shift <= 13: # guarantee 4 decimals of precision
return 'f', 0 # float
elif max_shift >= 15:
max_shift -= 8
format = 'b' if is_signed else 'B'
else:
format = 'h' if is_signed else 'H'
return format, max_shift
Expand Down
2 changes: 1 addition & 1 deletion abmatt/dist/install-ubu.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
====================================================================================
ANOOB'S BRRES MATERIAL TOOL
Version: 1.1.0
Version: 1.2.0
Author: Robert Nelson
OS: linux
Github: https://github.com/Robert-N7/abmatt
Expand Down
2 changes: 1 addition & 1 deletion abmatt/dist/install-win.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
===================================================================================================
ANOOB'S BRRES MATERIAL TOOL
Version 1.1.0
Version 1.2.0
Robert Nelson
OS: Windows 10 64-bit
Github: https://github.com/Robert-N7/abmatt
Expand Down
2 changes: 1 addition & 1 deletion abmatt/dist/make_installer.nsi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!define VERSION "1.1.0"
!define VERSION "1.2.0"
!define PROGRAM_NAME "ANoob's Brres Material Tool ${VERSION}"
InstallDir "$Documents\abmatt"
Name "${PROGRAM_NAME}"
Expand Down
2 changes: 1 addition & 1 deletion abmatt/load_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def load_config(app_dir=None, loudness=None, autofix_level=None):
return conf


VERSION = '1.1.0'
VERSION = '1.2.0'
USAGE = "USAGE: abmatt [command_line][--interactive -f <file> -b <brres-file> -d <destination> --overwrite]"


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

# calling the setup function
setup(name='abmatt',
version='1.1.0',
version='1.2.0',
entry_points={
'console_scripts': [
'abmatt = abmatt.__main__:main'
Expand Down

0 comments on commit e5664d5

Please sign in to comment.