Hello list!
This might be a bit lengthy but only because I really did my homework here so please bare with me!! J
I know the While and Repeat nodes don’t have a good reputation to start with but... Is the While node altogether broken?
What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...
I’ve been playing with the while node for a few days and found myself hitting a wall more often than not.
In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.
To be honest, I encountered a LOT of buggy behaviour with this node but it wasn’t always easily repro so I figured I’d just start with the basics. This pretty much proves that it doesn’t work.
I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.
Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).
With Max Repeat set to one, you can see that the “Incrementor” attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.
So that’s it!
...
In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???
Please? J

I don't think it is a problem with the While node.
I've seen this kind of thing before, in various contexts.
It's an evaluation thing, possibly one of those "beware of ICE optimization" things...
http://www.screencast.com/t/irfPlPo7lWA
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: December-19-11 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node
Hello list!
This might be a bit lengthy but only because I really did my homework here so please bare with me!! :)
I know the While and Repeat nodes don't have a good reputation to start with but... Is the While node altogether broken?
What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...
I've been playing with the while node for a few days and found myself hitting a wall more often than not.
In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.
To be honest, I encountered a LOT of buggy behaviour with this node but it wasn't always easily repro so I figured I'd just start with the basics. This pretty much proves that it doesn't work.
I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.
Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).
With Max Repeat set to one, you can see that the "Incrementor" attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.
So that's it!
...
In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???
Please? :)
[Mathieu_Dufresne]
Thanks for making it clear Stephen!
MatDuf
From: softimag...@listproc.autodesk.com
[mailto:softimag...@listproc.autodesk.com] On Behalf Of Stephen
Blair
Sent: 19 décembre 2011 14:40
To: soft...@listproc.autodesk.com
Subject: RE: Problem with While node
Hi
I don’t think it is a problem with the While node.
I’ve seen this kind of thing before, in various contexts.
It’s an evaluation thing, possibly one of those “beware of ICE optimization” things…
http://www.screencast.com/t/irfPlPo7lWA
From: softimag...@listproc.autodesk.com
[mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu
Dufresne
Sent: December-19-11 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node
Hello list!
This might be a bit lengthy but only because I really did my homework here so please bare with me!! J
I know the While and Repeat nodes don’t have a good reputation to start with but... Is the While node altogether broken?
What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...
I’ve been playing with the while node for a few days and found myself hitting a wall more often than not.
In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.
To be honest, I encountered a LOT of buggy behaviour with this node but it wasn’t always easily repro so I figured I’d just start with the basics. This pretty much proves that it doesn’t work.
I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.
Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).
With Max Repeat set to one, you can see that the “Incrementor” attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.
So that’s it!
...
In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???
Please? J

