xiuminglib
xiuminglib copied to clipboard
Imports are not lazy enough
Consider moving any non-basic imports into the functions.
This is not inefficient because imports are cached, and more importantly, helps reduce import failures.
If an import is pretty much necessary for all functions in the module (like import bpy to blender.object), wrap the import inside try, so it won't fail at init time (deferring failure till the use time).
I reiterate:
If an import is pretty much necessary for all functions in the module (like import bpy to blender.object), wrap the import inside try, so it won't fail at init time (deferring failure till the use time).