Another question for any Python wizards
Following this Editor scripting workshop
but have 2 questions.
1 My simple functions take a LONG time to execute, up to 30 seconds sometimes on a farirly simple project (Northwood demo). In the walkthru they execute almost immediately.
2 Encountering several warnings containing
…Accepting ObjectPaths is deprecated behavior and will be removed in a future release; TryConvertFilenameToLongPackageName will fail on ObjectPaths.
This is with the following simple method >
def getAssetClass():
EAL = unreal.EditorAssetLibrary
assetPaths = EAL.list_assets(‘/Game’)
for assetPath in assetPaths:
assetData = EAL.find_asset_data(assetPath)
assetClass = assetData.asset_class
print(assetClass)
What version of Engine are you using? There are a couple changes from 5.0 to 5.1 that make parts of the 5.0 tutorial outdated. One change is that EAL.find_asset_data() takes a slightly modified asset path than returned by list_assets(). You need to remove the last part of the path after the period.
One solution is to add this line as the first line in the for loop
With 5.1, the property asset_class has been deprecated. It can now be found within the new property asset_class_path. You need to edit the assignment of the variable assetClass.
It appears to be the “GetClass” node that is throwing the warning. I’m not sure if there’s a way to get around that currently in BP. I attempted to use GetPrimaryAssetIDFromObject, and then GetClassFromPrimaryAssetID but that didn’t appear to work, got access nones coming out of those class pins.
I have the same problem. Have you found a solution?
Script execution is very slow in UE5.3, it takes about 3 minutes to print all the actors in the scene, during which you can’t do anything with the UE editor. I even thought UE editor was unresponsive.
I used UE5.2 for comparison and found that it reduced the execution time to 20 seconds, but it still wasn’t as responsive as the tutorial.
My computer configuration is 12900K+RTX6000 ADA, which should not affect the running speed.
def getAssetClass():
EAL = unreal.EditorAssetLibrary()
assetPaths = EAL.list_assets('/Game')
for assetPath in assetPaths:
assetData = EAL.find_asset_data(assetPath)
assetClass = assetData.asset_class_path.asset_name
print (assetClass)
apparently the warnings of
LogPackageName: Warning: TryConvertFilenameToLongPackageName was passed an ObjectPath … Accepting ObjectPaths is deprecated behavior and will be removed in a future release
is harmless and nothing in the 5.3 python documentation discusses alternatives.