Compare commits

...

8 Commits

Author SHA1 Message Date
d940735453 Mark version 1.25 as released today 2022-02-25 15:45:55 +01:00
7d71067b3d Use BAT version 1.11 for UDIM support 2022-02-25 15:45:55 +01:00
b0b804410d Bumped version to 1.25 2022-02-25 15:45:55 +01:00
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
2fbb5ac788 Bumped version to 1.24 2022-02-04 11:01:55 +01:00
b47b407589 Update CHANGELOG.md 2022-02-04 10:58:55 +01:00
a136366804 Upgrade to BAT 1.10
Upgrade to BAT to fix doubly-compressed blend files.

This also changes the way the wheel files are loaded, as the old
alphabetical ordering won't pick up on BAT 1.10. It now uses the
modification time of the wheel files to find the latest one.
2022-02-04 10:57:45 +01:00
6718e1646f Attract: prevent rare error in ATTRACT_OT_open_meta_blendfile 2021-11-19 15:46:19 +01:00
8 changed files with 45 additions and 12 deletions

View File

@ -1,6 +1,17 @@
# Blender Cloud changelog # Blender Cloud changelog
## Version 1.25 (2022-02-25)
- Compatibility with Blender 3.1 (Python 3.10).
- Bump blender-asset-tracer to version 1.11, for UDIM support.
## Version 1.24 (2022-02-04)
- Bump blender-asset-tracer version 1.8 → 1.10, for fixing a bug where files were doubly-compressed.
## Version 1.23 (2021-11-09) ## Version 1.23 (2021-11-09)
- Bump blender-asset-tracer version 1.7 → 1.8, for compatibility with sending read-only blend files to Flamenco. - Bump blender-asset-tracer version 1.7 → 1.8, for compatibility with sending read-only blend files to Flamenco.

View File

