Merge remote-tracking branch 'origin/blender-v2.81-release' into blender-v2.82-release

This was neglected in the 2.81 development cycle, so master didn't
include some commits when we created this branch.
This commit is contained in:
Dalai Felinto 2020-01-13 13:26:35 +01:00
commit 2ffb35765e
3 changed files with 11 additions and 5 deletions

View File

@ -659,11 +659,14 @@ def draw_callback_2d_progress(self, context):
for threaddata in download.download_threads:
asset_data = threaddata[1]
tcom = threaddata[2]
directory = paths.get_temp_dir('%s_search' % asset_data['asset_type'])
tpath = os.path.join(directory, asset_data['thumbnail_small'])
img = utils.get_hidden_image(tpath, asset_data['id'])
if tcom.passargs.get('downloaders'):
for d in tcom.passargs['downloaders']:
directory = paths.get_temp_dir('%s_search' % asset_data['asset_type'])
tpath = os.path.join(directory, asset_data['thumbnail_small'])
img = utils.get_hidden_image(tpath, 'rating_preview')
loc = view3d_utils.location_3d_to_region_2d(bpy.context.region, bpy.context.space_data.region_3d,
d['location'])
if loc is not None:

View File

@ -252,11 +252,12 @@ def get_hidden_image(tpath, bdata_name, force_reload=False):
img.filepath = tpath
img.reload()
img.colorspace_settings.name = 'Linear'
elif force_reload:
if img.packed_file is not None:
img.unpack(method='USE_ORIGINAL')
img.reload()
img.colorspace_settings.name = 'Linear'
img.colorspace_settings.name = 'Linear'
return img

View File

@ -80,7 +80,8 @@ def faces_from_mesh(ob, global_matrix, use_mesh_modifiers=False):
import bpy
# get the editmode data
ob.update_from_editmode()
if ob.mode == "EDIT":
ob.update_from_editmode()
# get the modifiers
if use_mesh_modifiers:
@ -94,6 +95,7 @@ def faces_from_mesh(ob, global_matrix, use_mesh_modifiers=False):
mesh = mesh_owner.to_mesh()
except RuntimeError:
return
if mesh is None:
return