Hello,
Some progress... or not...
- for the problem of exporting a re-imported file,
In "fg_btg_io.py" I suppressed the test:
- Code: Select all
if not os.path.exists(filename):
return
in "def save_btg..." Not very elegant, but now I can export.
I tried to go back to your 4c6458fb version (before "Performance improvement"). The result is good, but indeed, it's a bit long...
- So, to get a "clean" mesh, I import, export, re-import and apply "remove doubles" with the following script:
- Code: Select all
import bpy
for ob in bpy.context.selected_objects:
#print(ob.name)
if ob.type =="MESH":
bpy.context.view_layer.objects.active = ob
print("ACTIVE", bpy.context.active_object.name)
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.remove_doubles(threshold=0.03)
bpy.ops.object.mode_set(mode='OBJECT')
I tried to integrate it in "fg_btg_io.py", but without success... I don't understand why... anyway, we can run it in blender and it does the job.
The modification of the "mesh" and even the "objects" is going well and everything is fine in fg as long as we stay with the textures present in the original btg.
Problems start if you want to add a new object (landclass) with a texture not present in the original one.
Oddly enough it works with some textures, randomly. I respect the "material/texture" couples of "btg_materials.dat", although if I understand correctly, this file is only consulted on import.
I don't understand how the relation material-texture is done in blender (I don't find anything understandable in the bpy docs),
and how it went into the btg structure.
If you can help me solve this texture thing, it would be a welcome advance for my project.