DoctorBuzz Posted May 20, 2005 Share Posted May 20, 2005 Hi guys... Anyone can explain me how to access the list of available SHOP in a scene and how to get their parameters (possibly at the SOP level) ? Thanks in advance... Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted May 24, 2005 Author Share Posted May 24, 2005 Anyone knows how to help me? I can't figure how to access the list of operator inside a network (in particular I need to know the SHOP list) and how to access their parameter... Quote Link to comment Share on other sites More sharing options...
edward Posted May 24, 2005 Share Posted May 24, 2005 Rather than provide a lengthy description, I'll defer to the Houdini 5.5 lessons here: http://sidefx.vislab.usyd.edu.au/houdini_v...ring/index.html Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted May 24, 2005 Author Share Posted May 24, 2005 Thanks for replay edward, but i would to have some help in using the HDK... I need some example on how to access that information with the HDK Quote Link to comment Share on other sites More sharing options...
George Posted May 25, 2005 Share Posted May 25, 2005 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. Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted May 25, 2005 Author Share Posted May 25, 2005 Thanks George for your reply...I'll try and post my results... Thank you again... Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted May 26, 2005 Author Share Posted May 26, 2005 Sorry for my poor capacity, but i had no results.... George...(or any other kind soul), can you post a little example on the various ways to create a list of nodes? Thanks a lot in advance. Quote Link to comment Share on other sites More sharing options...
George Posted May 27, 2005 Share Posted May 27, 2005 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. Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted May 27, 2005 Author Share Posted May 27, 2005 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? Really it's not so clear...sure there must be a lot more example and a much more commented include files and hdk documentation Anyway i was able to obtain a list of operator...thank you. Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted May 27, 2005 Share Posted May 27, 2005 Really it's not so clear...sure there must be a lot more example and a much more commented include files and hdk documentation 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 Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted May 28, 2005 Author Share Posted May 28, 2005 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 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. Quote Link to comment Share on other sites More sharing options...
George Posted May 31, 2005 Share Posted May 31, 2005 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. Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted May 31, 2005 Author Share Posted May 31, 2005 Thanks George for your help... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.