[Bf-python] Inserting a slice into RenderPass.rect

Brian Savery brian.savery at gmail.com
Tue Feb 2 23:32:42 CET 2016


BTW My obvious workaround was to save the buffer locally and replace the
slice into that, then copy the buffer up.  But was curious why this didn't
work

On Tue, Feb 2, 2016 at 2:31 PM, Brian Savery <brian.savery at gmail.com> wrote:

> Working on a RenderEngine addon.   When rendering I'd like to update a
> region of the render result (say if I want to update the first scanline of
> pixels).
>
> On the face of it RenderPass.rect is simply a list of 4 float items (list
> of rgba value).
>
> https://www.blender.org/api/blender_python_api_current/bpy.types.RenderEngine.html
>
> I can do
> layer.rect = [[1.0, 0.0, 0.0, 1.0]] * pixel_count
>
> However replacing a slice of that rect:
> layer.rect[100:200] = [[1.0, 0.0, 0.0, 1.0]] * 100
> gives an error:
>
> TypeError: a float is required
> Not sure what's going on here?
>
> --
> brian.savery at gmail.com
> 508-274-8700
>



-- 
brian.savery at gmail.com
508-274-8700
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20160202/f44aad0c/attachment.html>


More information about the Bf-python mailing list