Daniel Posted March 3, 2005 Share Posted March 3, 2005 Hello, I'd like to access points feeding the second input of a custom Pop but I don't see how that's done. Looks like in Sops you use "inputGeo" to grab the second inputs data but I don't see the equiv in pops. There aren't many pops that use a second input.. most fetch geometry from a sop path.. is that the way I should go? my second input isn't dynamic partical data so it wouldn't be a problem I guess still would like to know if the second input thing is possible thnx Daniel Quote Link to comment Share on other sites More sharing options...
Guest xionmark Posted March 3, 2005 Share Posted March 3, 2005 Hi Daniel, I'm not sure if you were asking how to get your POP to accept two inputs or how to grab the geometry coming from the second input. I don't have access to any POP source code at the moment but here's a bit of CHOP code: void newChopOperator(OP_OperatorTable *table) { table->addOperator( new OP_Operator("file_out", // Internal name "File Out", // UI name CHOP_file_out::myConstructor, // CHOP constructor &CHOP_file_out::myTemplatePair, // Parameters 1, // Min # of inputs 2, // Max # of inputs &CHOP_file_out::myVariablePair) // Local variables ); } I believe for any OP the declaration above is almost the same; notice the next to the last line for Max # of inputs. As for grabbing SOP geo, I think you can use the "getSopGeo (OP_Node *sop, OP_Context &context)" method. And I think the duplicateSource() and getInput() works in POP land too ... but I'm not in the office and am trying to pull (from a VERY tired) memory ... Hope that helps, I can look into it further Saturday if you haven't figured it out. Take care, Mark Quote Link to comment Share on other sites More sharing options...
mwin Posted September 21, 2007 Share Posted September 21, 2007 (edited) Hello Actually , I'm doing somehting similar and I have a few questions regarding this topic. By looking at the sample codes provided by SESI, data.getDetail () returns the geo info for the source. But let's say that I have a collision object and I want to feed that into my pop like in Collision pop. My first question is how can I look for that specific colliion sop from POP and the second question is starting from I have heard, starting from Houdini 8.0.387 and onwards getSopGeo() method is obsolete. If that's the case, which method is available to get the handle for the GU_Detail.? Thanks. Hi Daniel,I'm not sure if you were asking how to get your POP to accept two inputs or how to grab the geometry coming from the second input. I don't have access to any POP source code at the moment but here's a bit of CHOP code: void newChopOperator(OP_OperatorTable *table) { table->addOperator( new OP_Operator("file_out", // Internal name "File Out", // UI name CHOP_file_out::myConstructor, // CHOP constructor &CHOP_file_out::myTemplatePair, // Parameters 1, // Min # of inputs 2, // Max # of inputs &CHOP_file_out::myVariablePair) // Local variables ); } I believe for any OP the declaration above is almost the same; notice the next to the last line for Max # of inputs. As for grabbing SOP geo, I think you can use the "getSopGeo (OP_Node *sop, OP_Context &context)" method. And I think the duplicateSource() and getInput() works in POP land too ... but I'm not in the office and am trying to pull (from a VERY tired) memory ... Hope that helps, I can look into it further Saturday if you haven't figured it out. Take care, Mark Edited September 21, 2007 by mwin Quote Link to comment Share on other sites More sharing options...
edward Posted September 23, 2007 Share Posted September 23, 2007 Well, first you need to have some way to specify the path to your SOP. The easiest way is to have a PRM_STRING parameter for this with the extended type PRM_TYPE_DYNAMIC_PATH. So then after you evaluate the parameter to get your sop path, you find it like this: SOP_Node *sop = findNode(my_sop_path); if (sop == NULL) // flag error as path is invalid. Now to obtain the geometry, you should obtain a read lock to it like so (see GU_DetailHandle.h) GU_DetailHandleAutoReadLock gdh(sop->getCookedGeoHandle()); GU_Detail *sop_gdp = gdh.getGdp(); Now you can use sop_gdp as long as gdh exists. When gdh is destructed, the lock will automatically be released. Quote Link to comment Share on other sites More sharing options...
mwin Posted September 24, 2007 Share Posted September 24, 2007 cheers Ed! I'll give it a try. Well, first you need to have some way to specify the path to your SOP. The easiest way is to have a PRM_STRING parameter for this with the extended type PRM_TYPE_DYNAMIC_PATH. So then after you evaluate the parameter to get your sop path, you find it like this:SOP_Node *sop = findNode(my_sop_path); if (sop == NULL) // flag error as path is invalid. Now to obtain the geometry, you should obtain a read lock to it like so (see GU_DetailHandle.h) GU_DetailHandleAutoReadLock gdh(sop->getCookedGeoHandle()); GU_Detail *sop_gdp = gdh.getGdp(); Now you can use sop_gdp as long as gdh exists. When gdh is destructed, the lock will automatically be released. Quote Link to comment Share on other sites More sharing options...
mwin Posted September 24, 2007 Share Posted September 24, 2007 Hi Ed, findNode(sopName) returns only OP_Node*. OP_Node* OP_Node::findNode ( const char * path ) const so i can't use getCookedGeoHandle() which is a member of SOP_Node. Is there a way to convert from OP_Node to SOP_Node type? Cheers. Quote Link to comment Share on other sites More sharing options...
edward Posted September 24, 2007 Share Posted September 24, 2007 SOP_Node *sop = CAST_SOPNODE(findNode(my_sop_path)); 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.