update for tests, error out when duplicate modules are found, all ctest tests pass again.
This commit is contained in:
@@ -111,7 +111,7 @@ add_test(export_obj_all_objects ${TEST_BLENDER_EXE}
|
||||
--run={'FINISHED'}&bpy.ops.export_scene.obj\(filepath='${TEST_OUT_DIR}/export_obj_all_objects.obj',use_selection=False,use_nurbs=True\)
|
||||
--md5_source=${TEST_OUT_DIR}/export_obj_all_objects.obj
|
||||
--md5_source=${TEST_OUT_DIR}/export_obj_all_objects.mtl
|
||||
--md5=d06bd49e6c084e4e3348fa397a88790c --md5_method=FILE
|
||||
--md5=01c123948efadc6a71ab2c09a5925756 --md5_method=FILE
|
||||
)
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ add_test(export_x3d_all_objects ${TEST_BLENDER_EXE}
|
||||
--python ${CMAKE_CURRENT_LIST_DIR}/bl_test.py --
|
||||
--run={'FINISHED'}&bpy.ops.export_scene.x3d\(filepath='${TEST_OUT_DIR}/export_x3d_all_objects.x3d',use_selection=False\)
|
||||
--md5_source=${TEST_OUT_DIR}/export_x3d_all_objects.x3d
|
||||
--md5=cef017805f684f27c311fdf4ba87462a --md5_method=FILE
|
||||
--md5=d7d6574e833f3f051b65ef4577485fa9 --md5_method=FILE
|
||||
)
|
||||
|
||||
|
||||
|
@@ -65,6 +65,10 @@ def load_modules():
|
||||
# paths blender stores scripts in.
|
||||
paths = bpy.utils.script_paths()
|
||||
|
||||
print("Paths:")
|
||||
for script_path in paths:
|
||||
print("\t'%s'" % script_path)
|
||||
|
||||
#
|
||||
# find all sys.path we added
|
||||
for script_path in paths:
|
||||
@@ -74,11 +78,18 @@ def load_modules():
|
||||
|
||||
#
|
||||
# collect modules from our paths.
|
||||
module_names = set()
|
||||
for mod_dir in module_paths:
|
||||
# print("mod_dir", mod_dir)
|
||||
for mod, mod_full in bpy.path.module_names(mod_dir):
|
||||
if mod in module_names:
|
||||
raise Exception("Module found twice %r" % mod)
|
||||
|
||||
modules.append(__import__(mod))
|
||||
|
||||
module_names.add(mod)
|
||||
del module_names
|
||||
|
||||
#
|
||||
# now submodules
|
||||
for m in modules:
|
||||
|
Reference in New Issue
Block a user