Jump to content

Choice Menu Parameters


Recommended Posts

Hi

Has anyone got any example code for setting up a choice menu that doesn't use one of the default choices

So I have

PRM_Template(PRM_ORD, 1, &PRMorientName, 0, &PRMplaneMenu),

But how do you define PRMorientName and PRMplaneMenu

I tried a couple of thing but I don't think ny C++ is quite up to this yet.

ta :)

Link to comment
Share on other sites

Hi Simon,

There is an example in the sample SOP_BrushHairLen in the HDK. You basically just have to define an array of PRM_Name objects, one for each choice, and then instantiate a PRM_ChoiceList object, like this:

static PRM_Name         sopOpMenuNames[] = {
    PRM_Name("paint",   "Paint"),
    PRM_Name("eyedrop", "Eye Dropper"),
    PRM_Name("smoothattrib", "Smooth"),
    PRM_Name("callback", "Callback"),
    PRM_Name("erase",   "Erase Changes"),
    PRM_Name(0)
};

static PRM_ChoiceList   sopOpMenu((PRM_ChoiceListType)(PRM_CHOICELIST_EXCLUSIVE |                                                      PRM_CHOICELIST_REPLACE),     sopOpMenuNames);

(This is code from SOP_BrushHairLen.C)

Take care,

George.

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