Dynamic Parameter Generation for Doors in Houdini

   1701   7   1
User Avatar
Member
31 posts
Joined: June 2014
Offline
Hello everyone,

I'm hoping someone can assist me with an issue I'm facing while developing a procedural asset in Houdini.

I have created an asset that procedurally generates rooms and doors within a scene. Each door has position attributes (and possibly other settings) that I would like to expose through the Parameter Interface of the asset to enable easier control over the doors.

My challenge is to dynamically create parameters in the interface for each generated door. Since the number of doors generated can vary, I'm looking for a method to automatically create parameters for each door.

I have already tried using "Create Spare Parameters" in the Parameter Interface, but this method only creates the parameters once and doesn't update them based on the number of generated doors.

I'm sure there's a more advanced way to tackle this issue using Python Scripting in Houdini, but unfortunately, I'm not very experienced with Python.

I would greatly appreciate any suggestions, sample code, or guidelines on how to create dynamic parameters for the generated doors in my asset.

Thank you in advance for your help and advice. Any contribution is highly appreciated!
English is not my native language, sorry in advance for any misunderstanding!
User Avatar
Member
313 posts
Joined: Oct. 2016
Offline
Hi Davide,

it is challenging to provide support without any file example. It is a matter of testing what would work and about clarity.

Otherwise it would take a long time to make a test case and then try something out.

Have a nice day!
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
User Avatar
Member
8832 posts
Joined: July 2007
Online
You should be able to use multiparms
Edited by tamte - July 16, 2023 12:27:28
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
313 posts
Joined: Oct. 2016
Offline
If you want to use Python and the HOM API then you can basically get or set parameters (parm).

If you drag and drop a parm from the parmeter editor to the Python shell you can see the absolute path.

example:

hou.parm(”/avsolute/path/node/parm”).method()

.metod() is just a plceholder.

Usually you can write:
.eval() to get a value
or
.set(”10”) to set a parm.

Then try searching this forum for examples from past questions.
Edited by SWest - July 16, 2023 17:13:29
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
User Avatar
Member
313 posts
Joined: Oct. 2016
Offline
Also if you want a parm to read a promoted value then you set a keyframe to the parm that reads a value.

If possible try promoting the entire multiparms, because it is complicated, and maybe impossible, to connect individual parms from subnet to promoted after you made an HDA.
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
User Avatar
Member
146 posts
Joined: June 2016
Offline
I am afraid having too many controls would make the hda confusing and hard to use but nevertheless its good to know how to do this.

I just made a simplest example for this without using python. It might give you some insights on how you could go about it.

Since it is dynamically updating the parms each time the number of rooms increase or decrease, which ever parms you already setup might get destroyed. Hmm not really ideal, but here you go.


Image Not Found

Attachments:
dynamic_parms.gif (8.7 MB)
dynamic_parms.hiplc (264.9 KB)

Mohan Pugaz
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
User Avatar
Member
31 posts
Joined: June 2014
Offline
Mohanpugaz
I am afraid having too many controls would make the hda confusing and hard to use but nevertheless its good to know how to do this.

I just made a simplest example for this without using python. It might give you some insights on how you could go about it.

Since it is dynamically updating the parms each time the number of rooms increase or decrease, which ever parms you already setup might get destroyed. Hmm not really ideal, but here you go.

Image Not Found

Image Not Found


You are absolutely right! For now, the solution you provided works perfectly for me, and it's very helpful in understanding how to approach the situation. I sincerely thank you for your assistance and contribution. If you have any other suggestions or ideas in the future, I'd be more than happy to listen to them. Thanks again!
English is not my native language, sorry in advance for any misunderstanding!
User Avatar
Member
31 posts
Joined: June 2014
Offline
Mohanpugaz
I am afraid having too many controls would make the hda confusing and hard to use but nevertheless its good to know how to do this.

I just made a simplest example for this without using python. It might give you some insights on how you could go about it.

Since it is dynamically updating the parms each time the number of rooms increase or decrease, which ever parms you already setup might get destroyed. Hmm not really ideal, but here you go.

Image Not Found

Image Not Found

"I tried this solution, but the file gets filled with bugs, causing errors, and the foreach loops no longer work correctly."
English is not my native language, sorry in advance for any misunderstanding!
  • Quick Links