Revert "Closes ##7225 - Improve generate_freestyle_linework to robustly handle SVG output by falling back to the first generated linework file if the expected file is missing."

This reverts commit 89c039252b.
This commit is contained in:
Dion Moult
2025-10-11 19:02:04 +11:00
parent 92ae79f64e
commit 71d5239823
@@ -17,7 +17,6 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import os
import glob
import bpy
import json
import time
@@ -797,14 +796,11 @@ class CreateDrawing(bpy.types.Operator):
edge_bm.to_mesh(edge_mesh)
edge_bm.free()
pattern = svg_path[0:-4] + "????.svg"
files = glob.glob(pattern)
if not files:
self.report({"ERROR"}, f"No Freestyle SVG found matching {pattern}")
return None
actual_path = svg_path[0:-4] + "0001.svg"
context.scene.render.filepath = svg_path[0:-4]
bpy.ops.render.render(write_still=False)
found_path = max(files, key=os.path.getctime)
os.replace(found_path, svg_path)
os.replace(actual_path, svg_path)
bpy.data.objects.remove(edge_obj)
bpy.data.meshes.remove(edge_mesh)