[Bf-committers] Using wheels in blender addons

Bastien Montagne montagne29 at wanadoo.fr
Tue Oct 10 20:06:16 CEST 2017


Yes, using threading in py scripts in Blender is perfectly valid - as 
long as you do not touch Blender data itself at all (nor try to call 
some operators from a thread, etc.). If you use your own code on your 
own data, no problem with threading at all (i18n messages generation 
script e.g. uses py threads, as well as temp instances of Blender ran in 
background, and so does the batch previews tools generating object 
previews in .blend files).

Cheers,
Bastien


Le 10/10/2017 à 19:56, Isaac Weaver a écrit :
> It looks like you're using a threading executor to run each call to
> requests. I thought that threading wasn't supported in blender[1], or does
> that only apply to threading code that effects bpy.data?
>
> What I'm doing currently is using asyncio.open_connection and building a
> raw http request. But that seems too low level to be practical.
>
> [1]
> https://docs.blender.org/api/blender_python_api_2_78_1/info_gotcha.html#strange-errors-using-threading-module
>
> Thanks,
>
> ~ Isaac
>
> On Tue, Oct 10, 2017 at 3:28 AM, Sybren A. Stüvel <sybren at stuvel.eu> wrote:
>
>> Is aiohttp really necessary? I mean, we already bundle the Requests
>> library, so doing HTTP calls is already possible.
>>
>> As far as asyncio goes, I've used it for the Blender Cloud add-on, and
>> it worked alright. I'm still not 100% convinced it's The Way To Go for
>> Blender, it has its pros and cons. However, you could take a peek at the
>> source code [1] to see how I used Requests with asyncio.
>>
>> [1] https://developer.blender.org/diffusion/BCA/
>>
>> Cheers,
>>
>> Sybren
>>
>>
>> On 09/10/17 22:12, Isaac Weaver wrote:
>>> I'm currently working on an addon that I would like to eventually get
>>> included in Blender and was wondering if​ it's ok to use python wheels.
>> The
>>> guidelines say not to use binary files (
>>> https://wiki.blender.org/index.php/Dev:Doc/Process/Addons#Never_Do) but
>> I'm
>>> wondering if that applies to wheels as well (I know the blender cloud
>> addon
>>> uses a couple of wheels). Specifically, I'd like to include a wheel for
>>> aiohttp.
>>>
>>> Thanks,
>>>
>>> ~ Isaac
>>> _______________________________________________
>>> Bf-committers mailing list
>>> Bf-committers at blender.org
>>> https://lists.blender.org/mailman/listinfo/bf-committers
>> --
>> Sybren A. Stüvel
>>
>> https://stuvelfoto.nl/
>> https://stuvel.eu/
>>
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> https://lists.blender.org/mailman/listinfo/bf-committers
>>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> https://lists.blender.org/mailman/listinfo/bf-committers



More information about the Bf-committers mailing list