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

Campbell Barton ideasman42 at gmail.com
Tue Mar 8 10:23:41 CET 2016


Committed support for this:
https://developer.blender.org/rBad98f00d1f651bacafd319e2311b35359a10ab56

However I think its intended that you would pass a sub-region to begin_result(),
so slice assignment shouldn't be needed.

On Wed, Feb 3, 2016 at 9:32 AM, Brian Savery <brian.savery at gmail.com> wrote:
> 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
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>



-- 
- Campbell



More information about the Bf-python mailing list