I’m converting my 2.7 scripts into 2.8 and there is something I don’t know how to do with OpenGL drawing: before, I used bgl.glPointSize() and bgl.glLineWidth() to make the display thicker. Is it possible to do that with the gpu high level API? I see ‘pos’ and ‘color’ attributes in content of batch_for_shader() but nothing related to the size.
When I try your code snippet I get the error below (Win10 x64). Is that the full snippet?
Traceback (most recent call last):
File "\Text", line 12, in <module>
AttributeError: module 'gpu_extras' has no attribute 'batch'
Error: Python script fail, look in the console for now...
Only way to make it work seems to be (which is interesting)
update on Oct 29, 2019:
today somehow the add-on stopped working on the laptop too. I have to add from gpu_extras import batch. Then I can even use gpu_extras.batch.batch_for_shader directly.
================
On Oct 26, 2019:
I have also encountered this error on a desktop and surface pro 6 yesterday, but not on my laptop. All of them have blender 2.80 (sub 75) installed. The only relevant difference seems to be the graphics cards. Desktop has GTX 1070, surface pro 6 has Intel UHD Graphics 620, and laptop has RTX 2070. On both surface pro 6 and desktop I can use from gpu_extras import batch to get around this problem, as suggested above.
Well, another difference is that I developed the add-on on my laptop, then installed it on desktop and surface pro, but should not be relevant.