How to: Travellling Attribute Wave

   17163   25   2
User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
Hi.

I'd like to have a wave of heat travelling on the surface of an object.

So, I created an object and an attribute that I called “heat” onto every point of the surface. I made a group of several points that act as a starting area (to set the initial attribute values).

The idea is that heat grows in the starting area and once it has reached a certain point, say 10, neighboring points catch heat as well. After reaching a certain heat, say 20, it quickly dies off to 0.

This should give me the effect of a travelling heatwave, like a firefront.

The question is, how to I “infect” neighboring points with the heat attribute?
--
Jobless
User Avatar
Member
7725 posts
Joined: July 2005
Offline
Try looking into the VOPs that begin with Neighbor… There's also the AttribTransfer SOP.
User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
Ok…it seems as if these neighbor VOPs is what I am looking for. What I can't work out is how to get out the custom attribute heat that I created.

I know how to get them in! ImportAttribute gets them, and they also seem to come through via the points global parameter. But there is no heat in the output node. There's color…age… how do I get my heat attribute into the output node?

Basically, I'd like to change the values on attributes already on an object.

Attachments:
Untitled-1.jpg (41.2 KB)

--
Jobless
User Avatar
Member
77 posts
Joined: Nov. 2007
Online
Use the Parameter VOP–the same Parameter VOP used to create parameters for your VOP network.

You want to feed the value of the attribute you want to get out to SOP level into the “input” connection of the Parameter VOP, then turn the VOP's Export paramater to either “Always” or “When input is connected” and set the parameter name to the name of the attribute you want to output.
This way, the value will be “exported” with the same name as the SOP attribute that is outside of the VOP and override it.

A hip file showing the VOP network is attached. It does absolutely nothing, though.

I doubt you'll need this:

標準アトリビュート以外のアトリビュートをVOP空間から出すには、
VOPネットワークのパラメータを作るParameter VOPを使います。

SOP空間のアトリビュートに出したい値をParameter VOPのinput 接点につないで、
ExportパラメータのプルダウンメニューからAlwaysかWhen input is connectedに設定して、Parameter nameというパラメータを出したいアトリビュート名に設定します。
そうするとParameter VOPにつなぐ値はSOP空間のアトリビュートとして「エクスポート」され、VOP SOPノードの前の値を上書きします。

使用例としてHIPファイルを添付しましたが、それ以外は何もないです。

Attachments:
extraVOPout.hip (48.4 KB)

User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
Phew…thanks man…tricky…

I must say this is a lot easier in XSI, as there is only one type of node network. But I'm not complaing, this is good too, I'm sure.

Can we visualize attributes in Houdini, for debugging? I slotted them into the Cd inside VOPS, but I'm wondering about the SOP level. Color SOPs only have a group option, not an attribute one.


日本語で説明してもらいました、ありがとう。しかし、そんなよく分からへんんだけど、英語がペラペラです。日本語はマ~マ~。。。
--
Jobless
User Avatar
Member
7725 posts
Joined: July 2005
Offline
If your attribute doesn't exist from outside the VOP network, the Add Attribute VOP can also be used. But I personally prefer the Parameter VOP way too since it can be easily transferred to shader networks.
User Avatar
Member
77 posts
Joined: Nov. 2007
Online
Soothsayer
Phew…thanks man…tricky…

I must say this is a lot easier in XSI, as there is only one type of node network. But I'm not complaing, this is good too, I'm sure.

Can we visualize attributes in Houdini, for debugging? I slotted them into the Cd inside VOPS, but I'm wondering about the SOP level. Color SOPs only have a group option, not an attribute one.


日本語で説明してもらいました、ありがとう。しかし、そんなよく分からへんんだけど、英語がペラペラです。日本語はマ~マ~。。。

いやーてっきり日本の方だと思いました。大阪ですか?

Anyways, you lose the local variable mapping (Point Attribute “heat” -> Local Variable “$HEAT”) when you feed it through a VOP network with the Parameter VOP as the output, so you can't just say “$HEAT” in a Color SOP.

