Struct hapi_rs::geometry::Geometry

source ·
pub struct Geometry {
    pub node: HoudiniNode,
    /* private fields */
}
Expand description

Represents a SOP node with methods for manipulating geometry.

Fields§

§node: HoudiniNode

Implementations§

source§

impl Geometry

source

pub fn part_info(&self, part_id: i32) -> Result<PartInfo>

source

pub fn volume_info(&self, part_id: i32) -> Result<VolumeInfo>

source

pub fn set_volume_info(&self, part_id: i32, info: &VolumeInfo) -> Result<()>

source

pub fn volume_bounds(&self, part_id: i32) -> Result<VolumeBounds>

source

pub fn geo_info(&self) -> Result<GeoInfo>

Get information about Node’s geometry. Note: The node must be cooked before calling this method.

source

pub fn set_part_info(&self, info: &PartInfo) -> Result<()>

source

pub fn box_info(&self, part_id: i32) -> Result<BoxInfo>

source

pub fn sphere_info(&self, part_id: i32) -> Result<BoxInfo>

source

pub fn set_curve_info(&self, part_id: i32, info: &CurveInfo) -> Result<()>

source

pub fn set_input_curve_info( &self, part_id: i32, info: &InputCurveInfo ) -> Result<()>

source

pub fn get_input_curve_info(&self, part_id: i32) -> Result<InputCurveInfo>

source

pub fn set_input_curve_positions( &self, part_id: i32, positions: &[f32] ) -> Result<()>

source

pub fn set_input_curve_transform( &self, part_id: i32, positions: &[f32], rotation: &[f32], scale: &[f32] ) -> Result<()>

source

pub fn set_curve_counts(&self, part_id: i32, count: &[i32]) -> Result<()>

source

pub fn set_curve_knots(&self, part_id: i32, knots: &[f32]) -> Result<()>

source

pub fn set_vertex_list( &self, part_id: i32, list: impl AsRef<[i32]> ) -> Result<()>

source

pub fn set_face_counts( &self, part_id: i32, list: impl AsRef<[i32]> ) -> Result<()>

source

pub fn update(&mut self) -> Result<()>

source

pub fn curve_info(&self, part_id: i32) -> Result<CurveInfo>

source

pub fn curve_counts( &self, part_id: i32, start: i32, length: i32 ) -> Result<Vec<i32>>

Retrieve the number of vertices for each curve in the part.

source

pub fn curve_orders( &self, part_id: i32, start: i32, length: i32 ) -> Result<Vec<i32>>

Retrieve the orders for each curve in the part if the curve has varying order.

source

pub fn curve_knots( &self, part_id: i32, start: i32, length: i32 ) -> Result<Vec<f32>>

Retrieve the knots of the curves in this part.

source

pub fn vertex_list(&self, part: Option<&PartInfo>) -> Result<Vec<i32>>

Get array containing the vertex-point associations where the ith element in the array is the point index the ith vertex associates with.

source

pub fn partitions(&self) -> Result<Vec<PartInfo>>

source

pub fn get_face_counts(&self, part: Option<&PartInfo>) -> Result<Vec<i32>>

source

pub fn get_materials( &self, part: Option<&PartInfo> ) -> Result<Option<Materials>>

Return material nodes applied to geometry.

source

pub fn get_group_names(&self, group_type: GroupType) -> Result<StringArray>

Get geometry group names by type.

source

pub fn get_edge_count_of_edge_group( &self, group: &str, part_id: i32 ) -> Result<i32>

source

pub fn get_element_count_by_owner( &self, part: Option<&PartInfo>, owner: AttributeOwner ) -> Result<i32>

Get num geometry elements by type (points, prims, vertices).

source

pub fn get_attribute_count_by_owner( &self, part: Option<&PartInfo>, owner: AttributeOwner ) -> Result<i32>

Get number of attributes by type.

source

pub fn get_attribute_names( &self, owner: AttributeOwner, part: Option<&PartInfo> ) -> Result<StringArray>

source

pub fn get_position_attribute(&self, part_id: i32) -> Result<NumericAttr<f32>>

Convenient method for getting the P attribute

source

pub fn get_attribute( &self, part_id: i32, owner: AttributeOwner, name: &str ) -> Result<Option<Attribute>>

