# Warning\> Accepting ObjectPaths is deprecated behavior and will be removed in a future release;

**URL:** <https://forums.unrealengine.com/t/warning-accepting-objectpaths-is-deprecated-behavior-and-will-be-removed-in-a-future-release/879031>\
**Category:** Pipeline & Plugins\
**Tags:** Python, unreal-engine\
**Created:** [April 8, 2023, 7:07pm UTC](https://forums.unrealengine.com/t/warning-accepting-objectpaths-is-deprecated-behavior-and-will-be-removed-in-a-future-release/879031 "2023-04-08T19:07:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![eco\_bach2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@eco\_bach2](https://forums.unrealengine.com/u/eco_bach2)\
**Post date:** [April 8, 2023, 7:07pm UTC](https://forums.unrealengine.com/t/warning-accepting-objectpaths-is-deprecated-behavior-and-will-be-removed-in-a-future-release/879031/1 "2023-04-08T19:07:43Z")

</div>

Another question for any Python wizards  
Following this Editor scripting workshop

> **[Utilizing Python for Editor Scripting in Unreal Engine | Course](https://dev.epicgames.com/community/learning/courses/wk4/utilizing-python-for-editor-scripting-in-unreal-engine/KJMr/unreal-engine-getting-asset-class)**
>
> Gain an in-depth understanding of how to build simple, powerful tools with Python to optimize performance and production. Together, we will install our ...

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)

Why?

---

<div class="post-metadata">

**Author:** ![Abezod](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Abezod](https://forums.unrealengine.com/u/Abezod)\
**Post date:** [June 7, 2023, 11:24pm UTC](https://forums.unrealengine.com/t/warning-accepting-objectpaths-is-deprecated-behavior-and-will-be-removed-in-a-future-release/879031/2 "2023-06-07T23:24:22Z")

</div>

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

```auto
asset_path = asset_path.split('.')[0]

```

Another difference is the AssetData structure/class itself. See the differences here:  
[https://docs.unrealengine.com/5.0/en-US/PythonAPI/class/AssetData.html#unreal.AssetData](https://docs.unrealengine.com/5.0/en-US/PythonAPI/class/AssetData.html#unreal.AssetData)  
[https://docs.unrealengine.com/5.1/en-US/PythonAPI/class/AssetData.html#unreal.AssetData](https://docs.unrealengine.com/5.1/en-US/PythonAPI/class/AssetData.html#unreal.AssetData)

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.

```auto
asset_class = asset_data.asset_class_path.asset_name

```

---

<div class="post-metadata">

**Author:** ![kom8686](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kom8686](https://forums.unrealengine.com/u/kom8686)\
**Post date:** [August 22, 2023, 3:27pm UTC](https://forums.unrealengine.com/t/warning-accepting-objectpaths-is-deprecated-behavior-and-will-be-removed-in-a-future-release/879031/3 "2023-08-22T15:27:00Z")

</div>

Thanks it works!  
But I´m also having the problem of taking a long time to execute.  
Do you guys know why?  
Thank you so much for the help!

---

<div class="post-metadata">

**Author:** ![00k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@00k](https://forums.unrealengine.com/u/00k)\
**Post date:** [September 19, 2023, 1:34am UTC](https://forums.unrealengine.com/t/warning-accepting-objectpaths-is-deprecated-behavior-and-will-be-removed-in-a-future-release/879031/4 "2023-09-19T01:34:11Z")

</div>

I’m seeing this error in a BP only project. What BP node would I be using that would cause this warning?

---

<div class="post-metadata">

**Author:** ![00k](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@00k](https://forums.unrealengine.com/u/00k)\
**Post date:** [September 19, 2023, 1:48am UTC](https://forums.unrealengine.com/t/warning-accepting-objectpaths-is-deprecated-behavior-and-will-be-removed-in-a-future-release/879031/5 "2023-09-19T01:48:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Anonymous\_1e7db6e38aeac73dc6259a0f8c4444e8](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/anonymous_1e7db6e38aeac73dc6259a0f8c4444e8/32/745265_2.png) [@Anonymous\_1e7db6e38aeac73dc6259a0f8c4444e8](https://forums.unrealengine.com/u/Anonymous_1e7db6e38aeac73dc6259a0f8c4444e8)\
**Post date:** [December 21, 2023, 3:43am UTC](https://forums.unrealengine.com/t/warning-accepting-objectpaths-is-deprecated-behavior-and-will-be-removed-in-a-future-release/879031/6 "2023-12-21T03:43:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shulideren](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shulideren/32/728662_2.png) [@shulideren](https://forums.unrealengine.com/u/shulideren)\
**Post date:** [February 26, 2024, 2:06pm UTC](https://forums.unrealengine.com/t/warning-accepting-objectpaths-is-deprecated-behavior-and-will-be-removed-in-a-future-release/879031/7 "2024-02-26T14:06:36Z")

</div>

> [@Abezod](#):
>
> `asset_path = asset_path.split('.')[0]`

def getAssetClass():  
EAL = unreal.EditorAssetLibrary  
assetPaths = EAL.list\_assets(‘/Game/autoCreated’)

```
for assetPath in assetPaths:
    assetData = EAL.find_asset_data(assetPath)
    assetclass = assetData.asset_class_path.asset_name

    print(assetclass)

```

> **总结**
>
> 此文本将被隐藏

---

<div class="post-metadata">

**Author:** ![Some](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/some/32/1046037_2.png) [@Some](https://forums.unrealengine.com/u/Some)\
**Post date:** [March 27, 2024, 9:14pm UTC](https://forums.unrealengine.com/t/warning-accepting-objectpaths-is-deprecated-behavior-and-will-be-removed-in-a-future-release/879031/8 "2024-03-27T21:14:39Z")

</div>

Fixed code up until 5:20 in the video:

```auto

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.
