Just to share something.
If anyone want to batch convert the models using blender 2.8
For blender install these two adons
https://github.com/tnemec/Xplane2Blender_Importer - This is used to import the xplane objects
https://github.com/NikolaiVChr/Blender-AC3D/tree/2.80 - This exports the ac format for FG
- Code: Select all
import bpy
import os
for root, dirs, files in os.walk('path to your xp models directory'):
for name in files:
if name.endswith('obj'):
# delete everything
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()
# adjust this to match the import smd operator
bpy.ops.object.xplane11import(filepath=os.path.join(root, name))
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.flip_normals()
bpy.ops.object.mode_set(mode='OBJECT')
# export as ac
bpy.ops.export_scene.export_ac3d(filepath=os.path.join(root, name+'.ac'))
Then run the above script in blender. This will then convert all the xplane obj files to ac files. I found that for some reason the normals are a bit messed up so added a bit in the script to flip the normals and that seems to resolve that issue.
I also found that sometimes the models point to a png however the xplane object has a dds texture file. Right now it seems the best to use png, I had some weird issues with using dds. If you do convert all textures to png you can run the following to update all the ac files.
Place all your ac files in a directory open the terminal and run the code below. It will replace .dds to .png in all the files.
- Code: Select all
sed -i -- 's/.dds/.png/g' *