Jump to content


OPexist expression for groups


  • Please log in to reply
4 replies to this topic

#1 hyperforce

hyperforce

    Peon

  • Members
  • Pip
  • 34 posts
  • Joined: 07-November 10
  • Location:Heeze, Netherlands
  • Name:Erwin Heyms

Posted 19 August 2012 - 09:37 AM

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.
My Procedural FPS level generator:
http://forums.odforc...vel-generation/

Email: erwinheyms@gmail.com

#2 TAkin

TAkin

    Peon

  • Members
  • Pip
  • 11 posts
  • Joined: 19-June 11
  • Location:Bournemouth, UK.
  • Name:Akinyemi Akinwoye

Posted 19 August 2012 - 10:25 AM

View Posthyperforce, on 19 August 2012 - 09:37 AM, said:

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.

Attached Files



#3 hyperforce

hyperforce

    Peon

  • Members
  • Pip
  • 34 posts
  • Joined: 07-November 10
  • Location:Heeze, Netherlands
  • Name:Erwin Heyms

Posted 19 August 2012 - 01:56 PM

View PostTAkin, on 19 August 2012 - 10:25 AM, said:

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, 19 August 2012 - 01:56 PM.

My Procedural FPS level generator:
http://forums.odforc...vel-generation/

Email: erwinheyms@gmail.com

#4 graham

graham

    Houdini Master

  • Moderator
  • 666 posts
  • Joined: 13-September 06
  • Location:Santa Monica, CA
  • Name:Graham Thompson

Posted 19 August 2012 - 10:32 PM

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, 19 August 2012 - 10:32 PM.

I write python and break things.

#5 hyperforce

hyperforce

    Peon

  • Members
  • Pip
  • 34 posts
  • Joined: 07-November 10
  • Location:Heeze, Netherlands
  • Name:Erwin Heyms

Posted 20 August 2012 - 05:59 AM

View Postgraham, on 19 August 2012 - 10:32 PM, said:

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
My Procedural FPS level generator:
http://forums.odforc...vel-generation/

Email: erwinheyms@gmail.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users