Hi Matt,<div><br></div><div>I ran into a similar situation and struggled a little to make my peace with the POST_VIEW callback. Campbell told me that it was still quite experimental so I got it working for my project (with a modal operator to be re-activated from time to time) and let it go of it. Would love to see a reliable way of using it though.</div>

<div><span class="Apple-style-span" style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span class="Apple-style-span" style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px">> I'd also suggest that a good way to implement this would be as a custom object drawing callback</span></div>

<div><span class="Apple-style-span" style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><br></span></div><div>I used it to draw a background plate, so in my case I don't know if a per-object solution would help. I would prefer an option to have a callback in the 3dview editor. If I have 100 3dview editors opened so be it, the code will run 100x. Though one thing doesn't exclude the other, and having either one I think both results (what I need and what you want) can be achieved).</div>

<div><br></div><div>--</div><div>Dalai</div><div><div><font class="Apple-style-span" color="#222222" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse:collapse"><br></span></font></div><div><font class="Apple-style-span" color="#222222" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse:collapse">for the records, this is my use of it (see the edit.py) :</span></font></div>

<div><font class="Apple-style-span" color="#222222" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse:collapse"><a href="http://www.dalaifelinto.com/ftp/impa/ibltoolkit.zip">http://www.dalaifelinto.com/ftp/impa/ibltoolkit.zip</a></span></font></div>

<div><font class="Apple-style-span" color="#222222" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse:collapse"><br></span></font></div><div><div class="gmail_quote">2012/6/26 Matt Ebb <span dir="ltr"><<a href="mailto:matt@mke3.net" target="_blank">matt@mke3.net</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm looking to do some custom drawing in the 3D View as part of a<br>
render API plugin. In this particular case, it's to visualise lights,<br>
for example spot light cone angles/sizes/etc.<br>
<br>
Working around this, trying to force the render engine's lights to<br>
mimic blender's existing light properties is not adequate for several<br>
reasons, the most significant being that what's built in to blender<br>
doesn't encompass the range of functionality provided by other<br>
renderers, such as orthographic shadow maps on distant lights. It<br>
would be great to be able to draw this info into the 3D View myself,<br>
depending on the custom engine-specific data attached to the object.<br>
<br>
I've done some testing, and using the region POST_VIEW callback, I can<br>
successfully draw custom OpenGL, looping over all lights in bpy.data<br>
but the problem is the user experience around it, especially in the<br>
case of a render plugin, is not good. I've tried a few things and as<br>
far as I can tell, this is only really possible as part of an<br>
operator, that must be manually run. On top of this, it's only valid<br>
for a certain area/region, which means if a user adds a new 3D View,<br>
the operator must be run again.<br>
<br>
If anyone has any hacks/ideas for how this can be worked around or<br>
improved, I'd love to hear. While I'd be happy with something that<br>
just works for my use case, I'd also suggest that a good way to<br>
implement this would be as a custom object drawing callback<br>
(disclaimer: I have no idea how easy this would be to create).<br>
<br>
It's quite commonplace in other applications to allow plugins to do<br>
custom openGL drawing per object - in many pipelines this is used to<br>
represent custom object/geometry types that the host application<br>
doesn't natively support, or to display a representation of geometry<br>
that will be loaded or generated at render time, without having to<br>
load that geometry into the host application's scene database. It'd<br>
also be useful for render engines of course! Something like this would<br>
probably be a better longer term solution.<br>
<br>
Anyway, any thoughts/ideas/hacks welcome!<br>
<br>
thanks,<br>
<br>
Matt<br>
_______________________________________________<br>
Bf-python mailing list<br>
<a href="mailto:Bf-python@blender.org">Bf-python@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-python" target="_blank">http://lists.blender.org/mailman/listinfo/bf-python</a><br>
</blockquote></div><br></div></div>