[SOLVED] Change ID of asset

Hi everyone !

I messed up and deleted a material. The undo button didn’t do anything so I just lost it and voila…
I remade it with the same name, but all the models that where using it are showing “Missing”, because of course they are looking for the old material’s ID.

Is there an easy way to set that old ID on my new material?

Thanks in advance for the help !

PS: When will we have a trashbin for the deleted files? :stuck_out_tongue:

My only idea was to export the project, edit the assets.json file, and import it.
But this project is a nightmare with way to big models (can’t do anything about it :frowning: ), and the 3Go export file gets an 504 timeout error on importing.

Unfortunately deletion of assets is undo-able.

I can’t think of an easy way to replace missing materials with a new one unfortunately :frowning:

Ideally the version control should allow you revert an individual change like this but that’s not implemented.

The ticket hasn’t had many upvotes so we haven’t prioritised it: Undo asset deletion · Issue #773 · playcanvas/editor · GitHub

I will refloat this to the team and see if this is something that we internally think it’s important enough to look at sooner.

@yak32 This is the timeout issue again on large imports where the API timeouts out if the the upload takes too long.

1 Like

Thanks for the response !
Welps, looks like I’ll have to replace them all by hand :sweat_smile:
At least I could get the material data back by searching in one of the builds…

I deleted all my “model (source)” files, and it went down to 2.4go, but still timeout.

Tried this on a smaller project, and that’s a fail haha, can’t cheat with these files.

Not sure if it is possible in your case, but maybe the search function of the hierarchy or asset panel can be helpful to find the right entities.

1 Like

That could have been usefull in some of my projects but not in this one, this material was used in nearly all models (50+) and all I can do is look at all of them and replace :sweat_smile:

1 Like

2 days of replacing everything, what a lesson to watch out what I delete haha

I didn’t use the version control because of the quantity of high poly models I have.
When my client makes some changes on those models, he generates a new FBX so I guess playcanvas will see this like a fully new file, so the version control will explode in size…

What I can do is export the project at a regular basis, storing it on my own server. If the timeout problem is solved I could use those exports to repair my future mistakes :slight_smile:

Use the version control. If you need more storage, let us know and we can bump it up