Jump to content

OPexist expression for groups


Recommended Posts

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.

  • Like 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by hyperforce
Link to comment
Share on other sites

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 by graham
  • Like 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 years later...

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