Notifications
Clear all

[Closed] Issue with ATSOps.RetargetAssets

Hello,

I’m using ATSOps.RetargetAssets to relink broken files, sometimes it works, the path and filename are updated in the asset manager and the file is no longer marked as #missing. But most of the time it doesn’t do anything, though it returns true, nothing happens in the asset manager and the files are still marked as #missing.

ATSOps.RetargetAssets rootnode oldFile newFile

Am I doing something wrong?

Thanks

5 Replies

Did you try calling:

ATSOps.Refresh() 

That should force a refresh of the info.

-Eric

Yep, I tried Refresh(), as well as clicking on the update button in the Asset Tracking with no luck.

What’s frustrating is that sometimes it works like a charm, doing what it’s supposed to, and sometimes it doesn’t do anything though returning true

It’s a bit unpredictable. I also tried with the following code:

ATSOps.Refresh()
ATSOps.ClearSelection()
ATSOps.SelectFiles #(AFile)
if ATSOps.SetPathOnSelection newFilepath then replacedCount = replacedCount + 1


It works but this is only for updating the path I believe, to change the filename I need “RetargetAssets” isn’t it?

I wanted to keep something rather simple, I’d prefer if I can avoid to loop through evey objects / maps in the scene…

Hi,Fouinard . I also meet the same problem with you. did you find out solution ? Thank you!

Well it’s been a while, I believe didn’t find any reliable solution. If I remember correctly, I had to open the asset tracking window and manually update the asset list, then the code would work. Again I’m not sure about that, I’ll check the code on monday.