[SOLVED] Reimport materials that were exported in json format: Is it possible now?

Hi!

One of my colleague accidently deleted a folder of 600 materials and sadly, our last checkpoint (in version control) was before the materials were made.

Luckily, we have all of them exported in Json format.

1 - Is it possible to recreate an asset material based on the exported json?

I know that I can open the Json file,verify all the parameters one by one and edit recreate them in the editor, but, I prefer something automatic, because 600 x lots of params, it’s a long run…

When I import the exported material (in json format), in the editor, it is a json asset, so my second question is:

2 - Is it possible to convert a json asset to a material asset?

Thank you

That’s quite unfortunate, there isn’t an official way of importing a material in editor from the .json asset.

But the unofficial editor API can be leveraged for this, hold on I may have some code handy.

Here you go, use the code from this forum post, if you have any question feel free to ask. I’ve just verified that it works quite ok:

3 Likes

Wow! This is very interesting! It’s working well!

In fact, you are not far away to have a tool for that.

Thank you for your fast response.

1 Like