I'm having trouble getting a specific Node from a Gltf Scene Asset. #4784
-
if let Some(map) = assets.get(&map.0) {
let floor_option= map.named_nodes.get("Floor");
let floor_option_unwrapped = floor_option.unwrap();
let asset = assets.get(floor_option_unwrapped);
println!("{:?}", asset);
} This what I've got currently. The first variable (floor_option) returns an Option that is Some, more specifically a strong handle, to what I assume is the node I'm trying to get. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
My guess would be that this is because your (To be honest, I was surprised that this compiled, although looking at |
Beta Was this translation helpful? Give feedback.
My guess would be that this is because your
assets
is of typeAssets<Gltf>
, but to get theasset
fromfloor_option_unwrapped
, you would needAssets<GltfNode>
.(To be honest, I was surprised that this compiled, although looking at
Assets::<T>::get::<H>
, it appears that H does not need to be aHandle<T>
, for reasons unknown)