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["selected_objects"] = list(export_objects)
# context_override["scene"] = bpy.context.scene.copy() # context_override["scene"] = bpy.context.scene.copy()
with bpy.context.temp_override(**context_override): with bpy.context.temp_override(**context_override):
# prepare variables before disable addons filepath = f"{preferences.assets_dir}/fonts/{selected_font.font_name}.gltf"
filepath = f"/tmp/toast/{selected_font.font_name}.gltf" # get rid of scene extra data before export
del bpy.context.scene["font3d"] for k in bpy.context.scene.keys():
del bpy.context.scene["font3d_data"] del bpy.context.scene[k]
del bpy.context.scene["curve_array_properties"]
del bpy.context.scene["curvetools"]
del bpy.context.scene["ObjectAlongPath_curveName"]
# save as gltf # save as gltf
lol = bpy.ops.export_scene.gltf( lol = bpy.ops.export_scene.gltf(