Timeline for AttributeError: '_RestrictContext' object has no attribute 'space_data'
Current License: CC BY-SA 3.0
16 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 22, 2021 at 14:53 | comment | added | batFINGER | @brockmann lol here's another one re the confusion over that icons path from textblock question we edited a while back | |
Oct 7, 2016 at 16:42 | vote | accept | Tiles | ||
Oct 6, 2016 at 11:09 | answer | added | Tiles | timeline score: 2 | |
Oct 6, 2016 at 9:19 | history | edited | Tiles | CC BY-SA 3.0 |
deleted 112 characters in body
|
Oct 6, 2016 at 9:13 | history | edited | Tiles | CC BY-SA 3.0 |
deleted 112 characters in body
|
Oct 6, 2016 at 9:09 | comment | added | Tiles | Thanks for the advice. The reduced example is up. I have edited the first post. Now i will try to follow the advice in your link. | |
Oct 6, 2016 at 9:08 | history | edited | Tiles | CC BY-SA 3.0 |
deleted 9310 characters in body
|
Oct 6, 2016 at 8:34 | comment | added | zeffii | Make it so it only tries to load / display one icon. The result of your reduction doesn't even have to be a useful add-on, as long as it attempts to display a single custom icon :) and then try to work the code linked to by Jerryno or the custom icons Template in TextEditor, or a working example add-on github.com/zeffii/mesh_tiny_cad | |
Oct 6, 2016 at 8:30 | comment | added | Tiles | Thanks zeffi. I thought it is already reduced enough. But i will try to reduce it. Give me a few moments ... | |
Oct 5, 2016 at 16:11 | history | edited | Ray Mairlot | CC BY-SA 3.0 |
additional formatting, python tag
|
Oct 5, 2016 at 16:07 | comment | added | Tiles | I have already understood that bpy.data.texts does not work. But i still search for a working solution, the substitute for it. Also your linked solution does not work, it gives me a UnboundLocalError: local variable 'bpy' referenced before assignment at the line import bpy.utils.previews. | |
Oct 5, 2016 at 9:56 | comment | added | Tiles | And this is what does not work. I overlook something it seems :/ . Wouldn't it be easier to tell me the solution instead of linking me around? :) | |
Oct 5, 2016 at 9:51 | comment | added | Jaroslav Jerryno Novotny | This is explained here: blender.stackexchange.com/questions/32335/…. You will find answers how to get the path for an addon and for running it within Blender. | |
Oct 5, 2016 at 9:46 | comment | added | Tiles | Well this line of code detects the script path, and so the path of the icons. How should the icon path be found without this? I tried to comment out the line, and made the icons dir to icons_dir = ( "icons"). The addon now loads. But then the icons doesn't show anymore. | |
Oct 5, 2016 at 9:37 | comment | added | batFINGER |
Go to the section marked Restricted Context here wiki.blender.org/index.php/Extensions:2.6/Py/API_Changes You prob don't need script_path = bpy.context.space_data.text.filepath in an addon anyhow? For an addon consider using icon_dir = path.join(path.dirname(__file__), "icons") (path is os.path)
|
|
Oct 5, 2016 at 9:31 | history | asked | Tiles | CC BY-SA 3.0 |