Skip to content

Commit

Permalink
try-except clause for removing properties
Browse files Browse the repository at this point in the history
  • Loading branch information
OlafHaag committed Apr 27, 2021
1 parent a1f63eb commit 31c9e0d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 11 additions & 8 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,17 @@ def declare_addon_properties():

def remove_addon_properties():
"""Remove the custom add-on properties."""
del bpy.types.Scene.import_root_path
del bpy.types.Scene.export_path
del bpy.types.Scene.import_files
del bpy.types.Scene.collection_map
del bpy.types.Scene.n_component_combinations
del bpy.types.Object.src_file
del bpy.types.Scene.use_only_matching_sets
del bpy.types.Scene.use_import_texture_variants
try:
del bpy.types.Scene.import_root_path
del bpy.types.Scene.export_path
del bpy.types.Scene.import_files
del bpy.types.Scene.collection_map
del bpy.types.Scene.n_component_combinations
del bpy.types.Object.src_file
del bpy.types.Scene.use_only_matching_sets
del bpy.types.Scene.use_import_texture_variants
except AttributeError:
pass


auto_load.init()
Expand Down
2 changes: 0 additions & 2 deletions src/scenemanager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
from .. import file_ops as fops


# ToDo: Split manager into smaller files by function domain (e.g. collection/properties related, operators).

# Create new helper-class to transport messages from functions to operators for displaying them in the GUI.
Feedback = namedtuple("Feedback", ["type", "msg"])

Expand Down

0 comments on commit 31c9e0d

Please sign in to comment.