It is definitely a bug, ICE can be smart and lazy but here it is just lazy ! But ... you should not use the While node like this :).
Let me explain better (first part the bug and how to work around it, second part, the good way to use the While node).
For the bug, it looks like when you set the Max Repeat to just One, there is something wrong in the execution steps of the terminal node (how it is reading its input ports).
The attribute "self.Cond" is evaluated after the While node is executed...
But there is a workaround. You can force ICE to evaluate your attribute first using the Delay Set Data. This node will force the execution steps of your set data first (don't plug the while node in the Delay Set Data or you will get the same problem).
Here is the ASCII graph :
Set Data("self.Cond") > Delay Set Data > ICETree input port 1
While Node >>>>>>>>>>>>>>>>>>>>>>> ICETree input port 2
An other way would be to Get/Set your Boolean attribute in the While loop. It would force ICE to evaluate it before the first execution of the while.
In fact (and it the second part of the explanation), the While node is useful only if you set the condition ... while it is evaluated. Otherwise, if you know before that the condition is true or false, you can just set your data using an if node ;).
I hope it will help you in your "ICE Ray Marcher" !
Cheers,
Guillaume Laforge
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: Monday, December 19, 2011 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node
Hello list!
This might be a bit lengthy but only because I really did my homework here so please bare with me!! :)
I know the While and Repeat nodes don't have a good reputation to start with but... Is the While node altogether broken?
What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...
I've been playing with the while node for a few days and found myself hitting a wall more often than not.
In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.
To be honest, I encountered a LOT of buggy behaviour with this node but it wasn't always easily repro so I figured I'd just start with the basics. This pretty much proves that it doesn't work.
I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.
Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).
With Max Repeat set to one, you can see that the "Incrementor" attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.
So that's it!
...
In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???
Please? :)
[Mathieu_Dufresne]
Hi Guillaume! Thanks a lot for your input!
First off, I only used the while node that way to make it clear that something was wrong. In my original scene, the condition could be changed to false if the raycast node hit a surface meeting certain requirements.
So just to make it clear, you’re saying that to use the while node properly, I should create my condition attribute inside the while loop? And that will somehow make it evaluated before the While node?
From: softimag...@listproc.autodesk.com
[mailto:softimag...@listproc.autodesk.com] On Behalf Of Guillaume
Laforge
Sent: 19 décembre 2011 22:09
To: soft...@listproc.autodesk.com
Subject: RE: Problem with While node
Hi Mathieu,
It is definitely a bug, ICE can be smart and lazy but here it is just lazy ! But … you should not use the While node like this J.
Let me explain better (first part the bug and how to work around it, second part, the good way to use the While node).
For the bug, it looks like when you set the Max Repeat to just One, there is something wrong in the execution steps of the terminal node (how it is reading its input ports).
The attribute “self.Cond“ is evaluated after the While node is executed…
But there is a workaround. You can force ICE to evaluate your attribute first using the Delay Set Data. This node will force the execution steps of your set data first (don’t plug the while node in the Delay Set Data or you will get the same problem).
Here is the ASCII graph :
Set Data(“self.Cond”) > Delay Set Data > ICETree input port 1
While Node >>>>>>>>>>>>>>>>>>>>>>> ICETree input port 2
An other way would be to Get/Set your Boolean attribute in the While loop. It would force ICE to evaluate it before the first execution of the while.
In fact (and it the second part of the explanation), the While node is useful only if you set the condition … while it is evaluated. Otherwise, if you know before that the condition is true or false, you can just set your data using an if node ;).
I hope it will help you in your “ICE Ray Marcher” !
Cheers,
Guillaume Laforge
From: softimag...@listproc.autodesk.com
[mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu
Dufresne
Sent: Monday, December 19, 2011 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node
Hello list!
This might be a bit lengthy but only because I really did my homework here so please bare with me!! J
I know the While and Repeat nodes don’t have a good reputation to start with but... Is the While node altogether broken?
What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...
I’ve been playing with the while node for a few days and found myself hitting a wall more often than not.
In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.
To be honest, I encountered a LOT of buggy behaviour with this node but it wasn’t always easily repro so I figured I’d just start with the basics. This pretty much proves that it doesn’t work.
I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.
Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).
With Max Repeat set to one, you can see that the “Incrementor” attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.
So that’s it!
...
In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???
Please? J

