Import names with spacesFreecad, when converting a file in mesh to export it with .obj format and then with Blender obtaining a definitive .ac file, adds the text " (Meshed)" to the bottom of the converted object name.
The .ac format correctly supports file names with spaces, exports them smoothly, and is handled correctly by FGFS. But if we run the reverse operation, or by .ac we want to import them into Blender, the "Blender-AC3D" converter truncates object names, making it impossible a correct re-export to .ac format.
The reason is in the way in which parsing is followed.I think the best solution is to rebuild the correct name in the function that extracts the object name. I would not do otherwise, otherwise much code would have to be modified, with a likely slowdown in import.
I solved this problem by changing the code of the "name" token reading method:
This is the original code found in
https://github.com/majic79/Blender-AC3D/blob/master/io_scene_ac3d/import_ac3d.py- Code: Select all
def read_name(self, ac_file, toks):
self.name=toks[1].strip('"')
return False
I change the code in this form:
- Code: Select all
def read_name(self, ac_file, toks):
sizeToks = len(toks)
self.name = toks[1].strip('"')
if (sizeToks) > 2:
for i in range(sizeToks - 2):
self.name += " " + toks[i + 2].strip('"')
return False
Now it works properly
I think it's a useful change to include in AC3D code.