mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user