Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-11-23 20:40:31 +0300
committerJulian Eisel <julian@blender.org>2021-11-23 20:40:31 +0300
commit9e5aae4215d0070c2af7da970a9fb1950ed7f4db (patch)
tree87f0125638896aa988e3cadd835c03495ae2b80f /release/scripts/startup/bl_operators/assets.py
parent792badcfefcb92aadc16346f0dc11299a8da0ced (diff)
Asset: Merge asset library/list refresh operators
In rBdcdbaf89bd11, I introduced a new operator (`file.asset_library_refresh()`) to handle Asset Browser refreshing more separate from File Browser refreshing. However, there already was `asset.asset_list_refresh()`, which at this point only works for asset view templates, but was intended to cover the Asset Browser case in future too. This would happen once the Asset Browser uses the asset list design of the asset view template. So rather than having two operators for refreshing asset library data, have one that just handles both cases, until they converge into one. This avoids changes to the Python API in future (deprecating/changing operators). Differential Revision: https://developer.blender.org/D13239
Diffstat (limited to 'release/scripts/startup/bl_operators/assets.py')
-rw-r--r--release/scripts/startup/bl_operators/assets.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_operators/assets.py b/release/scripts/startup/bl_operators/assets.py
index 58f02201905..32e63f77b23 100644
--- a/release/scripts/startup/bl_operators/assets.py
+++ b/release/scripts/startup/bl_operators/assets.py
@@ -142,14 +142,8 @@ class ASSET_OT_open_containing_blend_file(Operator):
if returncode:
self.report({'WARNING'}, "Blender sub-process exited with error code %d" % returncode)
- # TODO(Sybren): Replace this with a generic "reload assets" operator
- # that can run outside of the Asset Browser context.
- if bpy.ops.file.refresh.poll():
- bpy.ops.file.refresh()
- if bpy.ops.asset.list_refresh.poll():
- bpy.ops.asset.list_refresh()
- if bpy.ops.file.asset_library_refresh.poll():
- bpy.ops.file.asset_library_refresh()
+ if bpy.ops.asset.library_refresh.poll():
+ bpy.ops.asset.library_refresh()
self.cancel(context)
return {'FINISHED'}