X-Plane / XPlane2Blender

Scenery & Aircraft export addon for Blender and X-Plane
GNU General Public License v3.0
190 stars 67 forks source link

Support for Python 3.10.x #689

Closed lehthanis closed 2 years ago

lehthanis commented 2 years ago

My linux system recently updated python to 3.10.2 and my XPlane2Blender stopped working. I originally thought it was due to changes in Blender 3.0.1, but after experimenting, I found that not to be the case. It turns out it's a simple issue with Importing Iterable in the xplane_types/xplane_keyframe_collection.py file.

Apparently Iterable has been moved now to collections.abc and in order to make XPlane2Blender compatible with the higher python versions, you'll need to modify the beginning of the file as follows:

in xplane_types/xplane_keyframe_collection.py

import copy
import math
from collections.abc import Iterable, MutableSequence
from collections import namedtuple
from typing import List, Tuple

Once doing this, I no longer have any problems running XPlane2Blender in blender 3.0.1 with Python 3.10.2.

@tngreene I imagine this problem would exist for older supported versions of blender on systems with newer python versions as well, but I'm not versed enough in python to be sure.

jakep623 commented 2 years ago

My linux system recently updated python to 3.10.2 and my XPlane2Blender stopped working. I originally thought it was due to changes in Blender 3.0.1, but after experimenting, I found that not to be the case. It turns out it's a simple issue with Importing Iterable in the xplane_types/xplane_keyframe_collection.py file.

Apparently Iterable has been moved now to collections.abc and in order to make XPlane2Blender compatible with the higher python versions, you'll need to modify the beginning of the file as follows:

in xplane_types/xplane_keyframe_collection.py

import copy
import math
from collections.abc import Iterable, MutableSequence
from collections import namedtuple
from typing import List, Tuple

Once doing this, I no longer have any problems running XPlane2Blender in blender 3.0.1 with Python 3.10.2.

@tngreene I imagine this problem would exist for older supported versions of blender on systems with newer python versions as well, but I'm not versed enough in python to be sure.

Where is "xplane_types/xplane_keyframe_collection.py" located?

lehthanis commented 2 years ago

@jakep623 in the extracted plugin's zip file. look at the source code of the plugin in github. https://github.com/X-Plane/XPlane2Blender/blob/5face69fbb828a414b167dcb063fabf5182a54bc/io_xplane2blender/xplane_types/xplane_keyframe_collection.py#L1

bsupnik commented 2 years ago

Fixed via fd456b784b68699016e6fa6ba3539a65371d1506

jakep623 commented 2 years ago

@jakep623 in the extracted plugin's zip file. look at the source code of the plugin in github.

https://github.com/X-Plane/XPlane2Blender/blob/5face69fbb828a414b167dcb063fabf5182a54bc/io_xplane2blender/xplane_types/xplane_keyframe_collection.py#L1

Much appreciated. I just went into my file and it still didnt work, but I see 4.1.0-rc.1 is up. Thank you!

jakep623 commented 2 years ago

Hello again,

I am having trouble importing X-Plane objects into blender with the latest release. Would it be possible to push the 4.20 alpha with the .py file fix? I tried swapping the file from the updated one, and also changing the header myself, not work!

Or a link to an importer I can add would be amazing too. TIA.

RyanLee355 commented 2 years ago

Not sure if this is related, but I am too using Python 3.10.2 and Blender 3.0.1. Here, the importer does not show up at all whilst the exporter does. Functionality can't be confirmed. https://imgur.com/k3xLS4e

bsupnik commented 2 years ago

@jakep623 the current 4.2.0 release candidate will work with new Python for exporting. It does not contain the importer. There is no current importer release.

@Migqle this is unrelated - the importer simply isn't in the releases.

tparikka commented 1 year ago

@tngreene is it possible to make this change to the v4.2.0-alpha.1 branch? I believe it's needed there as well.