Copying HDA parameters via maxscript

   1468   3   2
User Avatar
Member
14 posts
Joined: Oct. 2017
Offline
Hello

I have a modeling HDA that my client's team and I are using via the 3DS Max plugin for Houdini.

Now they must incorporate the modifier “Houdini Digital Asset” with their existing max scripts.
In the Houdini Engine for 3ds Max documentation, there are CreateModifierHDA and SetModifierHdaParameter functions.

But for their workflow, they would also need to read these parameters from existing models.
Is there no function like GetModifierHdaParameter?
Or is there a workaround, using standard max functions?
Maybe even something like the maxscript equivalent of the “copy to different object” button?

Thanks for any help!
Emanuel “Manoo” Raimundo
3D generalist, going procedural!
www.artstation.com/manoo
User Avatar
Staff
375 posts
Joined: Aug. 2017
Offline
There's no getter function yet. This will be added to the MaxScript API. I can also expose the copy functionality to the MaxScript API as well.

As a workaround right now–the parameter names and their values are available as custom attributes. For geometry HDAs, the custom attributes are stored on the root node, and for modifier HDAs, the custom attributes are stored directly on the modifier.
User Avatar
Member
14 posts
Joined: Oct. 2017
Offline
Hello again.

First of all, thank you for your feedback, and also your workaround suggestion, I really hope we get the getter and copy functions soon.

However, my client has tried your workaround, and is having some trouble, here is what he said:

Thank you for your help. But I can’t access these attributes.

When I create a Box in Max and initialize my Houdini plugin “CD_SofaCushionMAX_18” it correctly initialize the assets and I can modify parameters. I get this info in the MaxScriptListener:

Box realWorldMapSizen pos: isSelectedn width:10.1174 length:6.90326 height:5.65464

modPanel.addModToSelection (Houdini_Digital_Asset ()) uin

$.modifiers.HEMAX_Parameter.value = 4
$.modifiers.HEMAX_Parameter.value = “”
$.modifiers.HEMAX_Parameter.value = 1
$.modifiers.HEMAX_Parameter.value = 1
$.modifiers.HEMAX_Parameter.value = 12

$.modifiers.HEMAX_Parameter.value = 0


But then I want to read these Parameters:

$.modifiers
Houdini_Digital_Asset:CD_SofaCushionMAX_18_2

custAttributes.get $.modifiers “infl_mid”
undefined

custAttributes.count $.modifiers
0

I can access the Houdini Modifier by script, but it seams there are no custAttributes on it!

Can you please help?
Emanuel “Manoo” Raimundo
3D generalist, going procedural!
www.artstation.com/manoo
User Avatar
Staff
375 posts
Joined: Aug. 2017
Offline
Two new functions have been added to the MaxScript API:

- CopyModifierHda
- CloneObjectHda

The next available daily build will have these functions. The documentation page on scripting will have more details about usage of the functions.
  • Quick Links