Refactor code to use AyonAssetContainer instead of AssetContainer

This commit is contained in:
Simone Barbieri 2023-05-09 11:01:18 +01:00
parent cb13e94467
commit 41bd47d9b5
3 changed files with 5 additions and 5 deletions

View file

@ -50,7 +50,7 @@ class LayoutLoader(plugin.Loader):
# Get all the asset containers
for a in asset_content:
obj = ar.get_asset_by_object_path(a)
if obj.get_asset().get_class().get_name() == 'AssetContainer':
if obj.get_asset().get_class().get_name() == 'AyonAssetContainer':
asset_containers.append(obj)
return asset_containers
@ -338,7 +338,7 @@ class LayoutLoader(plugin.Loader):
).replace('\\', '/')
_filter = unreal.ARFilter(
class_names=["AssetContainer"],
class_names=["AyonAssetContainer"],
package_paths=[anim_path],
recursive_paths=False)
containers = ar.get_assets(_filter)
@ -519,7 +519,7 @@ class LayoutLoader(plugin.Loader):
for asset in assets:
obj = ar.get_asset_by_object_path(asset).get_asset()
if obj.get_class().get_name() == 'AssetContainer':
if obj.get_class().get_name() == 'AyonAssetContainer':
container = obj
if obj.get_class().get_name() == 'Skeleton':
skeleton = obj

View file

@ -107,7 +107,7 @@ class UAssetLoader(plugin.Loader):
for asset in asset_content:
obj = ar.get_asset_by_object_path(asset).get_asset()
if not obj.get_class().get_name() == 'AssetContainer':
if not obj.get_class().get_name() == 'AyonAssetContainer':
unreal.EditorAssetLibrary.delete_asset(asset)
update_filepath = get_representation_path(representation)

View file

@ -48,7 +48,7 @@ class ExtractLayout(publish.Extractor):
# Search the reference to the Asset Container for the object
path = unreal.Paths.get_path(mesh.get_path_name())
filter = unreal.ARFilter(
class_names=["AssetContainer"], package_paths=[path])
class_names=["AyonAssetContainer"], package_paths=[path])
ar = unreal.AssetRegistryHelpers.get_asset_registry()
try:
asset_container = ar.get_assets(filter)[0].get_asset()