pub struct SceneImport {
pub source: String,
pub texture_max_size: u32,
pub emissive_map_strength: f32,
pub emit_camera: bool,
}Expand description
Imports a 3D scene file as a single declaration.
One SceneImport stands in for the whole asset graph a scene file
describes: its Textures, Materials,
Meshes, Models, and Props. The build expands the
import into those concrete assets, so world.jsonl stays small and
human-editable while the full graph lives in the lock file and compiled
blob. Geometry and texture pixels are never inlined into world.jsonl.
Supported source formats: .fbx and .glb.
Generated names are prefixed with the import’s own asset name
(<name>_mat_0, <name>_prim_0, <name>_model_0, …), so they never
clash with hand-authored assets. Because they only appear in the lock file
and blob, you never reference them by hand.
Camera: the import frames a Camera3D to the scene’s bounds
so a freshly imported scene is immediately viewable. It is suppressed when
the world already declares a Camera3D (yours wins) or when emit_camera
is set to false.
SceneImport {
source: "assets/Bistro/BistroExterior.fbx".into(),
texture_max_size: 512,
..Default::default()
};Fields§
§source: StringPath to the scene file, relative to the project root. .fbx or .glb.
texture_max_size: u32Ceiling on the longest edge of each imported texture, in pixels. Large
source maps (2K-4K) are box-filtered down so the compiled scene, which
stores uncompressed pixels, stays within a sane memory budget. 0 keeps
each texture at its source resolution.
emissive_map_strength: f32Emissive factor applied to a material that carries an emissive map. Scene files often ship a zero emissive factor that would cancel the map, so a textured emissive gets this punchy factor instead.
emit_camera: boolWhether to emit a Camera3D framed to the scene’s bounds.
Suppressed automatically when the world already declares a Camera3D.
Trait Implementations§
Source§impl Authored for SceneImport
impl Authored for SceneImport
impl BuildOnlyAsset for SceneImport
Source§impl Clone for SceneImport
impl Clone for SceneImport
Source§fn clone(&self) -> SceneImport
fn clone(&self) -> SceneImport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SceneImport
impl Debug for SceneImport
Source§impl Default for SceneImport
impl Default for SceneImport
Source§impl<'de> Deserialize<'de> for SceneImportwhere
SceneImport: Default,
impl<'de> Deserialize<'de> for SceneImportwhere
SceneImport: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SceneImport
impl RefUnwindSafe for SceneImport
impl Send for SceneImport
impl Sync for SceneImport
impl Unpin for SceneImport
impl UnsafeUnpin for SceneImport
impl UnwindSafe for SceneImport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more