disable extra scene data dynamically

This commit is contained in:
themancalledjakob 2024-06-28 10:24:22 +02:00
parent c27b53b012
commit 5759420ff4

View file

@ -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(