In Cocos Creator 3.8.3, I have a spine asset which consist of one spine.atlas file, one spine.png file and multiple json files like spine1.json, spine2.json and spine3.json.
I am encountering error when importing the spine asset due to cocos editor tries to find spine1.atlas, spine2.atlas and spine3.atlas. I was able to do this in cocos 2.4 by altering spine-meta.js in the engine but I wasn’t able to locate the same file or its counterpart in 3.8.3. Is there any way I can customize the path of the atlas to load?
Error messages:
[Assets] Importer exec failed: /Users/user/Documents/Projects/Cocos/TestSpine/assets/spine1.json
[Assets] Can not find /Users/user/Documents/Projects/Cocos/TestSpine/assets/spine1.atlas
[Assets] Can not find /Users/user/Documents/Projects/Cocos3.0/TestSpineCyka/assets/spineboy-pro_atlas_portal.atlas
What I want to achieve is to detect the file name of the json file with ‘_atlas’ then get the string before the ‘_atlas’ text and load the atlas file with the string.
If the above mentioned is achieved in this demo, when the json file spineboy-pro_atlas_portal.json is loaded, the ‘_atlas’ string in the file name is found so it will load spineboy-pro.atlas instead of spineboy-pro_atlas_portal.atlas.
I was able to customize this in cocos 2.4.7 by changing the contents in spine-meta.js but I could not find its counterpart in cocos 3.8.3.
Sorry for the late reply. I was able to achieve this by altering the searchAtlas function in spine-meta.ts in Cocos 2.4.7, I modify the value of the path variable with conditions.
Thank you, I am aware of this approach and it is what I am trying to avoid as there is no point having multiple atlas files when they have the same content.