Closed coolcatcoder closed 11 months ago
I'm struggling to think of a reason why one might want to do such a thing. Could you provide a motivating example?
I cannot provide a motivating example. However I can provide an example lol. What I would wish to do is create a const array of vertices, and a const array of indices, for use with vulkano. Sure I could manually create these by hand, but it would be easier to grab them from gltf in a const function.
You could use gltf
from inside a build script of your package, which can run whatever kind of non-const calculation it wants, and generate Rust code containing constant arrays (either with simple string formatting, or uneval
) which can then be included in your main program with include!
or mod
.
Ooh that sounds good, thanks for the info!
Not sure if this is the right place to ask, but is there anyway to read/load/open gltf in a constant function?