I have downloaded version 0.1.3 and copied the addon's folder \crowdrender, available inside the zipped file, in the \addons folder of my Blender 2.79 official portable installation. I am running Windows 10 Pro 64bit and Blender 64bit versions. Unfortunately, when I try to activate the add-on I get the following error in the Blender console:
Exception in module register(): 'D:\\Blender\\blender-2.79a-rc-windows64\\2.79\\scripts\\addons\\crowdrender\\__init__.py'
Traceback (most recent call last):
File "D:\Blender\blender-2.79a-rc-windows64\2.79\scripts\modules\addon_utils.py", line 354, in enable
mod.register()
File "D:\Blender\blender-2.79a-rc-windows64\2.79\scripts\addons\crowdrender\__init__.py", line 101, in register
select_platform()
File "D:\Blender\blender-2.79a-rc-windows64\2.79\scripts\addons\crowdrender\__init__.py", line 75, in select_platform
set_sys_path('Win64')
File "D:\Blender\blender-2.79a-rc-windows64\2.79\scripts\addons\crowdrender\__init__.py", line 92, in set_sys_path
addons_path = bpy.utils.script_paths(subdir="addons")[1]
IndexError: list index out of range
As you can see from the above, that same error occurs with 2.79, 2.79aRC, 2.79.2 (dev). Furthermore, I noticed that the subdir path is hardcoded to the \addons directory. Since I do use a custom folder named \addons_extern for all the not official addons, would it be possible to let the addon find out where is it installed instead of forcing the installation inside the user's \addons folder (C:\Users\[username]\AppData\Roaming\Blender Foundation\Blender\2.79)? Hope the above it's clear enough. Thank you.
Hi Gerrit, sorry for the delay in reaching you! Ok, let me have a look in my blender. I am using 2.79b right now...
Hmmmm, i still have two paths here. Can I ask, when you installed crowdrender, did you capture where it says it installed it to? Usually there is a message in the info bar or in the system console that tells you where the addon gets installed. This is vital information for this issue so if you can post back letting me know that would really help me help you :D
James
Hey James,
i have the same problem as Riccardo, and tried to add the path in the file tab under user preferences, Unfortunately it does not work, bpy.utils.script_paths(subdir="addons")[1] is still not set (i tested it in the python console inside blender), any ideas what might be the problem ? I also use the portable Blender 2.79.
thx in advance
Gerrit
Hi Roccardo, not a problem! Happy I could help :D
Thank you James, you understood perfectly what's going on. In fact, I never ever installed Blender using the Windows installer, from day one (six years ago) I've only used the portable versions which work perfectly, if there's no hardcoded path in the add-ons.
Therefore, I never had that local user scripts path (C:\Users\[name]\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons) and don't even need it, unless there are add-ons who requires it. This way my Blender folder is a really portable, self contained Blender installation
I followed your suggestion and moved the entire Crowdrender add-on folder inside the Windows user scripts folder and now it works.
While I like this add-on I prefer to keep everything inside the Blender portable installation path, and I presume that it's possible to make the add-on works that way.
For your information, in case you might find it useful, I use a modified ..\scripts\modules\addon_utils.py file to restore (it was removed at a certain point some years ago) and use a folder named ..\scripts\addons_extern besides the existing \addons and \addons_contrib. This way I can keep the official addons folders clean (I do synchronize them with the GitHub repositories) and leave any other addon in that third folder. It works like a charm except when there are hardcoded paths like here.
If you're interested to look at that modified addon_utils.py file I can upload it here or somewhere else.
I would like very much to know if there's a way to adapt your add-on to my needs so that he could find intelligently where the addon is placed and do not force the use of the user scripts folder at all.
For the moment I thank you for guiding me to this solution.
Hi Riccardo, ok, so I'm going to raise an issue in our software manager to deal with this. In the mean time, you should be able to get this working. I think what you need to do is to create an entry in your User preferences/Files tab for your scripts path (I am guessing its probably not there).
The standard installation of blender normally creates a folder like this:
C:\Users\*your_user_name*\AppData\Roaming\Blender Foundation\2.79\scripts\addons
Its this folder which our code is looking for when you see the failure on this line:
bpy.utils.script_paths(subdir="addons")[1]
This happens becuase there are two paths for scripts and as you already discovered, one of them is for the scripts that come bundled with blender which is the bpy.utils.script_paths(subdir="addons")[0] path.
I think the second path on your system is missing because you are using a portable install which doesn't use and installer. But, if you manually enter a path into the User Preferences/Files/Scripts field, I think this would become the second entry and you can specifiy a path of your choosing. If you are willing to give this a try, please let us know if it works :D
I digged a little inside the errors and it seems that line 92 of __init__.py is the cause ot the error:
addons_path = bpy.utils.script_paths(subdir="addons")[1]
in fact, if I play with the scripting console I get these results (but I am not a developer or coder so I might be wrong)
>> bpy.utils.script_paths(subdir="addons")[1]
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
IndexError: list index out of range
>>> bpy.utils.script_paths(subdir="addons")[0]
'D:\\Blender\\blender-2.79a-rc-windows64\\2.79\\scripts\\addons'
The second instance of the command seems to work fine, but if I change it in the __init__.py script this generates other errors:
reloading addon: crowdrender 1519311672.2406247 1519318198.5414548 D:\Blender\blender-2.79a-rc-windows64\2.79\scripts\addons\crowdrender\__init__.py (here I refreshed the addons in Preferences after changing the init file as per the second above case)
error encountered whilst attempting to register addon prefs
error was ... <class 'ValueError'> : register_class(...): already registered as a subclass
CROWD RENDER addon reloaded successfully
Exception ignored in: <bound method ImagePreviewCollection.__del__ of <ImagePreviewCollection id=0x22456db3d68[0], {}>>
Traceback (most recent call last):
File "D:\Blender\blender-2.79a-rc-windows64\2.79\scripts\modules\bpy\utils\previews.py", line 81, in __del__
(self.__class__.__name__, self._uuid, len(self)))
ResourceWarning: <ImagePreviewCollection id=0x22456db3d68[0]>: left open, remove with 'bpy.utils.previews.remove()'
Exception in module register(): 'D:\\Blender\\blender-2.79a-rc-windows64\\2.79\\scripts\\addons\\crowdrender\\__init__.py'
Traceback (most recent call last):
File "D:\Blender\blender-2.79a-rc-windows64\2.79\scripts\modules\addon_utils.py", line 354, in enable
mod.register()
File "D:\Blender\blender-2.79a-rc-windows64\2.79\scripts\addons\crowdrender\__init__.py", line 103, in register
cr_source.register()
File "D:\Blender\blender-2.79a-rc-windows64\2.79\scripts\addons\crowdrender\src\__init__.py", line 81, in register
cr_version.register()
File "D:\Blender\blender-2.79a-rc-windows64\2.79\scripts\addons\crowdrender\src\bl_2_79\__init__.py", line 1020, in register
initialiser.register_package()
File "D:\Blender\blender-2.79a-rc-windows64\2.79\scripts\addons\crowdrender\src\bl_2_79\__init__.py", line 298, in register_package
ui_panels.register()
File "/Users/jamesmac/Desktop/cr_compile/releases/multi OS releases/crowdrender/src/cr/ui_panels.py", line 322, in register
IndexError: list index out of range
Looking at the list file path (/Users/jamesmac/etc.) I decided to stop and report the above to avoid messing too much around your add-on. Hope it helps.