Jump to content

Shop List And Parameters


Recommended Posts

Hi DoctorBuzz,

SHOP nodes are regular OP_Nodes in Houdini (and therefore descend from OP_Parameters) which means you can use the general eval*() methods to evaluate their parameters.

How are you trying to get the list of SHOPs? Is the user giving you a string to parse (e.g. /shop/v_*) -- in which case you can use OP_Node::globNodes(), or do you have a particular OP_Operator? In which case I believe you can use OP_Operator::getNumActiveNodes() and OP_Operator::getActiveNode() to access all the nodes of a particular operator type. I've never had to use the latter for SHOP operators, but I believe they should be the same as any other type.

Hope that helps,

George.

Link to comment
Share on other sites

Hi DoctorBuzz,

Here's an example of how to get a list of nodes from the current node that match the pattern "vex_*":

OP_Node *cwd = OPgetDirector()->getCwd();
UT_PtrArray<OP_Node *> node_list;
UT_String  expanded;
int i;

// assert cwd != NULL

cwd->globNodes("vex_*", &expanded, &node_list);
for (i = 0; i < node_list.entries(); i++)
{
    // node_list(i) is  an OP_Node * pointer with a name that
    // matches vex_*.
}

I haven't tried this code out, so it may not compile... but the idea is there.

Hope that helps.

Link to comment
Share on other sites

Thanks again George...

It could be the right way, but how to access a node in a context different than that i'm currently in and by it's op_type and not it's name in the network? :blink:

Really it's not so clear...sure there must be a lot more example and a much more commented include files and hdk documentation :rolleyes:

Anyway i was able to obtain a list of operator...thank you.

Link to comment
Share on other sites

Really it's not so clear...sure there must be a lot more example and a much more commented include files and hdk documentation  :rolleyes:

18469[/snapback]

Funny :)

Can you provide a little more detail on what you are trying to do?

You want to build a list of all the SHOPs and their parameters correct?

Do the SHOPs have to be instanced in your scene? Or do you just want a listing of every SHOP that Houdini currently knows about (in the Operator Table)?

HDK is pretty big and there are lots of different ways to do the same thing.

Is this going to be a hscript command? Or you adding data to a SOP? More details :)

Link to comment
Share on other sites

Hi Wolfwood,

I know that the hdk is pretty big, but i believe that could be usefull to have some more examples to play with...But i'm a really bad programmer so i have to improve my skill first and maybe all will be more clear :P

What i was asking for is to have access to a list of currently used shops in the scene and their parameters and be able to do this in different context (a SOP that ask for a list of available shops, their types, parameters, how many textures are loaded etc.). It could be usefull to do this for every node type. I'm just trying to understand how to move in the houdini network.

Another thing...when appending data to a UT_PtrArray list how to check for duplicates (i saw an option to do this but how to use it?).

Anyway thanks to you and George for your support.

Link to comment
Share on other sites

Another thing...when appending data to a UT_PtrArray list how to check for duplicates (i saw  an option to do this but how to use it?).

18478[/snapback]

There is a version of the append() method which has a parameter called checkForDup. When this is set to 1, the append will not add it again if a dup is found (it should return the index of where it is currently stored). Be sure to read the comments before the append() methods.

I'm glad you got your list of operators, but as Wolfwood said, there are a lot of different ways to do the same thing, some more suited than others to specific circumstances. Don't give up, it gets easier the more you understand the architecture.

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