However (I just found out) if you use the Add Attribute VOP to output your attribute, the variable mapping survives, and you can plug it into a SOP.

By the way, if you're close to Tokyo on December 2nd, check this out:
http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=13929 [sidefx.com]
User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
IndyZoneCo
いやーてっきり日本の方だと思いました。大阪ですか?



By the way, if you're close to Tokyo on December 2nd, check this out:
http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=13929 [sidefx.com]

Wow, thanks, I'm inching closer to my target.

Sadly I'm too far from Tokyo. I always miss good stuff there…

大阪に住んでいる。でも、日本人じゃないよ。ルクセンブルグ人だよ。(日本に、パンダよりルクセンブルグ人のほうが珍しいだと聞いた。) P
--
Jobless
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Yes you can visualize attributes in Houdini.
Both require the display options for the viewoport open. Just hit “d” with the cursor over the viewport.

First and easiest is to go to the Miscellaneous Folder (last one to the right) and at the bottom there is an option to visualize your attribute. Just type in the name of your attribute and it will override the default visualization of Cd.

The second way is to view it as either text or as a vector. Go to first folder (last one on the left) and in the upper right there is an option to add custom attribute options.
Add either a vector or float. Then RMB on the just added toggle option and modify to suit your attribute.

I rarely use the old “pass your attribute in to a Point or Primitive SOP” unless I really need to these days.
There's at least one school like the old school!
User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
Thank you Jeff, that is most useful. Wonderful, in fact!
--
Jobless
User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
I need a little advice on this: I set up a IF-network here. It compares the heat attribute to a value and if it is more than that value it increases heat via the add node.

It appears to work but only once. How do I update it on every frame, or subframe even? Anywhere I need to type $F in?

Attachments:
Matchstick.hipnc (130.1 KB)
match.jpg (171.8 KB)

--
Jobless
User Avatar
Member
7725 posts
Joined: July 2005
Offline
I need a little advice on this: I set up a IF-network here. It compares the heat attribute to a value and if it is more than that value it increases heat via the add node.

IF conditions work differently in VOPs than in ICE. In VOPs, the IF node is a subnetwork. You need to put the addconst node inside the IF subnet instead. I've modified your file and attached it.

Notice also that the if node's label is in bright blue. This usually means that there is a comment present on the node. If you middle-mouse on the node icon, you'll get a text popup with a comment that describes how to use it.

It appears to work but only once. How do I update it on every frame, or subframe even? Anywhere I need to type $F in?

In VOPs, you can't use $F because your code is not recompiled every frame. Your code is compiled once, and then re-executed every frame (as necessary) using the different parameter values. If you'll note that your first posts on the forum used time, there I used the Global Variables VOP node and its time output.

Attachments:
matchstick_249.hipnc (131.8 KB)

User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
Hmm…I'm still not sure I understand that time thing. I've set the IF network so that:

If heat is bigger than 1 then add 1, else leave as is.

It is working once because if I dive into the IF subnetwork I can change the ADD value and see that it updates the correct heat attributes (according to the condition)

But it isn't doing it every frame. There are clearly values over 1 that it won't update more than once.

I need to somehow slot in the time varibale into IF ? Or I use a loop node?


Hm. I'm confused about this IF node…it doesn't quite work the way I imagine it. :evil:

Attachments:
bigger.jpg (93.4 KB)
matchstick_249_333.hipnc (128.7 KB)

--
Jobless
User Avatar
Member
7725 posts
Joined: July 2005
Offline
There is nothing in your network that says that it changes over time. SOPs do NOT modify the geometry from the previous frame's geometry. It computes new geometry every frame. There is no history. So in your case right now, since none of your parameters or nodes are time-dependent, the network will cook the same way every frame. You can confirm this by middle-clicking on your VOP SOP node and see that it is not time dependent.

If you just want values that add 1 every frame, then all you need to do is add in the Frame value from the Global Variables VOP instead of adding 1 inside your IF subnet. I've attached such a modification to your file.

