Creating new parameters using Python for HDA in Maya.

   2138   3   1
User Avatar
Member
2 posts
Joined: July 2019
Offline
Hi.

I'm working on a script that takes in multiple pieces of geo and is dynamically creating a polyReducion node to be independently controlled.
All works perfectly in Houdini, but in Maya my parameters are not showing up. Is there a different setup for hou.ToggleParmTemplate and hou.FloatParmTemplate to be displayed?
In Houdini:


In Houdini with python creating parameters per mesh:



In Maya:



When pressing the RunScript button in Maya, there is a lag for a moment, and that is it.

I cannot find any info on this topic.
I am creating a new template using .FloatParmTemplate, creating a new param in the hda node UI using .addSpareParmTuple, next is getting the parameter from touple .__getitem__(0), and finally setting reference with .set

Attachments:
inHoudiniHDA.PNG (6.5 KB)
inHoudiniHDAdynamicparams.PNG (11.7 KB)
inMayaHDA.PNG (4.1 KB)

User Avatar
Staff
467 posts
Joined: Aug. 2019
Offline
Have you tried re-syncing or reloading the asset after running the script?
User Avatar
Member
2 posts
Joined: July 2019
Offline
johnmather
Have you tried re-syncing or reloading the asset after running the script?
Yes, reloading resets everything, where re-syncing will show the asset reduced as intended, but the extra parameters are not showing, so I cannot control the reduction per piece.
User Avatar
Member
1 posts
Joined: Sept. 2022
Offline
I have exactly the same problem but it is slight different circumstances.

I load a HDA into Maya via script using the following line and like yourself, no input parameters show up

pm.mel.eval('houdiniEngine_loadAsset("{}","{}")'.format(hda_path, sop))

If I then load exactly the same asset into Maya using the Houdini Engine menu:
Houdini engine menu -> Load/Load Recent -> My HDA
Then the input parameters show up fine.

THEN, when I run the loadAsset command via script again, the parameters are now visible and editable...

So in short:
Boot Maya
Load HDA via script -> No params
Load HDA via menu -> Params loaded
Load HDA via script again -> Params loaded...

Is there any info on what might be causing this?

// Ben, 10Chambers, Sweden
Edited by ben_hearn_10c - Oct. 20, 2022 04:14:04
  • Quick Links