hyperforce Posted August 19, 2012 Share Posted August 19, 2012 I'm trying to detect if a group exists in a specific node so it can return a 0 or 1 value for a switch node. According to the houdini help index I should use an OPEXIST expression and mark my group with @group as follows: Returns 1 if the specified node, group, or bundle exists. Usage opexist(op_name) Examples echo `opexist("../box1")` echo `opexist("/obj/@mygroup")` echo `opexist("@mybundle")` But I can't seem to get it to work properly. Whenever I add a @ symbol into my op_name path, it turns green and always returns 0. I've tried to specify the full path and I tried using backticks and several other methods, but it doesn't seem to detect if my groups exist or not. Does anyone know how to use this expression, or if another expression exists that does the same thing. 1 Quote Link to comment Share on other sites More sharing options...
TAkin Posted August 19, 2012 Share Posted August 19, 2012 I'm trying to detect if a group exists in a specific node so it can return a 0 or 1 value for a switch node. According to the houdini help index I should use an OPEXIST expression and mark my group with @group as follows: Returns 1 if the specified node, group, or bundle exists. Usage opexist(op_name) Examples echo `opexist("../box1")` echo `opexist("/obj/@mygroup")` echo `opexist("@mybundle")` But I can't seem to get it to work properly. Whenever I add a @ symbol into my op_name path, it turns green and always returns 0. I've tried to specify the full path and I tried using backticks and several other methods, but it doesn't seem to detect if my groups exist or not. Does anyone know how to use this expression, or if another expression exists that does the same thing. I think the expression actually works. Have a look at my setup. Hope this helps. opexist.hip Quote Link to comment Share on other sites More sharing options...
hyperforce Posted August 19, 2012 Author Share Posted August 19, 2012 (edited) I think the expression actually works. Have a look at my setup. Hope this helps. I checked out the file, its doing an Opexist check for the GROUP NODE called group1, but not the actual group called group1. I renamed the group node and now its not working anymore. Also I need it to be a relative path as i'll be using it in a Digital asset. Edited August 19, 2012 by hyperforce Quote Link to comment Share on other sites More sharing options...
graham Posted August 20, 2012 Share Posted August 20, 2012 (edited) opexist() checks for node groups, not geometry groups. I'd suggest using [point/prim]groupmask() with your specific and exact group name as the pattern. If the function returns anything not the empty string your group would exist. Edited August 20, 2012 by graham 1 Quote Link to comment Share on other sites More sharing options...
hyperforce Posted August 20, 2012 Author Share Posted August 20, 2012 opexist() checks for node groups, not geometry groups. I'd suggest using [point/prim]groupmask() with your specific and exact group name as the pattern. If the function returns anything not the empty string your group would exist. Thank you for the help Graham. I got it to work now. cheers Quote Link to comment Share on other sites More sharing options...
Fake Pilot Posted January 26, 2015 Share Posted January 26, 2015 Would love it if you could explain how, in the same situation myself now. Not that skilled with code. :-) Quote Link to comment Share on other sites More sharing options...
3iart Posted January 27, 2015 Share Posted January 27, 2015 if(argc(primgroupmask("../path","@group_name"))!=0,1,0) 2 1 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.