Enum Parameter

Source
pub enum Parameter {
    Float(FloatParameter),
    Int(IntParameter),
    String(StringParameter),
    Button(IntParameter),
    Other(BaseParameter),
}
Expand description

Enum of different parameter types.

Variants§

§

Float(FloatParameter)

ParmType::Float | ParmType::Color

§

Int(IntParameter)

ParmType::Int | ParmType::Toggle

§

String(StringParameter)

ParmType::String | ParmType::Node | ParmType::PathFile | ParmType::PathFileDir | ParmType::PathFileGeo | ParmType::PathFileImage

§

Button(IntParameter)

ParmType::Int

§

Other(BaseParameter)

Other ParmType::_

Implementations§

Source§

impl Parameter

Source

pub fn value_as_debug(&self) -> Result<Box<dyn Debug>>

A convenient method to evaluate a parameter value as string for debugging.

Source

pub fn info(&self) -> &ParmInfo

Information about the parameter

Source

pub fn name(&self) -> Result<String>

Parameter internal name

Source

pub fn label(&self) -> Result<String>

Parameter UI label

Source

pub fn size(&self) -> i32

Number or elements in the parameter

Source

pub fn parent(&self) -> Result<Option<ParmInfo>>

Parameter parent if any (examples are multi-parm or Folder type parameters)

Trait Implementations§

Source§

impl Debug for Parameter

Source§

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

Formats the value using the given formatter. Read more
Source§

impl ParmBaseTrait for Parameter

Source§

fn name(&self) -> Result<Cow<'_, str>>

Source§

fn session(&self) -> &Session

Source§

fn node(&self) -> NodeHandle

Source§

fn size(&self) -> i32

Source§

fn info(&self) -> &ParmInfo

Source§

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

Update the internal parameter metadata if Houdini parameter changed, for example children added to a multi-parm or the menu was updated.
Source§

fn is_menu(&self) -> bool

If the parameter has choice menu.
Source§

fn menu_items(&self) -> Result<Option<Vec<ParmChoiceInfo>>>

If parameter is a menu type, return a vec of menu items
Source§

fn multiparm_children(&self) -> Result<Option<Vec<Parameter>>>

If the parameter is a multiparm, return its children parms. NOTE: THis is not a recommended way to traverse parameters in general, this is here for convenience only
Source§

fn insert_multiparm_instance(&self, position: i32) -> Result<()>

Source§

fn remove_multiparm_instance(&self, position: i32) -> Result<()>

Source§

fn expression(&self, index: i32) -> Result<Option<String>>

Returns a parameter expression string
Source§

fn has_expression(&self, index: i32) -> Result<bool>

Checks if parameter has an expression
Source§

fn set_expression(&self, value: &str, index: i32) -> Result<()>

Set parameter expression
Source§

fn remove_expression(&self, index: i32) -> Result<()>

Remove parameter expression
Source§

fn revert_to_default(&self, index: Option<i32>) -> Result<()>

Revert parameter at index to its default value. If index is None - reset all instances.
Source§

fn set_anim_curve(&self, index: i32, keys: &[KeyFrame]) -> Result<()>

Set keyframes on the parameter
Source§

fn has_tag(&self, tag: &str) -> Result<bool>

Source§

fn get_tag_name(&self, tag_index: i32) -> Result<String>

Get parameter tag name by index. The number of tags is stored in self.info().tag_count()
Source§

fn get_tag_value(&self, tag_name: &str) -> Result<String>

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.