Assets: Get asset path via new identifier (not via file browser hacks)
With the asset identifier introduced in the previous commit, we can now locate an asset just from its `AssetRepresentation`, without requiring information from the asset library and the file browser storage. With this we can remove some hacks and function parameters. A RNA/BPY function is also affected, but I didn't remove the paramter to keep compatibility. It's simply ignored and not required anymore, noted this in the parameter description (noted for T102877).
This commit is contained in:
@@ -97,13 +97,12 @@ class ASSET_OT_open_containing_blend_file(Operator):
|
||||
|
||||
def execute(self, context):
|
||||
asset_file_handle = context.asset_file_handle
|
||||
asset_library_ref = context.asset_library_ref
|
||||
|
||||
if asset_file_handle.local_id:
|
||||
self.report({'WARNING'}, "This asset is stored in the current blend file")
|
||||
return {'CANCELLED'}
|
||||
|
||||
asset_lib_path = bpy.types.AssetHandle.get_full_library_path(asset_file_handle, asset_library_ref)
|
||||
asset_lib_path = bpy.types.AssetHandle.get_full_library_path(asset_file_handle)
|
||||
self.open_in_new_blender(asset_lib_path)
|
||||
|
||||
wm = context.window_manager
|
||||
|
||||
@@ -862,8 +862,7 @@ def asset_path_str_get(_self):
|
||||
if asset_file_handle.local_id:
|
||||
return "Current File"
|
||||
|
||||
asset_library_ref = bpy.context.asset_library_ref
|
||||
return bpy.types.AssetHandle.get_full_library_path(asset_file_handle, asset_library_ref)
|
||||
return bpy.types.AssetHandle.get_full_library_path(asset_file_handle)
|
||||
|
||||
|
||||
def register_props():
|
||||
|
||||
Reference in New Issue
Block a user