Skip to content

Commit a1887b7

Browse files
authored
Merge pull request #234 from OpenSAGE/python_3.8_adaptions
adapted to python 3.9 used in blender 2.93 and onwards
2 parents 52a5b93 + 1c3080c commit a1887b7

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
include:
2020
- blender-version: '2.93'
2121
blender-version-suffix: '4'
22-
python-version: '3.9.1'
22+
python-version: '3.9.2'
2323

2424
steps:
2525
- uses: actions/checkout@v2
@@ -43,7 +43,7 @@ jobs:
4343
ln -s ${PWD}/io_mesh_w3d ${PWD}/tmp/blender/${{ matrix.blender-version }}/scripts/addons/io_mesh_w3d
4444
wget https://files.pythonhosted.org/packages/85/d5/818d0e603685c4a613d56f065a721013e942088047ff1027a632948bdae6/coverage-4.5.4.tar.gz#md5=c33cab2aed8780aac32880cb6c7616b7
4545
tar zxf coverage-4.5.4.tar.gz
46-
mv coverage-4.5.4/coverage "${PWD}/tmp/blender/${{ matrix.blender-version }}/python/lib"
46+
mv coverage-4.5.4/coverage "${PWD}/tmp/blender/${{ matrix.blender-version }}/scripts/modules"
4747
rm -rf coverage-4.5.4
4848
- name: Test
4949
run: |

io_mesh_w3d/bone_volume_export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ def export_bone_volume_data(context, filepath):
3535

3636
node = create_node(root, 'BoneVolume')
3737
node.set('BoneName', mesh.name)
38+
node.set('ContactTag', mesh.data.contact_tag)
3839
node.set('Mass', format_str(mesh.data.mass))
3940
node.set('Spinniness', format_str(mesh.data.spinniness))
40-
node.set('ContactTag', mesh.data.contact_tag)
4141

4242
location, rotation, scale = mesh.matrix_world.decompose()
4343
extend = get_aa_box(mesh.data.vertices)

io_mesh_w3d/w3d/structs/mesh_structs/vertex_material.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ def write(self, io_stream):
105105
if self.vm_info is not None:
106106
self.vm_info.write(io_stream)
107107

108-
if self.vm_args_0 is not '':
108+
if self.vm_args_0 != '':
109109
write_chunk_head(W3D_CHUNK_VERTEX_MAPPER_ARGS0, io_stream, text_size(self.vm_args_0, False), io_stream)
110110
write_string(self.vm_args_0, io_stream)
111111

112-
if self.vm_args_1 is not '':
112+
if self.vm_args_1 != '':
113113
write_chunk_head(W3D_CHUNK_VERTEX_MAPPER_ARGS1, io_stream, text_size(self.vm_args_1, False))
114114
write_string(self.vm_args_1, io_stream)

io_mesh_w3d/w3x/io_xml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def create_named_root(name):
6565

6666
def create_root():
6767
root = ET.Element('AssetDeclaration')
68-
root.set('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance')
6968
root.set('xmlns', 'uri:ea.com:eala:asset')
69+
root.set('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance')
7070
return root
7171

7272

tests/test_geometry_export.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_geometry_export(self):
2424
bpy.context.view_layer.update()
2525

2626
xmlFile = None
27-
iniFIle = None
27+
iniFile = None
2828

2929
try:
3030
export_geometry_data(self, XML_FILE)
@@ -34,17 +34,17 @@ def test_geometry_export(self):
3434
self.assertEqual('<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n', xmlFile.readline())
3535
self.assertEqual('<Geometry isSmall="False">\n', xmlFile.readline())
3636
self.assertEqual(
37-
' <Shape Height="1.000" MajorRadius="0.500" MinorRadius="0.500" Type="BOX">\n',
37+
' <Shape Type="BOX" MajorRadius="0.500" MinorRadius="0.500" Height="1.000">\n',
3838
xmlFile.readline())
3939
self.assertEqual(' <Offset X="0.000000" Y="0.000000" Z="0.000000" />\n', xmlFile.readline())
4040
self.assertEqual(' </Shape>\n', xmlFile.readline())
4141
self.assertEqual(
42-
' <Shape ContactPointGeneration="VEHICLE" MajorRadius="0.500" Type="SPHERE">\n',
42+
' <Shape Type="SPHERE" MajorRadius="0.500" ContactPointGeneration="VEHICLE">\n',
4343
xmlFile.readline())
4444
self.assertEqual(' <Offset X="2.000000" Y="2.000000" Z="5.000000" />\n', xmlFile.readline())
4545
self.assertEqual(' </Shape>\n', xmlFile.readline())
4646
self.assertEqual(
47-
' <Shape ContactPointGeneration="STRUCTURE" Height="1.000" MajorRadius="0.500" MinorRadius="0.500" Type="CYLINDER">\n',
47+
' <Shape Type="CYLINDER" MajorRadius="0.500" MinorRadius="0.500" Height="1.000" ContactPointGeneration="STRUCTURE">\n',
4848
xmlFile.readline())
4949
self.assertEqual(' <Offset X="22.332001" Y="2.110000" Z="-5.000000" />\n', xmlFile.readline())
5050
self.assertEqual(' </Shape>\n', xmlFile.readline())

version_history.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
v0.6.7
22
- added auto updater
3+
- adaptions for python 3.9 used in blender 2.93 and later
34
- Bugfix: pivot and vertex groups are compared all lowercase
45

56
v0.6.6 (24.7.21)

0 commit comments

Comments
 (0)