Having said that, there are other network contexts that modify on the same geometry every frame, like Particle operators (POPs), and dynamics operators (DOPs). From time to time, one may wish to pipe the geometry data into such a context and then bring it back in. But that's a topic outside the scope of this post.

Attachments:
matchstick_249_333_808.hipnc (128.8 KB)

User Avatar
Member
7725 posts
Joined: July 2005
Offline
PS. Doing things in a way that directly relates to the time value is much better whenever you can get away with it (as per the last file I attached) because you can just cook your network at frame 100 say, without cooking any of the previous frames.
User Avatar
Member
121 posts
Joined: July 2008
Offline
IndyZoneCo
Soothsayer
Phew…thanks man…tricky…

I must say this is a lot easier in XSI, as there is only one type of node network. But I'm not complaing, this is good too, I'm sure.

Can we visualize attributes in Houdini, for debugging? I slotted them into the Cd inside VOPS, but I'm wondering about the SOP level. Color SOPs only have a group option, not an attribute one.


日本語で説明してもらいました、ありがとう。しかし、そんなよく分からへんんだけど、英語がペラペラです。日本語はマ~マ~。。。

いやーてっきり日本の方だと思いました。大阪ですか?

Anyways, you lose the local variable mapping (Point Attribute “heat” -> Local Variable “$HEAT”) when you feed it through a VOP network with the Parameter VOP as the output, so you can't just say “$HEAT” in a Color SOP.

However (I just found out) if you use the Add Attribute VOP to output your attribute, the variable mapping survives, and you can plug it into a SOP.

By the way, if you're close to Tokyo on December 2nd, check this out:
http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=13929 [sidefx.com]

Hey, you can also add an attribute create SOP after your VOP SOP and specify $HEAT variable there by using the point expression in your value.

point(“../VOP SOP”, $PT, “heat”, 0)

But either way it will work.

Cheers,
c.
Available for new projects
User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
Thanks everybody!

(I'll try your suggestions once I have fixed my broken computer now…argh….)
--
Jobless
User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
I used my lunchtime to do this on a different (working) computer. :lol:

I tried to check for neighbours pn of a point p and add their heat values to the point p. (so that heat would spread along the surface by infecting other points)

I made the network sequential so that it would have some time dependancy from the previous IF network, but it's not working. Values are growing but not spreading. Where is the problem?

Also, I'm not sure I understood the neighbour nodes correctly because the documentation is a little sparse on it.


I think in XSI we just drag the whole ICE network into the “Simulate” stack if we want to make it time dependant. There's isn't a neat trick like that in Houdini?



By the way, IndyZoneCo, if you're reading this: Do you know of any companies in Kansai that use Houdini? Would be interesting to know if and how popular it is around here.

Attachments:
Loopy.jpg (61.8 KB)
matchstick_me.hipnc (149.2 KB)

--
Jobless
User Avatar
Member
861 posts
Joined: Oct. 2008
Offline
Actually there was a mistake in the FOR loop. “i” was wrongly connected.

Anyway, still not working. Maybe I need access to the FOR counter (I thought that was “i”)…

Attachments:
matchstick_me.hipnc (151.0 KB)

--
Jobless
User Avatar
Member
7725 posts
Joined: July 2005
Offline
Perhaps it would help to differentiate between “time-dependent” and “history-dependent”. By “history-dependent”, I mean that the output depends on the data from the previous frame. For practical purposes, we can take this to mean “simulation”. By “time-dependent”, I mean that the output changes when time changes. A node can be “time-dependent” WITHOUT being “history-dependent”.

SOPs generally do NOT perform simulation. If want that, then you have to use one of the simulation operator contexts, like POP or DOP. There are also other alternatives via CHOPs or perhaps the Cache SOP as well.

The Neighbour VOP (inside your For subnet) needs its last input (Neighbour Number) connected to _i from the subnet input node. That only fixes it so that it sums the neighboring heat values from the input geometry values (ie. the output of attribtransfer1). This is because SOPs is NOT history-dependent.
  • Quick Links