Scripting:how can I import the asset folder by script?

var audiofile = studio.project.workspace.masterAssetFolder.getAsset(“sfx_char_skill01_blast_r01.wav”)
audiofile.setAssetPath(“sfx/sfx_char_skill01_blast_r01.wav”)

I used the codes to set audiofile folder, but the folder shows #unimported, how can I import the folder by script?
image

Hi,

Apologies for the delayed response.

Currently, we do not have the functionality to create a folder via a script that can be imported into the asset browser. I will suggest this to our development team to look into further.

Is the issue fixed?

Hi,

Unfortunately not. I have bumped the task.

Once there are updates I will post them here.

1 Like

Any update on this? I’m running into the same issue from slightly different context (folders/files created outside of FMOD but importing the audio file via script)

I’ve noticed right clicking on the folder (or parent folders) and selecting “Import Contents” fixes the issue. Is there a way to trigger that same behaviour from a script?

Hi,

Unfortunately not. The task is still in our backlog.

I will note your interest.

Thanks for the quick reply.

Is there no work around? It’s the only thing left in our automated workflow and while it technically does still work, I’m not sure what effects having unimported folders has on the project/version control.

Unfortunately not.

The main issue with the #unimported tag is those folders will be ignored by our integrated source control systems: FMOD Studio | Managing Assets - Unimported Files. If you are using your own source control they should be safely ignored. But when manually interacting with the project, I would suggest importing them. Please let me know if you run into any issues.