# How can I enable the Laplacian Lightning Generator?

The Laplacian Lightning Generator addon broke with some recent API changes, as reported in this bug.

Attempting to enable it results in this:

Traceback (most recent call last):
File "/usr/share/blender/2.68/scripts/modules/addon_utils.py", line 294, in enable
mod = __import__(module_name)
File "/usr/share/blender/2.68/scripts/addons_contrib/object_laplace_lightning.py", line 117, in <module>
scn = bpy.context.scene
AttributeError: '_RestrictContext' object has no attribute 'scene'


As it was only some API changes that broke this, I assume (also from looking at the error) that this might be a fairly trivial problem (I'm inexperienced with python, so that might be a false assumption)

Are there a few simple changes I can make to get this addon working?

I know it works to run it in the text editor, however I would like to be able to use it as an addon without having to re run it every time I start blender.

• Did you tried to run the script from text-editor, as specified on the website of the link you posted ? --> "UPDATE – 02.14.13 (...) An API change has made the addon not load. It has something to do bpy.scene.context. I’ll look into it when I have a chance. Fortunately the script will still run as a regular script. If you want to use it, just use the .blend file below or just load it in the text editor and hit run" – Polosson Oct 11 '13 at 21:14
• @Polosson I did try that, and it works :). However I would like to be able to enable it once without having to restart it each time I restart blender. (I forgot to add this to the question originally..) – gandalf3 Oct 12 '13 at 0:34