# Chart Graphics Generator Add-On: AttributeError: '_RestrictContext' object has no attribute 'scene' [closed]

I'm new to Blender, and I'm finding that it's a very powerful tool so far. At the moment, I'm trying to enable an add-on called Chart Graphics Generator. However, it produces this error whenever I try to enable it:

AttributeError: '_RestrictContext' object has no attribute 'scene'

Source:
(The attached blend file in the very last post on the thread linked)

I've updated the Add-on: Precise-Align, but the error still persists. I found out that's it's due to an intentional deprecation from Blender with certain restrictions on context.

The Traceback says the problem is on line 44, in the globals section.

pid2 = pi * 0.5
sce = bpy.context.scene
obj = bpy.context.object
boo = bpy.ops.object
bot = bpy.ops.transform
suma = 0

chartType = '' #not yet used
negativValueSeen = False
sizesCVSfile = None
colnrPKHG = '-1'
cvs_colums = 0


What I've tried:

I've tried just running the script in a text box, without trying to use it as an add-on.

This partially works. However, it only shows the data labels of the imported CSV file, without any line charts relating to the values of my own CSV file.

The line charts that appear on start up relate to the default CSV file the developer wrote the path to.

I've also tried following the vimeo tutorial video with instructions on how to use it, but the method script just seems to have deprecated methods:

http://vimeo.com/43432482

Being relatively new, I don't know how to go about solving this error. I know there must be a new way to write it, but I'm not sure where to start. Can someone please assist me in resolving this error?

## closed as off-topic by CoDEmanX, gandalf3♦, iKlsR♦Aug 19 '14 at 3:09

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question appears to be off-topic because it is a bug report and not an actual question. These should be reported to Blender's tracker instead." – CoDEmanX, gandalf3, iKlsR
If this question can be reworded to fit the rules in the help center, please edit the question.

• The error is because addons can no longer use global variables. While I had a look I gave up trying to fix it. I found it easier to use sverchok to create a bar chart from csv data. This example might help you get started, it's my first attempt with sverchok so probably not the best way to do it. – sambler Aug 7 '14 at 16:19
• Thank you for trying to fix it, I really appreciate it. I'll take a look into working with sverchok, it has really great examples! – Justin Baxtron Aug 7 '14 at 17:12
• Read here why you can't access context members during init: wiki.blender.org/index.php/Extensions:2.6/Py/… – CoDEmanX Aug 18 '14 at 17:59
• I understand that I can't access context members. (I wanted to post that link, but as a new user could only post 2). I'm just not sure on how to fix it. – Justin Baxtron Aug 21 '14 at 19:25