Skip to content

Commit

Permalink
Merge pull request #234 from OpenSAGE/python_3.8_adaptions
Browse files Browse the repository at this point in the history
adapted to python 3.9 used in blender 2.93 and onwards
  • Loading branch information
feliwir authored Sep 27, 2021
2 parents 52a5b93 + 1c3080c commit a1887b7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
include:
- blender-version: '2.93'
blender-version-suffix: '4'
python-version: '3.9.1'
python-version: '3.9.2'

steps:
- uses: actions/checkout@v2
Expand All @@ -43,7 +43,7 @@ jobs:
ln -s ${PWD}/io_mesh_w3d ${PWD}/tmp/blender/${{ matrix.blender-version }}/scripts/addons/io_mesh_w3d
wget https://files.pythonhosted.org/packages/85/d5/818d0e603685c4a613d56f065a721013e942088047ff1027a632948bdae6/coverage-4.5.4.tar.gz#md5=c33cab2aed8780aac32880cb6c7616b7
tar zxf coverage-4.5.4.tar.gz
mv coverage-4.5.4/coverage "${PWD}/tmp/blender/${{ matrix.blender-version }}/python/lib"
mv coverage-4.5.4/coverage "${PWD}/tmp/blender/${{ matrix.blender-version }}/scripts/modules"
rm -rf coverage-4.5.4
- name: Test
run: |
Expand Down
2 changes: 1 addition & 1 deletion io_mesh_w3d/bone_volume_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def export_bone_volume_data(context, filepath):

node = create_node(root, 'BoneVolume')
node.set('BoneName', mesh.name)
node.set('ContactTag', mesh.data.contact_tag)
node.set('Mass', format_str(mesh.data.mass))
node.set('Spinniness', format_str(mesh.data.spinniness))
node.set('ContactTag', mesh.data.contact_tag)

location, rotation, scale = mesh.matrix_world.decompose()
extend = get_aa_box(mesh.data.vertices)
Expand Down
4 changes: 2 additions & 2 deletions io_mesh_w3d/w3d/structs/mesh_structs/vertex_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ def write(self, io_stream):
if self.vm_info is not None:
self.vm_info.write(io_stream)

if self.vm_args_0 is not '':
if self.vm_args_0 != '':
write_chunk_head(W3D_CHUNK_VERTEX_MAPPER_ARGS0, io_stream, text_size(self.vm_args_0, False), io_stream)
write_string(self.vm_args_0, io_stream)

if self.vm_args_1 is not '':
if self.vm_args_1 != '':
write_chunk_head(W3D_CHUNK_VERTEX_MAPPER_ARGS1, io_stream, text_size(self.vm_args_1, False))
write_string(self.vm_args_1, io_stream)
2 changes: 1 addition & 1 deletion io_mesh_w3d/w3x/io_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def create_named_root(name):

def create_root():
root = ET.Element('AssetDeclaration')
root.set('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance')
root.set('xmlns', 'uri:ea.com:eala:asset')
root.set('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance')
return root


Expand Down
8 changes: 4 additions & 4 deletions tests/test_geometry_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_geometry_export(self):
bpy.context.view_layer.update()

xmlFile = None
iniFIle = None
iniFile = None

try:
export_geometry_data(self, XML_FILE)
Expand All @@ -34,17 +34,17 @@ def test_geometry_export(self):
self.assertEqual('<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n', xmlFile.readline())
self.assertEqual('<Geometry isSmall="False">\n', xmlFile.readline())
self.assertEqual(
' <Shape Height="1.000" MajorRadius="0.500" MinorRadius="0.500" Type="BOX">\n',
' <Shape Type="BOX" MajorRadius="0.500" MinorRadius="0.500" Height="1.000">\n',
xmlFile.readline())
self.assertEqual(' <Offset X="0.000000" Y="0.000000" Z="0.000000" />\n', xmlFile.readline())
self.assertEqual(' </Shape>\n', xmlFile.readline())
self.assertEqual(
' <Shape ContactPointGeneration="VEHICLE" MajorRadius="0.500" Type="SPHERE">\n',
' <Shape Type="SPHERE" MajorRadius="0.500" ContactPointGeneration="VEHICLE">\n',
xmlFile.readline())
self.assertEqual(' <Offset X="2.000000" Y="2.000000" Z="5.000000" />\n', xmlFile.readline())
self.assertEqual(' </Shape>\n', xmlFile.readline())
self.assertEqual(
' <Shape ContactPointGeneration="STRUCTURE" Height="1.000" MajorRadius="0.500" MinorRadius="0.500" Type="CYLINDER">\n',
' <Shape Type="CYLINDER" MajorRadius="0.500" MinorRadius="0.500" Height="1.000" ContactPointGeneration="STRUCTURE">\n',
xmlFile.readline())
self.assertEqual(' <Offset X="22.332001" Y="2.110000" Z="-5.000000" />\n', xmlFile.readline())
self.assertEqual(' </Shape>\n', xmlFile.readline())
Expand Down
1 change: 1 addition & 0 deletions version_history.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
v0.6.7
- added auto updater
- adaptions for python 3.9 used in blender 2.93 and later
- Bugfix: pivot and vertex groups are compared all lowercase

v0.6.6 (24.7.21)
Expand Down

0 comments on commit a1887b7

Please sign in to comment.