Load glTF File Relative to Scene.ron

(Zicklag) #1

In the glTF scene loading example it specifies the glTF file to load in the puffy_scene.ron file. If I do something similar like this:

data: (
    gltf: File("export.gltf", GltfSceneFormat, (
        load_animations: true,
        flip_v_coord: true,
    tag: (),

It will look for export.gltf relative to the application binary. Is there any way to make it look relative to the .ron file?

(Zicklag) #2

OK, I figured out how to do it relative to the working dir by copying the AssetPrefab class and changing it to a RelativeAssetPrefab class that uses Loader.add_source() to add the working directory as a Loader source and then changes the load() call to a load_from() call.

That suffices for me for now. I might do it different later, but right now I don’t care how it works, if it works.

1 Like