From 5759420ff4a31e16041082b6795fe333a55471f2 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Fri, 28 Jun 2024 10:24:22 +0200 Subject: [PATCH] disable extra scene data dynamically --- __init__.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/__init__.py b/__init__.py index fa8b02f..08ce99f 100644 --- a/__init__.py +++ b/__init__.py @@ -578,13 +578,10 @@ class FONT3D_OT_SaveFontToFile(bpy.types.Operator): context_override["selected_objects"] = list(export_objects) # context_override["scene"] = bpy.context.scene.copy() with bpy.context.temp_override(**context_override): - # prepare variables before disable addons - filepath = f"/tmp/toast/{selected_font.font_name}.gltf" - del bpy.context.scene["font3d"] - del bpy.context.scene["font3d_data"] - del bpy.context.scene["curve_array_properties"] - del bpy.context.scene["curvetools"] - del bpy.context.scene["ObjectAlongPath_curveName"] + filepath = f"{preferences.assets_dir}/fonts/{selected_font.font_name}.gltf" + # get rid of scene extra data before export + for k in bpy.context.scene.keys(): + del bpy.context.scene[k] # save as gltf lol = bpy.ops.export_scene.gltf(