pub struct UsdaWriter { /* private fields */ }Expand description
USDA text format writer.
Builds a .usda file incrementally. Call methods in the order dictated
by the USD hierarchy you wish to produce, then call finish
to obtain the final string.
Implementations§
Source§impl UsdaWriter
impl UsdaWriter
Sourcepub fn write_header(&mut self, up_axis: &str, meters_per_unit: f64)
pub fn write_header(&mut self, up_axis: &str, meters_per_unit: f64)
Write the USDA file header with layer metadata.
up_axis should be "Y" or "Z".
Sourcepub fn write_mesh(&mut self, mesh: &UsdMesh) -> Result<()>
pub fn write_mesh(&mut self, mesh: &UsdMesh) -> Result<()>
Write a complete Mesh prim.
Sourcepub fn write_material(&mut self, mat: &UsdMaterial) -> Result<()>
pub fn write_material(&mut self, mat: &UsdMaterial) -> Result<()>
Write a Material prim with a UsdPreviewSurface shader.
Sourcepub fn write_skeleton(&mut self, skel: &UsdSkeleton) -> Result<()>
pub fn write_skeleton(&mut self, skel: &UsdSkeleton) -> Result<()>
Write a Skeleton prim.
Sourcepub fn write_skin_binding(
&mut self,
mesh_path: &str,
binding: &UsdSkinBinding,
) -> Result<()>
pub fn write_skin_binding( &mut self, mesh_path: &str, binding: &UsdSkinBinding, ) -> Result<()>
Write skin binding properties on an existing mesh prim.
This writes a SkelBindingAPI block that should appear inside or
adjacent to the mesh prim identified by mesh_path.
Sourcepub fn write_blend_shapes(
&mut self,
mesh_path: &str,
shapes: &[UsdBlendShape],
) -> Result<()>
pub fn write_blend_shapes( &mut self, mesh_path: &str, shapes: &[UsdBlendShape], ) -> Result<()>
Write blend shape prims under the given mesh path scope.
Source§impl UsdaWriter
impl UsdaWriter
Sourcepub fn write_blend_shape_animation(
&mut self,
mesh_path: &str,
samples: &[BlendShapeTimeSamples],
) -> Result<()>
pub fn write_blend_shape_animation( &mut self, mesh_path: &str, samples: &[BlendShapeTimeSamples], ) -> Result<()>
Write a SkelAnimation prim with blendShapeWeights.timeSamples.
The prim is named "BodyAnim" and contains:
uniform token purpose = "default"uniform token[] blendShapes— ordered by first appearance across allBlendShapeTimeSamplesentries.float[] blendShapeWeights.timeSamples— every unique time code from all samples, sorted ascending; shapes absent at a given time emit0.0.rel skelTargets = <{mesh_path}>— wheremesh_pathis the USD scene path passed as the second argument (e.g."/Root/Body").
§Errors
Returns an error if formatting the output buffer fails (highly unlikely
in practice because String::write_fmt is infallible for in-memory
buffers, but the method signature is anyhow::Result<()> for
consistency with the rest of the writer API).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UsdaWriter
impl RefUnwindSafe for UsdaWriter
impl Send for UsdaWriter
impl Sync for UsdaWriter
impl Unpin for UsdaWriter
impl UnsafeUnpin for UsdaWriter
impl UnwindSafe for UsdaWriter
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> 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