Removed attempt at region redrawing, in preparation of custom OpenGL GUI
This commit is contained in:
parent
8533ac83ba
commit
b156535ba1
@ -163,7 +163,6 @@ def enum_previews_from_directory_items(self, context) -> typing.List[typing.AnyS
|
|||||||
pcoll.previews = []
|
pcoll.previews = []
|
||||||
pcoll.project_uuid = project_uuid
|
pcoll.project_uuid = project_uuid
|
||||||
pcoll.node_uuid = node_uuid
|
pcoll.node_uuid = node_uuid
|
||||||
pcoll.context = context
|
|
||||||
pcoll.async_task = asyncio.ensure_future(async_download_previews(wm.thumbnails_cache, pcoll))
|
pcoll.async_task = asyncio.ensure_future(async_download_previews(wm.thumbnails_cache, pcoll))
|
||||||
|
|
||||||
# Start the async manager so everything happens.
|
# Start the async manager so everything happens.
|
||||||
@ -184,12 +183,6 @@ async def async_download_previews(thumbnails_directory, pcoll):
|
|||||||
# TODO: trigger re-draw
|
# TODO: trigger re-draw
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
|
||||||
region = pcoll.context.window.screen.regions[0]
|
|
||||||
print('We have a region: {}'.format(region))
|
|
||||||
except IndexError:
|
|
||||||
region = None
|
|
||||||
|
|
||||||
def thumbnail_loaded(file_desc, thumb_path):
|
def thumbnail_loaded(file_desc, thumb_path):
|
||||||
thumb = pcoll.get(thumb_path)
|
thumb = pcoll.get(thumb_path)
|
||||||
if thumb is None:
|
if thumb is None:
|
||||||
@ -199,11 +192,6 @@ async def async_download_previews(thumbnails_directory, pcoll):
|
|||||||
thumb.icon_id,
|
thumb.icon_id,
|
||||||
len(enum_items)))
|
len(enum_items)))
|
||||||
# TODO: trigger re-draw
|
# TODO: trigger re-draw
|
||||||
if region is not None:
|
|
||||||
try:
|
|
||||||
region.tag_redraw()
|
|
||||||
except Exception as e:
|
|
||||||
print('WE DIE! ', e)
|
|
||||||
|
|
||||||
if node_uuid:
|
if node_uuid:
|
||||||
# Make sure we can go up again.
|
# Make sure we can go up again.
|
||||||
@ -228,11 +216,6 @@ async def async_download_previews(thumbnails_directory, pcoll):
|
|||||||
'FILE_FOLDER',
|
'FILE_FOLDER',
|
||||||
len(enum_items)))
|
len(enum_items)))
|
||||||
# TODO: trigger re-draw
|
# TODO: trigger re-draw
|
||||||
if region is not None:
|
|
||||||
try:
|
|
||||||
region.tag_redraw()
|
|
||||||
except Exception as e:
|
|
||||||
print('WE DIE! ', e)
|
|
||||||
else:
|
else:
|
||||||
# TODO: add "nothing here" icon and trigger re-draw
|
# TODO: add "nothing here" icon and trigger re-draw
|
||||||
pass
|
pass
|
||||||
@ -340,7 +323,6 @@ def register():
|
|||||||
pcoll.project_uuid = ''
|
pcoll.project_uuid = ''
|
||||||
pcoll.node_uuid = ''
|
pcoll.node_uuid = ''
|
||||||
pcoll.async_task = None
|
pcoll.async_task = None
|
||||||
pcoll.context = None
|
|
||||||
|
|
||||||
preview_collections["blender_cloud"] = pcoll
|
preview_collections["blender_cloud"] = pcoll
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user