You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a set of const custom materials that I need to swap out with the standard materials that are loaded from GLTF's like so:
These materials are basically a copy of the StandardMaterial with a Thermal glow blending emissivity layered on top. I need a way to indicate that I need a specific field from within the AssetCollection.
The two things I can come up with for this are either some macro wizardry to secretly do const handles internally, or using something the key attribute of the asset macro to generate some form of index.
Additionally, you could probably get somewhere with Reflect / get_field, but I have a very strong preference to not litter duplicate &str's around. That specifically would be less of an issue if we could reference Const &str's in macro attributes.
My use case for the key solution would be the ability to reference the handle from a file or a const Material at compile time.
I've got a set of const custom materials that I need to swap out with the standard materials that are loaded from GLTF's like so:
These materials are basically a copy of the StandardMaterial with a Thermal glow blending emissivity layered on top. I need a way to indicate that I need a specific field from within the AssetCollection.
The two things I can come up with for this are either some macro wizardry to secretly do const handles internally, or using something the key attribute of the asset macro to generate some form of index.
Additionally, you could probably get somewhere with Reflect / get_field, but I have a very strong preference to not litter duplicate &str's around. That specifically would be less of an issue if we could reference Const &str's in macro attributes.
My use case for the key solution would be the ability to reference the handle from a file or a const Material at compile time.
Here is an example of where I'm forced to do lookups on the asset_server directly and create a bunch of adidtional consts:
The text was updated successfully, but these errors were encountered: