← All ideas
  • Published 3 May 2019

Pick working context in console and text editor to avoid 'context is incorrect' error

There should be an option to pick a working context (a 3d view for example) so testing code snippets does not require a context override... using bpy.context.screen.areas[?].regions[-1] to get the only 3d view which is just above the console and point it to an override and feed that to every single operator or snippet you want to test, is not very efficient...

100%

Development Status: Open

Upvote 3 Downvote 0
yasharjk
3 May 2019

2 Comments

testure

Where would you put this though, as part of the script editor? what about people using external editors like VSCode or SublimeText? I like the idea- as an addon dev I have found myself in that same situation plenty of times, but I'm curious how you would solve the problem of specification- because if you can specify it one way it's fairly simple to specify it another way (ie: I and likely hundreds of others have written a small utility modules or functions that just grabs the first 3DView it finds).

yasharjk Author

* @testure * I would like it as a picker button in the header of console or text editor to pick the target area. at least for one liner codes in console it's frustrating to find 3d view by direct indexing or looping. Something like the set origin button in screencast keys addon which picks the target area to show the info, will do the job. youtube.com/watch