2
$\begingroup$

Should reloading scripts with F8 cause issues with the UI, and Blender all together? It has been doing such to me (factory defaults), but I don't know much about the feature.

A common issue arising is:

Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender\2.75\scripts\addons_contrib\
space_view3d_quickPrefs.py", line 939, in setup
    gllightpreset_chooseLoadLocation(1)
  File "C:\Program Files\Blender Foundation\Blender\2.75\scripts\addons_contrib\
space_view3d_quickPrefs.py", line 604, in gllightpreset_chooseLoadLocation
    filepath=bpy.context.scene.quickprefs.gllightpreset_importdirectory
AttributeError: 'Scene' object has no attribute 'quickprefs'

This is with factory defaults, but after reloading scripts. I have not changed the scripts folder either. Vanilla settings. This error will pop up every 100ms, until I enable the QuickPrefs addon from the Testing branch.

I'm really not worried about the issue of quickprefs, more than I'm really trying to find answers to the following questions:

1. Is the reload scripts command (default F8), only reloading the base script folder built-in with the Blender install, or does it reload all scripts referenced in the instance?

2. Does the "Scripts" Folder setting effect what folder is reloaded when executing "Reload Scripts".

3. Is it common for a brand new install, without any changes, or enabled addons to error when reloading scripts after it's very first startup?

The point of these questions is so that I may understand that portion of Blender quite a bit better, as well as know what is considered "normal behavior" before reporting bugs. My apologies for not being more clear.

$\endgroup$
5
  • $\begingroup$ Please add some info to your question as to what issues reloading scripts is causing. $\endgroup$ Jun 27, 2015 at 22:00
  • $\begingroup$ So are you saying that the reload scripts option should not cause issues, because that's all I'm trying to figure out. I've updated the question to try to make this more clear, and the reason I asked the question the way I did. There are lots of other errors, but of course I'm listing the most common. If it's one of those scenarios where there are certain issues that arise when reloading scripts, I can understand, but I'm really just trying to understand exactly if ANYTHING that errors from this command warrants a bug report. $\endgroup$
    – DBrown
    Jun 28, 2015 at 3:44
  • $\begingroup$ the addon has a tracker URL: developer.blender.org/T27822 and the same problem noticed here ..two years ago and has not been fixed: developer.blender.org/T27822#119941 . I don't think the addon should be included until the author (or someone interested in the addon) fixes it. $\endgroup$
    – zeffii
    Jun 28, 2015 at 7:43
  • $\begingroup$ This particular script should now be fixed as of : developer.blender.org/… . next time you download a blender with addons_contrib, this addon will behave properly! $\endgroup$
    – zeffii
    Jun 28, 2015 at 16:12
  • $\begingroup$ Haha, that's good to know. Thanks for the links Zeffii, now I know where to go when I look up my other script errors in 2.75rc2. There have been a lot of other issues that have come from my reloading scripts, but I really wanted to understand exactly what was happening before filing any reports. I appreciate all of the input you have all given. $\endgroup$
    – DBrown
    Jun 28, 2015 at 19:17

2 Answers 2

1
$\begingroup$
  1. Is the reload scripts command (default F8), only reloading the base script folder built-in with the Blender install

Any addon that you have currently enabled (usually saved in User Settings or default.blend) will go through the motions of unregister() and register() when you press F8. The add-on's unregister() function must carefully remove anything it has added. (in this case that add-on doesn't remove everything and should be fixed)

  1. Does the "Scripts" Folder setting effect what folder is reloaded when executing "Reload Scripts".

Yes. But the Scripts folder is loaded in addition to Blender's own version/scripts/addons/ folders (which can either be local to the binary or in a special storage place used by Blender for all versions of Blender

  1. Is it common for a brand new install, without any changes, or enabled addons to error when reloading scripts after it's very first startup?

On a fresh Blender start-up; add-ons which are not enabled (ie no tick present in the addon preferences ) will not be read by Blender, and not interpreted by Python. So when you do get an error it will be because one or more add-ons has been enabled at some point during the Blender session. If you are getting an error from an add-on that has been enabled, it is most likely an addon in the addons_contrib directory, and exactly what the cause is will be unique to the addon.

edit -- this should now be fixed already in addons_contrib

In the case of the space_view3d_quickPrefs.py it seems to be caused by the persistent handler being added in the register phase but never removed in the unregister phase.

A fix would be to add this line at the end of the unregister function:

def unregister():
    ...
    bpy.app.handlers.scene_update_pre.remove(setup)
$\endgroup$
2
  • 1
    $\begingroup$ Thank you so much for making this clear to me. I appreciate the time taken to deal with such an obscure question. :) $\endgroup$
    – DBrown
    Jun 28, 2015 at 19:09
  • $\begingroup$ Making addons, complex addons especially, play nice with the F8 can be tricky but it's important because it's a key that gets pressed either intentionally or unintentionally.. I don't consider bugs like this sloppy, but rather due to lack of understanding of the ecosystem of Python / Blender, also not exactly trivial to get to the point of mastery. ( i have not..) $\endgroup$
    – zeffii
    Jun 28, 2015 at 19:28
1
$\begingroup$

Every addon uses a register function that allows it to add operators, panels, extra properties etc that it uses to work, it also has an unregister function to undo these changes when the addon is disabled.

If disabling an addon gives errors after being disabled that are related to properties or functions that it setup, then it is a bug in the addon that should be fixed.

You may notice that the addon you refer to is from addons_contrib, which is a collection of addons available that haven't been accepted as official addons to be included in release versions. Chances are this error is a known one and is one of the reasons it is still in contrib. In this case a release candidate is not being considered as a release version and includes the contrib addons, which may not be the best option.

While reloading scripts can help in some cases, it doesn't remove every change and start from scratch, for that you will need to quit then start blender. I believe reloading scripts relies on the unregister functions mentioned earlier to work properly.

Whether you are using a new install or an old one, it depends on the addon scripts enabled to whether any issues like this happen.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .