[Bf-committers] Images in Panels..

Campbell Barton ideasman42 at gmail.com
Fri Jul 27 08:40:08 CEST 2012


On Fri, Jul 27, 2012 at 6:32 AM, Dima Glibitsky <dima.glib at gmail.com> wrote:
>> you can use bgl to load your own textures on top of quads drawn by bgl. So yes its possible, but not simple, but also not difficult. Also you will also have to handle scrolling, since the bgl draw is separate from Blender main GUI , so that means a serious amount of code. But if you don't mind the extra works it won't be very hard. Bgl also will give some cooler tricks than Blender GUI because bgl is basically opengl 1.1 wrapper, so that gives some extra power to the coder.
>
> dimitris chloupis, is there any example of such a system? As far as I
> know, Blender's python API gives no information about panel's
> scrolling and layout, so even with bgl the addon-developer simply
> doesn't know *where* to draw the quads.

@Dima as far as I can see you're right, wile BGE can draw images we
don't provide a way to draw then in panels. Keep in mind pythons
draw() functions in panel classes in menus will setup the interface to
draw _after_ - so you can't do any OpenGL drawing there.


@dimitris - I dont think your explanation of `bgl` as buggy is really
correct, bgl just wraps OpenGL - there isnt much to it,
the issues you have are almost certainly issues dealing with sharing
an OpenGL context with blender - which will free images from OpenGL
memory to prevent running out of texture memory for unused textures in
scenes.


@Scott - you can currently draw textures in the 3D viewport so perhaps
you can get some test script working, but don't think drawing textures
in panels will be supported from python any time soon.


More information about the Bf-committers mailing list