24 Commits

Author SHA1 Message Date
d55f2dcee1 Compatibility with Blender 3.1 / Python 3.10
Blender 3.1 will be shipped with Python 3.10, which made some backward-
incompatible changes in its asyncio module (the removal of the `loop`
parameter from various functions).

Depending on which Python version is used in Blender, the add-on now
passes (or not) the `loop` parameter, retaining backward compatibility.
2022-02-25 15:45:52 +01:00
8b49c5505e Reformat with Black
No functional changes.
2021-02-16 11:48:43 +01:00
883f125722 Compatibility with Blender 2.93 / Python 3.9 → require Blender 2.80+
The code now requires Python 3.7 or newer, as a side-effect of the changes
required for compatibility with 3.9 (as used in Blender 2.93). As a result,
Blender Cloud Add-on now requires Blender 2.80 or newer.
2021-02-16 11:48:43 +01:00
c4de4e9990 Fixed some MyPy warnings
This includes using `''` instead of `None` in some cases where an empty
string conveys 'nothing' equally well as `None`; in such cases keeping the
type the same rather than switching to another type is preferred.
2019-01-03 12:07:05 +01:00
b35d7bc5f3 Made the add-on more compatible with 2.80 and 2.79 2018-09-04 13:48:44 +02:00
ac85bea111 Some asyncio tweaks. 2017-06-13 14:39:29 +02:00
7b5613ce77 Fixed issue with multiple asyncio loops on Windows.
The biggest issue was the construction of an asyncio.Semaphore() while the
default loop is alive, and then creating a new loop on win32.

I've also taken the opportunity to explicitly pass our loop to some calls,
rather than expecting them to use the correct one automagically, and added
some more explicit timeout handling to the semaphore usage.
2017-06-13 13:35:05 +02:00
8151b952b9 Construct ProactorEventLoop on win32 for subprocess support 2017-01-17 16:02:34 +01:00
887a9cc697 Allow async operators to automatically quit when they raise an exception.
Just set the class property `stop_upon_exception=True`.
2016-08-26 17:43:40 +02:00
143456ae1d Made AsyncModalOperatorMixin.invoke() start self.async_execute(context).
This was already common practice in all subclasses, and has now been
moved into the mixin.
2016-08-26 17:43:40 +02:00
9bc8c30443 Moved invoke-calling execute function to AsyncModalOperatorMixin
because this is what you'd generally want from an async operator
2016-07-22 12:48:50 +02:00
369e082880 Added GPL License block to the top of each .py file. 2016-07-20 16:32:01 +02:00
56137c485f Nicer resetting of _loop_kicking_operator_running 2016-06-17 16:27:45 +02:00
73e2fd77e2 Added reloading of home file after pulling (not implemented pull yet)
Pull is easy, we can already download files from Cloud. Had to jump
through some hoops to make the reload work reliably, though.
2016-06-17 15:48:17 +02:00
8a5efc18db Separated async-task-operator code from texture browser GUI code. 2016-06-16 16:33:05 +02:00
29230f09e7 More streamlined interface with Pillar.
Using a semaphore to ensure requests to Pillar aren't too parallel,
so that we can cancel requests faster.
2016-04-01 18:47:06 +02:00
09e9c02d65 Asyncio loop kicked via modal operator.
The old way (using a scene_update_pre handler) turned out to work due to
a bug in Blender, where scene_update_pre was called too frequently.
2016-03-23 13:45:28 +01:00
dc4677ed04 Removed single-threadedness from executor 2016-03-22 14:35:44 +01:00
c5f66ec0d9 Removed time dependency in asyncio loop kicking. 2016-03-22 14:31:34 +01:00
d3e433b8b2 Using loop.call_later() to ensure short-running loop iteration
How we previously did things could cause us to miss certain calls, such
as calling 'future.add_done_callback()' callbacks.
2016-03-15 15:34:30 +01:00
5e237bea22 Explicitly support cancelling tasks.
The 'cancelled' status is now tracked by a Future that's passed to
different asychronous tasks. That way it is possible to cancel all
running tasks before browsing another Pillar node.
2016-03-15 14:05:54 +01:00
0174c28075 Setting up and using Python's logging framework.
It's dubious whether logging.basicConfig() should be called here, so
that call will probably be moved somewhere else.
2016-03-15 13:47:21 +01:00
59401d9c41 Moved GUI to 3D viewport
We now draw the GUI using OpenGL in Python. This allows for much more
control on the Python side. It's still a prototype, and allows us to
test the features without depending on C support in Blender itself.
GUI code was taken from the Asset Flinger addon.
2016-03-14 17:23:56 +01:00
b274faf12c Transitioned from synchronous to asynchronous
Using the new 'async def' functionality in Python 3.5!
Still crappy GUI, we're going to replace that.
2016-03-11 17:52:12 +01:00