Jump to content

Exposing (rolldown) Menus To A Hda Interface


kodiak

Recommended Posts

Hi there,

I'm having some issue exposing a rolldown menu to the interface of an asset.

What I'm trying to do is to (for example) expose the "detail" attribute of an object contained in the HDA using a similar (but more restrictive) menu on the asset interface.

As there is no expression field for the menu (nor could I revert it to an integer), I don't see a way the channel reference the two together.

The other method I tried is to create a callback on the asset interface side, that explicitly sets the value of the menu.

Something like

opparm `opfullpath("./EMBEDDEDOBJ")` detail `chs("./HDAPARAM")`

This seems to be working in most cases when the asset is open, but I don't seem to be able to get it working with a closed one.

Any thoughts?

Thanks

Andras

Link to comment
Share on other sites

It's possible although some voodoo is involved in H8. In your unlocked asset, you need to establish a special !!ch()!! reference for menus.

eg.

opparm /obj/asset_instance/EMBEDDEDOBJ menu_parm ( '!!ch("../my_menu_parm")!!'

Now to get the top-level my_menu_parm parameter to obtain the list of items, select the parameter in the Op Type Properties dialog and the switch to the Menu tab. Click on Menu Script. Now for the script, use something like this:

opmenu -l EMBBEDDEDOBJ menu_parm

All this assumes though that you want to exactly reproduce the menu. If you had promoted your menu parameter via the "plus" button next to the Create New menu in the Operator Type Properties dialog and then hit Apply, it would have done this automatically for you.

If you have some really special case, then you might need to create an invisible parameter that EMBBEDEDOBJ/menu_parm references using !!ch()!! and then do your opparm on that top-level hidden parameter.

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...