Jump to content

extending hom parmtemplates


Recommended Posts

Let me explain

I need to dynamically create menus on an asset which have dynamic menu items.

Doesnt sound like a big deal except that the item_generator_script argument to hou.MenuParmTemplate doesnt work as of yet (logged as a bug) and the hscript opsareds command isnt practical in this case (you cant use opsareds to create a single parm).

I thought a work-around would be to handle the menu items in the hdaModule, and replace the menu with hou.Node.replaceSpareParmTuple when it needs to be updated. This works, but in practice its *extremely* slow when the amount of parameters builds up. My guess is that behind the scenes its wrapping OP_Node::changeParmTemplate and that in fact all parameters on the node have to be rebuilt.

SO...

Until item_generator_script is implemented, is it possible to extend HOM to have, for example, a hou.parmTemplateType.ScriptMenu which wraps the PRM_ChoiceList "script interface" initializer?

PRM_ChoiceList(PRM_ChoiceListType thetype, const char *thescript, CH_ScriptLanguage language = CH_HSCRIPT);

and how would I go about doing so?

Looking at the HOM/ObjNode_setSelectable.C example, it seems straightforward to extend HOM that way, adding a function and binding it as a method to a class. But what about adding a new class to HOM that is treated as a PRM_Template?

:unsure:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...