Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import X-Plane not in Import menu #728

Open
MickCrozier opened this issue Apr 30, 2023 · 12 comments
Open

Import X-Plane not in Import menu #728

MickCrozier opened this issue Apr 30, 2023 · 12 comments

Comments

@MickCrozier
Copy link

MickCrozier commented Apr 30, 2023

Blender 3.2 MacOS 13.3.1
Installed 4.2.0 rc3

Addon has loaded - I can see X-Plane Export and all the x-plane properties.
But Import is not there.

Is there a trick to enabling it?

@PCABG
Copy link

PCABG commented May 3, 2023

I have the exact same issue Blender 3.5, Windows 11

@ian-m-carr
Copy link

Are you guys using the feature branch with the importer code? There is no importer in the master branch code, It's an "experimental" feature as noted in the readme

@PCABG
Copy link

PCABG commented May 3, 2023

I am using the latest release XPlane2Blender v4.2.0-rc-3 and installed from the zip file in the addons manager as instructed here in the wiki

@ian-m-carr
Copy link

The release versions do not contain the importer functionality, it's on the feature branch, check out init.py from master, no import registered:

def register():
    xplane_export.register()
    xplane_props.register()
    xplane_ops.register()
    xplane_ops_dev.register()
    xplane_ui.register()
    bpy.types.TOPBAR_MT_file_export.append(menu_func)

from the feature branch:

def register():
    xplane_export.register()
    xplane_import.register()
    xplane_props.register()
    xplane_ops.register()
    xplane_ops_dev.register()
    xplane_ui.register()
    bpy.types.TOPBAR_MT_file_export.append(menu_func_export)
    bpy.types.TOPBAR_MT_file_import.append(menu_func_import)

@MickCrozier
Copy link
Author

Thanks Ian.

Clear as mud. The readme says "An experimental importer has been added in 4.2.0-Alpha 1 and can be found here: https://github.com/X-Plane/XPlane2Blender/releases/tag/v4.2.0-alpha.1".
One assumes it's also in the releases that follow.

@DWmFrancis
Copy link

DWmFrancis commented May 4, 2023 via email

@ian-m-carr
Copy link

Yeah, I was surprised myself, seemed to be in 4.2.0-alpha1, then moved out into the feat-importer branch, and was not present in 4.2.0-rc.1 and forward.

I forked (public) the feat-import branch and did some additional work on my copy to import a little more of the content, and have a version which works for me, round trips a cockpit OK. If you have some python/blender experience you should be able to get something working, but from my experience the importer code in this repository isn't 'complete' or 'final'.

@MickCrozier
Copy link
Author

I ended up installing the alpha just to see if it was worth trying the same thing as yourself. But it didn't import the objects at all. Maybe something I'm doing wrong, but not critcial.
Ultimatley I was trying to import so I could paint liveries in a 3D envioronment with ArmourPaint.
Sadly none of the other importers available are working properly either :(

@ian-m-carr
Copy link

@MickCrozier Not sure what issues you hit, but it's probably worth saying that the code from the repository worked at blender version 2.8.3 but required updates to work correctly in later versions particularly the 3.x releases of Blender (API changes and python version differences). The earlier versions of Blender remain available, downloading a 2.8.3 and trying may resolve some of your problems?

@DWmFrancis
Copy link

@ian-m-carr - I've resorted to having two versions of Blender on my system and using 2.93 with the 4.2.0 version of the Import-Export Add-on. Unfortunately, my coding skills are very limited, so I'm not going to be much help beyond testing. I'm under the impression that Ted Green has moved on and Ben isn't interested in continuing to develop the capability. That's really unfortunate, as its very useful for budding aircraft developers and aircraft rennovators.

@JT8D-17
Copy link

JT8D-17 commented Dec 11, 2023

@ian-m-carr Your fork is great, thank you!

I found these two bugs (posting them here because forks don't seemm to support issue tracking):

  • Only the literal texture filename in OBJ files is supported. E.g. if an OBJ file says "738fuselage_LIT.png", but only the equivalent "738fuselage_LIT.dds" is pressent in the folder, the importer will throw an error and quit. X-Plane looks for both PNG and DDS files with a given file name in an OBJ file, so it'd be nice if the importer could do this as well.

  • Opening a Blend file and then trying to import an object always end sin this error:

  File "/home/[username]/.config/blender/4.0/scripts/addons/io_xplane2blender/xplane_import.py", line 63, in execute
    x = xplane_imp_parser.import_obj(self.filepath)
  File "/home/[username]/.config/blender/4.0/scripts/addons/io_xplane2blender/importer/xplane_imp_parser.py", line 91, in import_obj
    relpath = Path(filepath).relative_to(Path(bpy.data.filepath).parent)
  File "/media/X-Plane/X-Plane_Utilities/blender-4.0.1-linux-x64/4.0/python/lib/python3.10/pathlib.py", line 818, in relative_to
    raise ValueError("{!r} is not in the subpath of {!r}"
ValueError: '/media/X-Plane/X-Plane_12/Aircraft/AddOn_Aircraft/B737-800X/objects/738fuselage.obj' is not in the subpath of '/home/[username]' OR one path is relative and the other is absolute.

The only thing I can do then is restart blender and importing into an empty Blender file.

@ian-m-carr
Copy link

ian-m-carr commented Dec 12, 2023

@JT8D-17 Sorry, I had not enabled the issues list on the fork. It should be there now.
But to address your points:

  1. Yeah, I can take a look at it, but I am not sure I like the original behaviour :-) I think I prefer requiring the right extension!
  2. The importer requires the blender file to be in the same heirarchy as the obj files it is importing. Looks from your error that this was not the case. Can you open an issue on the fork, and tell me the paths 1: to the blend file (must have been saved!) and 2: to the obj file you are importing (must be a path below the blend location, I often use a symbolic link or windows junction to arrange to have the aircraft folder appear below the blender modelling folder)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants