WPI-AIM / ambf_addon

A Graphical add-on for Blender for Creating and Loading AMBF Models
11 stars 8 forks source link

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

Closed nepacheco closed 4 years ago

nepacheco commented 4 years ago

I am getting this error when install the add on

Modules Installed (ambf_addon) from '/home/nicholas/ambf_addon/ambf_addon.py' into '/home/nicholas/.config/blender/2.79/scripts/addons'
Traceback (most recent call last):
  File "/home/nicholas/blender-2.79-linux-glibc219-x86_64/2.79/scripts/modules/addon_utils.py", line 331, in enable
    mod = __import__(module_name)
  File "/home/nicholas/.config/blender/2.79/scripts/addons/ambf_addon.py", line 2308, in <module>
    class AMBF_PT_create_ambf(bpy.types.Panel):
  File "/home/nicholas/.config/blender/2.79/scripts/addons/ambf_addon.py", line 2345, in AMBF_PT_create_ambf
    bpy.context.scene['mesh_output_type'] = 0
AttributeError: '_RestrictContext' object has no attribute 'scene'
adnanmunawar commented 4 years ago

Can you specify if you are using the latest commit on the master branch?

nag92 commented 4 years ago

yes, He did add tried and a few old commits too.

adnanmunawar commented 4 years ago

Please point me to the exact commit that is used as the command bpy.context.scene['mesh_output_type'] = 0 does not occur at link 2345 in the latest commit.

adnanmunawar commented 4 years ago

Since I almost always use the text editor in Blender to load the plugin and then run it from there I have not experienced this problem. But I tried loading the plugin from File -> User Preferences -> Add-ons >> Install Add-on from File. And then I experienced this issue. See if the latest commit fixes it for you.

nepacheco commented 4 years ago

I pulled the latest commit and was able to add the addon. Thank you.

adnanmunawar commented 4 years ago

Thanks for creating the issue. I am going to close this now.