Jump to content


foreach on groups


  • Please log in to reply
7 replies to this topic

#1 sanostol

sanostol

    Houdini Master

  • Members
  • PipPipPipPip
  • 647 posts
  • Joined: 09-January 06
  • Location:Munich, Germany
  • Name:Martin Matzeder

Posted 22 May 2011 - 12:34 PM

inside a foreachloopSOP working on groups, is there a way to get the group name that is currently processed?

Martin

Edited by sanostol, 22 May 2011 - 12:35 PM.

Martin Matzeder - Booyabase

#2 anim

anim

    Houdini Master

  • Members
  • PipPipPipPip
  • 915 posts
  • Joined: 23-August 07
  • Location:Slovakia, Bratislava
  • Name:Tomas Slancik

Posted 22 May 2011 - 12:56 PM

assuming that your stamp varibles on foreach are set to default

in H11 you can do just:
`stamps("..", "FORVALUE", "")`
it contains group name when working on groups

in H10 you need to use (if I recall correctly that back then FORVALUE variable just contained index)
`arg(primgroupmask(opinputpath("..",0), chs("../groupmask")),stamp("..", "FORVALUE", 0))`
in H11 if you need just index there is variable named FORIDXVALUE by default
Tomas Slancik
Generalist
Slovakia

#3 sanostol

sanostol

    Houdini Master

  • Members
  • PipPipPipPip
  • 647 posts
  • Joined: 09-January 06
  • Location:Munich, Germany
  • Name:Martin Matzeder

Posted 22 May 2011 - 01:12 PM

hey, that was fast :)

i tried it but without success. `stamps("..", "FORVALUE", "")` returns nothing here, when set to for each group

i'm using h11

Martin
Martin Matzeder - Booyabase

#4 anim

anim

    Houdini Master

  • Members
  • PipPipPipPip
  • 915 posts
  • Joined: 23-August 07
  • Location:Slovakia, Bratislava
  • Name:Tomas Slancik

Posted 22 May 2011 - 01:19 PM

where are you using it?
here is a little scene using it in Font SOP inside foreach

EDIT: of course you need to look at it when outside the foreach, the easiest method is to pin the viewport when outside, then dive inside for modifications and you can see the result in the pinned viewport

Attached Files


Edited by anim, 22 May 2011 - 01:21 PM.

Tomas Slancik
Generalist
Slovakia

#5 sanostol

sanostol

    Houdini Master

  • Members
  • PipPipPipPip
  • 647 posts
  • Joined: 09-January 06
  • Location:Munich, Germany
  • Name:Martin Matzeder

Posted 22 May 2011 - 01:33 PM

Thank You anim, that's very helpfull!

Sometimes for each is quite mindbending

Edited by sanostol, 22 May 2011 - 01:37 PM.

Martin Matzeder - Booyabase

#6 anim

anim

    Houdini Master

  • Members
  • PipPipPipPip
  • 915 posts
  • Joined: 23-August 07
  • Location:Slovakia, Bratislava
  • Name:Tomas Slancik

Posted 22 May 2011 - 01:57 PM

yes, it is at first, but it's very useful so it's worth bending your mind a little :)
Tomas Slancik
Generalist
Slovakia

#7 asnowcappedromance

asnowcappedromance

    Initiate

  • Members
  • PipPip
  • 158 posts
  • Joined: 18-October 09
  • Location:Vancouver, B.C.
  • Name:Manuel Tausch

Posted 15 May 2012 - 09:36 AM

just stumbled over this thread,
actually another easy way to access the group name inside a foreach is
`chs("../each1/group")`

cheers,

Manu

Manuel Tausch
senior FX TD - Rhythm & Hues

#8 RogerW

RogerW

    Peon

  • Members
  • Pip
  • 12 posts
  • Joined: 24-October 12
  • Location:Cape Town, South Africa
  • Name:Roger Wellard

Posted 18 February 2013 - 12:17 AM

Thanks guys,

This thread helped me out a lot.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users