@ -21,7 +21,7 @@
bl_info = { bl_info = {
"name": "Blender Cloud", "name": "Blender Cloud",
"author": "Sybren A. Stüvel, Francesco Siddi, Inês Almeida, Antony Riakiotakis", "author": "Sybren A. Stüvel, Francesco Siddi, Inês Almeida, Antony Riakiotakis",
"version": (1, 23), "version": (1, 25),
"blender": (2, 80, 0), "blender": (2, 80, 0),
"location": "Addon Preferences panel, and Ctrl+Shift+Alt+A anywhere for texture browser", "location": "Addon Preferences panel, and Ctrl+Shift+Alt+A anywhere for texture browser",
"description": "Texture library browser and Blender Sync. Requires the Blender ID addon " "description": "Texture library browser and Blender Sync. Requires the Blender ID addon "

View File

@ -56,8 +56,11 @@ def setup_asyncio_executor():
from . import pillar from . import pillar
# Python 3.8 deprecated the 'loop' parameter, 3.10 removed it.
kwargs = {"loop": loop} if sys.version_info < (3, 8) else {}
# No more than this many Pillar calls should be made simultaneously # No more than this many Pillar calls should be made simultaneously
pillar.pillar_semaphore = asyncio.Semaphore(3, loop=loop) pillar.pillar_semaphore = asyncio.Semaphore(3, **kwargs)
def kick_async_loop(*args) -> bool: def kick_async_loop(*args) -> bool:

View File

@ -668,6 +668,8 @@ class ATTRACT_OT_open_meta_blendfile(AttractOperatorMixin, Operator):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
if context.selected_sequences is None:
return False
return bool( return bool(
any(cls.filename_from_metadata(s) for s in context.selected_sequences) any(cls.filename_from_metadata(s) for s in context.selected_sequences)
) )

View File

@ -25,6 +25,7 @@ import logging
from contextlib import closing, contextmanager from contextlib import closing, contextmanager
import urllib.parse import urllib.parse
import pathlib import pathlib
import sys
import requests.adapters import requests.adapters
import requests.packages.urllib3.util.retry import requests.packages.urllib3.util.retry
@ -261,14 +262,17 @@ async def pillar_call(pillar_func, *args, caching=True, **kwargs):
) )
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
# Python 3.8 deprecated the 'loop' parameter, 3.10 removed it.
kwargs = {"loop": loop} if sys.version_info < (3, 8) else {}
# Use explicit calls to acquire() and release() so that we have more control over # Use explicit calls to acquire() and release() so that we have more control over
# how long we wait and how we handle timeouts. # how long we wait and how we handle timeouts.
try: try:
await asyncio.wait_for(pillar_semaphore.acquire(), timeout=10, loop=loop) await asyncio.wait_for(pillar_semaphore.acquire(), timeout=10, **kwargs)
except asyncio.TimeoutError: except asyncio.TimeoutError:
log.info("Waiting for semaphore to call %s", pillar_func.__name__) log.info("Waiting for semaphore to call %s", pillar_func.__name__)
try: try:
await asyncio.wait_for(pillar_semaphore.acquire(), timeout=50, loop=loop) await asyncio.wait_for(pillar_semaphore.acquire(), timeout=50, **kwargs)
except asyncio.TimeoutError: except asyncio.TimeoutError:
raise RuntimeError("Timeout waiting for Pillar Semaphore!") raise RuntimeError("Timeout waiting for Pillar Semaphore!")
@ -648,9 +652,11 @@ async def fetch_texture_thumbs(
for texture_node in texture_nodes for texture_node in texture_nodes
) )
# Python 3.8 deprecated the 'loop' parameter, 3.10 removed it.
kwargs = {"loop": asyncio.get_event_loop()} if sys.version_info < (3, 8) else {}
# raises any exception from failed handle_texture_node() calls. # raises any exception from failed handle_texture_node() calls.
loop = asyncio.get_event_loop() await asyncio.gather(*coros, **kwargs)
await asyncio.gather(*coros, loop=loop)
log.info("fetch_texture_thumbs: Done downloading texture thumbnails") log.info("fetch_texture_thumbs: Done downloading texture thumbnails")
@ -929,8 +935,10 @@ async def download_texture(
) )
downloaders.append(dlr) downloaders.append(dlr)
loop = asyncio.get_event_loop() # Python 3.8 deprecated the 'loop' parameter, 3.10 removed it.
return await asyncio.gather(*downloaders, return_exceptions=True, loop=loop) kwargs = {"loop": asyncio.get_event_loop()} if sys.version_info < (3, 8) else {}
return await asyncio.gather(*downloaders, return_exceptions=True, **kwargs)
async def upload_file( async def upload_file(

View File

@ -58,8 +58,12 @@ def wheel_filename(fname_prefix: str) -> str:
if not wheels: if not wheels:
raise RuntimeError("Unable to find wheel at %r" % path_pattern) raise RuntimeError("Unable to find wheel at %r" % path_pattern)
# If there are multiple wheels that match, load the latest one. # If there are multiple wheels that match, load the last-modified one.
wheels.sort() # Alphabetical sorting isn't going to cut it since BAT 1.10 was released.
def modtime(filename: str) -> int:
return os.stat(filename).st_mtime
wheels.sort(key=modtime)
return wheels[-1] return wheels[-1]
@ -68,3 +72,8 @@ def load_wheels():
load_wheel("lockfile", "lockfile") load_wheel("lockfile", "lockfile")
load_wheel("cachecontrol", "CacheControl") load_wheel("cachecontrol", "CacheControl")
load_wheel("pillarsdk", "pillarsdk") load_wheel("pillarsdk", "pillarsdk")
if __name__ == "__main__":
wheel = wheel_filename("blender_asset_tracer")
print(f"Wheel: {wheel}")

View File

@ -3,7 +3,7 @@
lockfile==0.12.2 lockfile==0.12.2
pillarsdk==1.8.0 pillarsdk==1.8.0
wheel==0.29.0 wheel==0.29.0
blender-asset-tracer==1.8 blender-asset-tracer==1.11
# Secondary requirements: # Secondary requirements:
asn1crypto==0.24.0 asn1crypto==0.24.0

View File

@ -250,7 +250,7 @@ setup(
}, },
name="blender_cloud", name="blender_cloud",
description="The Blender Cloud addon allows browsing the Blender Cloud from Blender.", description="The Blender Cloud addon allows browsing the Blender Cloud from Blender.",
version="1.23", version="1.25",
author="Sybren A. Stüvel", author="Sybren A. Stüvel",
author_email="sybren@stuvel.eu", author_email="sybren@stuvel.eu",
packages=find_packages("."), packages=find_packages("."),