Comment 3 for bug 244787

Revision history for this message
Domino Marama (domino) wrote :

This problem is caused by the layout of the scripts directory which prevents scripts from importing functions from any of the standard Blender scripts. I've modified one of my scripts with a workaround which I've shown as a patch below. Hopefully this will help someone fix this issue in the Blender package. The problem is that import is expecting the scripts to be in /usr/share/blender/scripts/ not /usr/share/blender/scripts/blender/ - that extra subdirectory causes the problem. Moving the scripts up a directory fixes all the standard scripts.

--- a/primstar/uv_tools.py
+++ b/primstar/uv_tools.py
@@ -41,7 +41,14 @@ except:

 import Blender
 from math import atan2, pi, sin
-from uvcalc_follow_active_coords import extend
+try:
+ from uvcalc_follow_active_coords import extend
+except ImportError:
+ try:
+ from blender.uvcalc_follow_active_coords import extend
+ except ImportError:
+ print """Debian and Ubuntu users should run 'sudo
touch /usr/share/blender/scripts/blender/__init__.py' to allow import of
Blender scripts"""
+ raise