alexxbb / hapi-rs

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

Newly created parameters do not show up #25

Open ber2minsin opened 3 months ago

ber2minsin commented 3 months ago

Hey, I am trying to retrieve/update the parameters of some asset, that has dynamic parameters. But the updated parameters can not be found.

Reproducing steps.

  1. Create usd_rop node at /stage
  2. Set the value of outputprocessors parameter to 0
  3. Call press_button on outputprocessors

After step 3, I can not find the parameters "localizeassets_subdirectory" which gets created when you press outputprocessors. Things I tried:

hapi_rs version: 0.10 Houdini version: 19.5.805

alexxbb commented 3 months ago

Hey @ber2minsin I was able to reproduce the issue. Houdini's dynamic parameters (aka script menu parameters) have always been a pain to use in the engine and I've reported several bugs related to them. I suspect this is one of them. For example:

let lop = session.get_node_from_path("/stage", None)?.unwrap();
let usd_rop = session.node_builder("usd_rop").with_parent(lop).create()?;
println!("Total # of parms: {}", usd_rop.info.parm_count());

Will print 65,

while in Hython:

print(len(hou.node('/stage/usd_rop1').parms()))

will print 68.

And this is even before triggering the menu with press_button. Looks like a bug to me, I will ask SideFx about it.

As a workaround, you could try to wrap a usd_rop into an HDA and promote the parameters you're interested to asset parameters.

Cheers.

ber2minsin commented 3 months ago

That is exactly how I worked around it, thank you for the comprehensive response!