What's the difference?

Discussions about SOFTIMAGEs© Interactive Creative Environment©
iamVFX
Posts: 697
Joined: 24 Sep 2010, 16:28

What's the difference?

Post by iamVFX » 25 Nov 2011, 09:55

Between "While with Counter" and "Repeat with Counter"?

User avatar
Hirazi Blue
Administrator
Posts: 5113
Joined: 04 Jun 2009, 10:15

Re: What's the difference?

Post by Hirazi Blue » 25 Nov 2011, 10:01

The way I understand it, the "While with Counter" gives you the opportunity to set any kind of condition resulting in a boolean True or False to terminate the loop, while the Repeat sets a fixed amount of times the loop goes through. So the "While with Counter" only terminates after the certain condition turns False (or the Max repeat is reached), while a "Repeat with Counter" loops through its loop an exactly predefined number of times...
;)
Stay safe, sane & healthy!

iamVFX
Posts: 697
Joined: 24 Sep 2010, 16:28

Re: What's the difference?

Post by iamVFX » 25 Nov 2011, 10:07

So if I work with a topology and use "While with Loop" with Max Repeat value that determined by number of polys - it's will be the same as if I used "Repeat with Counter"? :)

User avatar
Hirazi Blue
Administrator
Posts: 5113
Joined: 04 Jun 2009, 10:15

Re: What's the difference?

Post by Hirazi Blue » 25 Nov 2011, 10:13

But you'd still have to set a condition...
In that case "Repeat with Counter",
where you "pipe" the number of polygons
into the number of repeats (+1? I forget...) seems "easier".
Stay safe, sane & healthy!

iamVFX
Posts: 697
Joined: 24 Sep 2010, 16:28

Re: What's the difference?

Post by iamVFX » 25 Nov 2011, 10:16

Hirazi Blue wrote:But you'd still have to set a condition...
In that case "Repeat with Counter",
where you "pipe" the number of polygons
into the number of repeats (+1? I forget...) seems "easier".
+1, exactly.
Ok, so difference only in the possibility of using the condition. Thanks, Hirazi! :ymhug:

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: What's the difference?

Post by xsisupport » 25 Nov 2011, 10:39

The counter in While with Counter is a convenience. It's there so you can use it in the body of the loop, but as mentioned already, it doesn't control the number of loop iterations (unless you use it in the condition).
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

iamVFX
Posts: 697
Joined: 24 Sep 2010, 16:28

Re: What's the difference?

Post by iamVFX » 25 Nov 2011, 11:01

Thanks, Stephen! It's clear now :)

User avatar
dwigfor
Posts: 395
Joined: 17 Nov 2009, 16:46

Re: What's the difference?

Post by dwigfor » 25 Nov 2011, 22:40

If you haven't seen this Modulo tutorial, you should look it over. https://www.si-community.com/forum/viewtopic.php?f=41&t=1842

I think it might help you eliminate the need for repeat with counter.

iamVFX
Posts: 697
Joined: 24 Sep 2010, 16:28

Re: What's the difference?

Post by iamVFX » 26 Nov 2011, 13:03

dwigfor wrote:I think it might help you eliminate the need for repeat with counter.
No, because for some reason merge vertices and cap hole compounds accepts only per object arrays