diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-03-29 11:18:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-03-29 12:11:54 +0300 |
commit | 6332e0e1f7499755cfd4caa5a67066daf46d8b83 (patch) | |
tree | b333df6292da9c625012bce7ad8a5c456b3200f8 /tests/python/batch_import.py | |
parent | df7f6a3e2e91a7ad27f8ca2b2b43a6c51da8c2c9 (diff) |
Use 'empty' option for clearing factory settings
Diffstat (limited to 'tests/python/batch_import.py')
-rw-r--r-- | tests/python/batch_import.py | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/tests/python/batch_import.py b/tests/python/batch_import.py index 8fc679a7c15..bbe3a70327f 100644 --- a/tests/python/batch_import.py +++ b/tests/python/batch_import.py @@ -48,29 +48,17 @@ import os import sys -def clear_scene(): - import bpy - unique_obs = set() - for scene in bpy.data.scenes: - for obj in scene.objects[:]: - scene.objects.unlink(obj) - unique_obs.add(obj) - - # remove obdata, for now only worry about the startup scene - for bpy_data_iter in (bpy.data.objects, bpy.data.meshes, bpy.data.lamps, bpy.data.cameras): - for id_data in bpy_data_iter: - bpy_data_iter.remove(id_data) - - -def batch_import(operator="", - path="", - save_path="", - match="", - start=0, - end=sys.maxsize, - ): +def batch_import( + operator="", + path="", + save_path="", + match="", + start=0, + end=sys.maxsize, +): import addon_utils _reset_all = addon_utils.reset_all # XXX, hack + _disable_all = addon_utils.disable_all # XXX, hack import fnmatch @@ -116,11 +104,12 @@ def batch_import(operator="", # hack so loading the new file doesn't undo our loaded addons addon_utils.reset_all = lambda: None # XXX, hack + addon_utils.disable_all = lambda: None # XXX, hack - bpy.ops.wm.read_factory_settings() + bpy.ops.wm.read_factory_settings(use_empty=True) addon_utils.reset_all = _reset_all # XXX, hack - clear_scene() + addon_utils.disable_all = _disable_all # XXX, hack result = op(filepath=f) |