Volume evaluation problem

Discussions about SOFTIMAGEs© Interactive Creative Environment©
User avatar
gustavoeb
Moderator
Posts: 587
Joined: 20 Jul 2010, 22:33
Skype: gustavoboehs

Volume evaluation problem

Post by gustavoeb » 24 Jan 2012, 16:39

Does anyone know a workaround to this?

It seems like the self.Volume attribute is not evaluated before ICE finishes reading an entire ICE tree and going to the next... its a pain if you want to do volume preservation...
Is there a way to force the refreshing of this attribute, or to calculate the volume of geometry in some other fashion (preferably a easy one)?

I have attached two images to prove my point... in the first one I get self.Volume twice in the same Tree, before and after deformation, as you can see I get the same result in both evaluations. In the second image I create a new tree (on top of the first one) and then it works perfectly...
You do not have the required permissions to view the files attached to this post.
Gustavo Eggert Boehs
Blog: http://www.gustavoeb.com.br/

User avatar
gustavoeb
Moderator
Posts: 587
Joined: 20 Jul 2010, 22:33
Skype: gustavoboehs

Re: Volume evaluation problem

Post by gustavoeb » 25 Jan 2012, 14:25

no one?
Gustavo Eggert Boehs
Blog: http://www.gustavoeb.com.br/

User avatar
rray
Moderator
Posts: 1810
Joined: 26 Sep 2009, 13:51
Location: Bonn, Germany

Re: Volume evaluation problem

Post by rray » 25 Jan 2012, 14:50

There's a simple algorithm to calculate the volume by adding up all the signed tetahedrons built from the mesh triangles to (0,0,0):
http://stackoverflow.com/questions/1406 ... is-made-up
softimage resources section updated Sep 26th 2026

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 22:38
Location: St. Thomas, Ontario

Re: Volume evaluation problem

Post by Daniel Brassard » 25 Jan 2012, 15:04

I suspect you are reading the same variable before and after deformation but the variable has not being updated when you read it again.

Disconnect the top branch (port 1) and see what is the result of the volume after deformation. Any Change?

You may have a case were a delay node is required so that you don't read the same variable value of sphere1.volume twice.

Some info here:
http://xsisupport.wordpress.com/2011/12 ... -evaluate/

And here (read initializing set data and delaying set data)

http://softimage.wiki.softimage.com/xsi ... ETrees.htm

Hope that help!
$ifndef "Softimage"
set "Softimage" "true"
$endif

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

Re: Volume evaluation problem

Post by xsisupport » 25 Jan 2012, 15:36

Try with two ICE Trees.
First one applies the deformation.
Second one reads the volume.
Second is above the deform op in the stack.

UPDATE Oops, I see you already mentioned that.
Is this so bad?

Most likely ICE is caching some values, that's my guess.
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

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

Re: Volume evaluation problem

Post by xsisupport » 25 Jan 2012, 16:29

xsisupport wrote:Try with two ICE Trees.
First one applies the deformation.
Second one reads the volume.
Second is above the deform op in the stack.

UPDATE Oops, I see you already mentioned that.
Is this so bad?

Most likely ICE is caching some values, that's my guess.
I don't repro in 2012 SAP.

Sphere on the right is a frozen duplicate, to show the final volume.
During playback, I see the same values displayed by both Show Values.
Image
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

User avatar
gustavoeb
Moderator
Posts: 587
Joined: 20 Jul 2010, 22:33
Skype: gustavoboehs

Re: Volume evaluation problem

Post by gustavoeb » 25 Jan 2012, 17:13

Daniel Brassard wrote:Disconnect the top branch (port 1) and see what is the result of the volume after deformation. Any Change?
Same thing, I get the volume before the deformation
Daniel Brassard wrote:You may have a case were a delay node is required so that you don't read the same variable value of sphere1.volume twice.
The exact opposite, I do want to read the variable twice (once before and once after the deformation), with a delay node both values SHOULD look the same (as far as I understand it). Anyhow I tested it, and it does no work :(
xsisupport wrote:Oops, I see you already mentioned that.
Is this so bad?
It would not bee if I was cooking up something for my own use... But since I want to build something and encapsulate in one easy-to-use compound, it is annoying. A better workaround would be prefered.
xsisupport wrote:I don't repro in 2012 SAP.
As far as I can see it, you repro it just fine, self.Volume is the same both before and after the deformation, which is NOT true. The only different thing is that both values seem to be the value after deformation. It seems so, but that is not what I get in my testings over here... Are you sure you are displaying the self.Volume atribbute in your frozen sphere, or are you displaying one of the custom attributes you have created?

To exemplify what I mean take a look at this image. I have a AttributeDisplay property on both spheres on the left and right, as you can see they clearly differ in volume, and as you can also see that does not show in my ice tree :-\
You do not have the required permissions to view the files attached to this post.
Gustavo Eggert Boehs
Blog: http://www.gustavoeb.com.br/

User avatar
gustavoeb
Moderator
Posts: 587
Joined: 20 Jul 2010, 22:33
Skype: gustavoboehs

Re: Volume evaluation problem

Post by gustavoeb » 25 Jan 2012, 17:16

Bressard, I took a closer look at the links you sent me and you are right! :)

I was not doing the right thing, was connecting everybody to the delay node... now if I only connect the second evaluation things go just right ^:)^

Thank you very much sir!

(and here is the "image or it didnt happend)
You do not have the required permissions to view the files attached to this post.
Gustavo Eggert Boehs
Blog: http://www.gustavoeb.com.br/

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

Re: Volume evaluation problem

Post by xsisupport » 25 Jan 2012, 17:31

As far as I can see it, you repro it just fine, self.Volume is the same both before and after the deformation, which is NOT true. The only different thing is that both values seem to be the value after deformation. It seems so, but that is not what I get in my testings over here... Are you sure you are displaying the self.Volume atribbute in your frozen sphere, or are you displaying one of the custom attributes you have created?
I'm sorry, my mistake.
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

User avatar
gustavoeb
Moderator
Posts: 587
Joined: 20 Jul 2010, 22:33
Skype: gustavoboehs

Re: Volume evaluation problem

Post by gustavoeb » 25 Jan 2012, 17:37

reading my own sentence again... sorry if I sounded harsh :-\ not intentional...
anyhow, the answer was in your blog, as Bressard pointed out... thank you for thaking the time and answer stuff in the forums :)
Gustavo Eggert Boehs
Blog: http://www.gustavoeb.com.br/

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

Re: Volume evaluation problem

Post by xsisupport » 25 Jan 2012, 17:41

No problem. It was my second mistake like that today! ;-)

Anyways, I can use this thread for another Delay Set Data post...I have a few now.
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 22:38
Location: St. Thomas, Ontario

Re: Volume evaluation problem

Post by Daniel Brassard » 25 Jan 2012, 22:08

You're welcome. I am glad it worked for you. I like this community, friendly folks willing to help!

Cheers!

Dan
$ifndef "Softimage"
set "Softimage" "true"
$endif