Get geometry attribute by name and owner.

source

pub fn add_numeric_attribute<T: AttribAccess>( &self, name: &str, part_id: i32, info: AttributeInfo ) -> Result<NumericAttr<T>>

Add a new numeric attribute to geometry.

source

pub fn add_numeric_array_attribute<T>( &self, name: &str, part_id: i32, info: AttributeInfo ) -> Result<NumericArrayAttr<T>>where T: AttribAccess, [T]: ToOwned<Owned = Vec<T>>,

Add a new numeric array attribute to geometry.

source

pub fn add_string_attribute( &self, name: &str, part_id: i32, info: AttributeInfo ) -> Result<StringAttr>

Add a new string attribute to geometry

source

pub fn add_string_array_attribute( &self, name: &str, part_id: i32, info: AttributeInfo ) -> Result<StringArrayAttr>

Add a new string array attribute to geometry.

source

pub fn add_group( &self, part_id: i32, group_type: GroupType, group_name: &str, membership: Option<&[i32]> ) -> Result<()>

Create a new geometry group .

source

pub fn delete_group( &self, part_id: i32, group_type: GroupType, group_name: &str ) -> Result<()>

Delete a geometry group.

source

pub fn set_group_membership( &self, part_id: i32, group_type: GroupType, group_name: &str, array: &[i32] ) -> Result<()>

Set element membership for a group.

source

pub fn get_group_membership( &self, part_info: Option<&PartInfo>, group_type: GroupType, group_name: &str ) -> Result<Vec<i32>>

Get element membership for a group.

source

pub fn group_count_by_type( &self, group_type: GroupType, info: Option<&GeoInfo> ) -> Result<i32>

Number of geometry groups by type.

source

pub fn get_instanced_part_ids( &self, part_info: Option<&PartInfo> ) -> Result<Vec<i32>>

source

pub fn get_group_count_on_packed_instance( &self, part_info: Option<&PartInfo> ) -> Result<(i32, i32)>

source

pub fn get_instance_part_groups_names( &self, group: GroupType, part_id: i32 ) -> Result<StringArray>

source

pub fn get_instance_part_transforms( &self, part_info: Option<&PartInfo>, order: RSTOrder ) -> Result<Vec<Transform>>

source

pub fn save_to_file(&self, filepath: &str) -> Result<()>

source

pub fn load_from_file(&self, filepath: &str) -> Result<()>

source

pub fn commit(&self) -> Result<()>

source

pub fn revert(&self) -> Result<()>

source

pub fn save_to_memory(&self, format: GeoFormat) -> Result<Vec<i8>>

source

pub fn load_from_memory(&self, data: &[i8], format: GeoFormat) -> Result<()>

source

pub fn read_volume_tile<T: VolumeStorage>( &self, part: i32, fill: T, tile: &VolumeTileInfo, values: &mut [T] ) -> Result<()>

source

pub fn write_volume_tile<T: VolumeStorage>( &self, part: i32, tile: &VolumeTileInfo, values: &[T] ) -> Result<()>

source

pub fn read_volume_voxel<T: VolumeStorage>( &self, part: i32, x_index: i32, y_index: i32, z_index: i32, values: &mut [T] ) -> Result<()>

source

pub fn write_volume_voxel<T: VolumeStorage>( &self, part: i32, x_index: i32, y_index: i32, z_index: i32, values: &[T] ) -> Result<()>

source

pub fn foreach_volume_tile( &self, part: i32, info: &VolumeInfo, callback: impl Fn(Tile<'_>) ) -> Result<()>

Iterate over volume tiles and apply a function to each tile.

source

pub fn create_heightfield_input( &self, parent: impl Into<Option<NodeHandle>>, volume_name: &str, x_size: i32, y_size: i32, voxel_size: f32, sampling: HeightFieldSampling ) -> Result<HeightfieldNodes>

source

pub fn create_heightfield_input_volume( &self, parent: impl Into<Option<NodeHandle>>, volume_name: &str, x_size: i32, y_size: i32, voxel_size: f32 ) -> Result<HoudiniNode>

Trait Implementations§

source§

impl Clone for Geometry

source§

fn clone(&self) -> Geometry

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Geometry

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.