Today is a milestone for me. I finally figured out the expression to extract position data inside dops and put it into a group! YEAH! I will elaborate later on how I did it.
Today, I started the day by continuing my ripple effect simulation. More tweaking is done also. However I still had the same problem. Which is the crazy pieces. And today I am trying to mess around with the expression of extracting the position data from dops and put them into group but no luck. I tried a couple:
dopsnumrecordtypes :
http://www.sidefx.com/docs/houdini9.5/expressions/dopnumrecordtypes
doptransform:
http://www.sidefx.com/docs/houdini9.5/expressions/doptransform
But the closest I got was this with this expression:
Dopfield:
http://www.sidefx.com/docs/houdini9.5/expressions/dopfield
In the docs, there is an example of how to get the y position of a particular object. Bingo!
I started integrating that into my simulation:
I started off with this:
if(dopfield("/obj/dopnet1", "rbdfracturedobject1", "Position", "Options", 0, "py")>0, 1, 0)
The result is that it doesn't do anything at all. Even if I pumped the force up to 10000, nothing moves. I then changed some simple parameters and I ended up with something decent. I had a video on how it looks.
I looked through the files that I did during FYPJ. I realised that the expression Mr Ron used to group the primitives based on color is this:
- if(prim($OBJID, 0, "Cd", 0)>0, 1, 0)
I realised that he is using $OBJID which is a unique value for each primitive. I then decided to change my expression to use $OBJID. Bingo it worked.
Below is my new expression which works:
if(dopfield("/obj/dopnet1", "$OBJID", "Position", "Options", 0, "py")>0, 1, 0)
I did some minor test and the 10000 force value really worked. Okay, I will do some proper tweaking on tuesday.
How my scene looked:
Another thing I was working on was the meteor trail. I did some particles tweak and made them more spread out. I then load in the rock and used a default stone shader and did a render. It is not done yet so when it is done, I will elaborate more.
This is how it looks in the viewport with the rock:
I know it looks horrible. I have my render I will compile it tonight.
The next 3 days we are off, hope to be able to do something conducive.
No comments:
Post a Comment