alexxbb / hapi-rs

Idiomatic Rust bindings to Houdini Engine C API
MIT License
64 stars 7 forks source link

array::DataArray type not exported #8

Closed luxalpa closed 1 year ago

luxalpa commented 1 year ago

The function attribute::NumericArrayAttr::get returns a DataArray, however the type is not being exported from the crate. It is pub, but unfortunately the array module in which it sits is private.

I have a snipped that I would like to move into its own function, but because of the missing type I cannot put it into the functions return type!

    let attrib = geo
        .get_attribute(part.part_id(), AttributeOwner::Point, "boneCapture_data")?
        .ok_or(anyhow::anyhow!(
            "Asset does not have a boneCapture attribute"
        ))?;

    let attrib = attrib
        .downcast::<NumericArrayAttr<f32>>()
        .ok_or(anyhow::anyhow!(
            "Asset has incorrect boneCapture_data attribute"
        ))?;

    let arr = attrib.get(part.part_id())?; // <-- Problem. arr type cannot be named

In this case I can workaround the problem, but I thought I'd report it here.

alexxbb commented 1 year ago

Ah yes, let me push a fix for that.

alexxbb commented 1 year ago

Pushed 0.5.3 with the fix.