Setting self.Cond in the loop does make your While loop work.
http://xsisupport.files.wordpress.com/2011/12/while_setconditioninloop.png
Personally, I think you were using it properly.
That Max Repeat port makes it pretty natural to want to do a "while(true) loop" eg
while True:
do_something()
if condition: break
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: December-20-11 11:02 AM
To: soft...@listproc.autodesk.com
Subject: RE: Problem with While node
Hi Guillaume! Thanks a lot for your input!
First off, I only used the while node that way to make it clear that something was wrong. In my original scene, the condition could be changed to false if the raycast node hit a surface meeting certain requirements.
So just to make it clear, you're saying that to use the while node properly, I should create my condition attribute inside the while loop? And that will somehow make it evaluated before the While node?
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Guillaume Laforge
Sent: 19 décembre 2011 22:09
To: soft...@listproc.autodesk.com
Subject: RE: Problem with While node
Hi Mathieu,
It is definitely a bug, ICE can be smart and lazy but here it is just lazy ! But ... you should not use the While node like this :).
Let me explain better (first part the bug and how to work around it, second part, the good way to use the While node).
For the bug, it looks like when you set the Max Repeat to just One, there is something wrong in the execution steps of the terminal node (how it is reading its input ports).
The attribute "self.Cond" is evaluated after the While node is executed...
But there is a workaround. You can force ICE to evaluate your attribute first using the Delay Set Data. This node will force the execution steps of your set data first (don't plug the while node in the Delay Set Data or you will get the same problem).
Here is the ASCII graph :
Set Data("self.Cond") > Delay Set Data > ICETree input port 1
While Node >>>>>>>>>>>>>>>>>>>>>>> ICETree input port 2
An other way would be to Get/Set your Boolean attribute in the While loop. It would force ICE to evaluate it before the first execution of the while.
In fact (and it the second part of the explanation), the While node is useful only if you set the condition ... while it is evaluated. Otherwise, if you know before that the condition is true or false, you can just set your data using an if node ;).
I hope it will help you in your "ICE Ray Marcher" !
Cheers,
Guillaume Laforge
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: Monday, December 19, 2011 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node
Hello list!
This might be a bit lengthy but only because I really did my homework here so please bare with me!! :)
I know the While and Repeat nodes don't have a good reputation to start with but... Is the While node altogether broken?
What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...
I've been playing with the while node for a few days and found myself hitting a wall more often than not.
In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.
To be honest, I encountered a LOT of buggy behaviour with this node but it wasn't always easily repro so I figured I'd just start with the basics. This pretty much proves that it doesn't work.
I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.
Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).
With Max Repeat set to one, you can see that the "Incrementor" attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.
So that's it!
...
In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???
Please? :)
[Mathieu_Dufresne]
Hi Raffaele!
I’m surprised that you figured out so quickly what I was doing! J Indeed, I am looking into sliding skin solutions.
I don’t know what is involved in a point in volume calculation but I always thought it to be a rather heavy calculation. But judging from your mail, I guess a single point in volume is not as heavy as a single raycast? Otherwise, what’s the main reason for suggesting this instead of raymarching?
And if I want to do this on a human face, I guess this would be considered a bubble mesh, right? If so, would you say that the point in volume technique becomes irrelevant or that it still works but you only need to handle exceptions for when you are in a negative volume but still “inside” the mesh (like in the mouth for instance)?
Thanks!
MatDuf
Just use the Delay Set Data and everything will work as expected !
> So just to make it clear, you're saying that to use the while node properly, I should create my condition attribute inside the while loop? And that will somehow make it evaluated before the While node?
No, you can create the attribute before the While but a While is by definition useful only if you set the condition in it. If you set the condition to True before and only before the While, then you will just repeat
until your max parameter (and so a repeat node will do the job) . If the condition is set to False, then nothing will be evaluated, again, no need for a While.
The While is nice when you need to exit from a loop but don't know exactly when you will exit (depending on the result of your condition tested on every loop).
Make sense ?
Cheers
Guillaume
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: Tuesday, December 20, 2011 11:02 AM
To: soft...@listproc.autodesk.com
Subject: RE: Problem with While node
Hi Guillaume! Thanks a lot for your input!
First off, I only used the while node that way to make it clear that something was wrong. In my original scene, the condition could be changed to false if the raycast node hit a surface meeting certain requirements.
So just to make it clear, you're saying that to use the while node properly, I should create my condition attribute inside the while loop? And that will somehow make it evaluated before the While node?
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Guillaume Laforge
Sent: 19 décembre 2011 22:09
To: soft...@listproc.autodesk.com
Subject: RE: Problem with While node
Hi Mathieu,
It is definitely a bug, ICE can be smart and lazy but here it is just lazy ! But ... you should not use the While node like this :).
Let me explain better (first part the bug and how to work around it, second part, the good way to use the While node).
For the bug, it looks like when you set the Max Repeat to just One, there is something wrong in the execution steps of the terminal node (how it is reading its input ports).
The attribute "self.Cond" is evaluated after the While node is executed...
But there is a workaround. You can force ICE to evaluate your attribute first using the Delay Set Data. This node will force the execution steps of your set data first (don't plug the while node in the Delay Set Data or you will get the same problem).
Here is the ASCII graph :
Set Data("self.Cond") > Delay Set Data > ICETree input port 1
While Node >>>>>>>>>>>>>>>>>>>>>>> ICETree input port 2
An other way would be to Get/Set your Boolean attribute in the While loop. It would force ICE to evaluate it before the first execution of the while.
In fact (and it the second part of the explanation), the While node is useful only if you set the condition ... while it is evaluated. Otherwise, if you know before that the condition is true or false, you can just set your data using an if node ;).
I hope it will help you in your "ICE Ray Marcher" !
Cheers,
Guillaume Laforge
From: softimag...@listproc.autodesk.com [mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu Dufresne
Sent: Monday, December 19, 2011 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node
Hello list!
This might be a bit lengthy but only because I really did my homework here so please bare with me!! :)
I know the While and Repeat nodes don't have a good reputation to start with but... Is the While node altogether broken?
What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...
I've been playing with the while node for a few days and found myself hitting a wall more often than not.
In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.
To be honest, I encountered a LOT of buggy behaviour with this node but it wasn't always easily repro so I figured I'd just start with the basics. This pretty much proves that it doesn't work.
I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.
Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).
With Max Repeat set to one, you can see that the "Incrementor" attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.
So that's it!
...
In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???
Please? :)
[Mathieu_Dufresne]
Yes definitely!
Thanks guys!
It is definitely a bug, ICE can be smart and lazy but here it is just lazy ! But … you should not use the While node like this J.
Let me explain better (first part the bug and how to work around it, second part, the good way to use the While node).
For the bug, it looks like when you set the Max Repeat to just One, there is something wrong in the execution steps of the terminal node (how it is reading its input ports).
The attribute “self.Cond“ is evaluated after the While node is executed…
But there is a workaround. You can force ICE to evaluate your attribute first using the Delay Set Data. This node will force the execution steps of your set data first (don’t plug the while node in the Delay Set Data or you will get the same problem).
Here is the ASCII graph :
Set Data(“self.Cond”) > Delay Set Data > ICETree input port 1
While Node >>>>>>>>>>>>>>>>>>>>>>> ICETree input port 2
An other way would be to Get/Set your Boolean attribute in the While loop. It would force ICE to evaluate it before the first execution of the while.
In fact (and it the second part of the explanation), the While node is useful only if you set the condition … while it is evaluated. Otherwise, if you know before that the condition is true or false, you can just set your data using an if node ;).
I hope it will help you in your “ICE Ray Marcher” !
Cheers,
Guillaume Laforge
From: softimag...@listproc.autodesk.com
[mailto:softimag...@listproc.autodesk.com] On Behalf Of Mathieu
Dufresne
Sent: Monday, December 19, 2011 1:53 PM
To: soft...@listproc.autodesk.com
Subject: Problem with While node
Hello list!
This might be a bit lengthy but only because I really did my homework here so please bare with me!! J
I know the While and Repeat nodes don’t have a good reputation to start with but... Is the While node altogether broken?
What I was trying to do was a raycaster that could go through multiple layers of geometry and I thought it would be simple enough...
I’ve been playing with the while node for a few days and found myself hitting a wall more often than not.
In the first couple of hours I tried to debug my problems to no avail so I narrowed everything down until it came boiling down to this scene.
To be honest, I encountered a LOT of buggy behaviour with this node but it wasn’t always easily repro so I figured I’d just start with the basics. This pretty much proves that it doesn’t work.
I added my scene and pictures of both the working and not working ICE trees to this mail if anybody cares to look into it.
Basically, as soon as a Custom attribute is fed to the condition port of a while node, the first iteration is omitted (or something like that).
With Max Repeat set to one, you can see that the “Incrementor” attribute displays a 1 when the True node is plugged and a 0 when the Cond Attribute is plugged.
So that’s it!
...
In other news, any ideas on how to make a multi-layer raycaster without using the while or repeat nodes???
Please? J
