Hi,
I’m making a scene importer for Unity for glTF format using new experimental ScriptedImporter API. This format has “main” .gltf file with scene description, and possibly one or more .buffer files containing binary data. I faced the problem that I can’t access secondary files during import. The problem is that Unity copies original file (main file) to Assets directory and then passes it for import. Then OnImportAsset() function is called with ctx containing the path of copied glTF file. Secondary files containing geometry information are not copied and located at path which was selected with “Import New Asset” menu command. When my importer tries to access a secondary file using ctx.assetPath or ScriptedImporter.assetPath, it fails because the file wasn’t copied.
Is there any way of getting the path of original imported asset from ScriptedImporter? I’ve checked AlembicImporter and UsdImporter code from Github, but it seems these plugins doesn’t access any files except the “main” one, i.e. they are not trying to load any texture etc.
Probably I’m doing something wrong? Or I should consider using older approach for importing resources, when I’m binding importer to menu command, showing import GUI etc? Could anyone help me please?