attrib transfer : color

   8891   10   3
User Avatar
Member
34 posts
Joined: Feb. 2008
Offline
hi .. have a file attached here … what basically i am trying to do is transfer the color on to the particles as they pass a grid … i do manage to do transfer it initially .. that but as the particles travel further away they lose the color and go back to their original color.

how do i maintain this new color throughout?

-alok

Attachments:
colorTransfer.hipnc (54.1 KB)

User Avatar
Member
696 posts
Joined: March 2006
Offline
http://www.sidefx.com/index.php?option=com_content&task=view&id=1500&Itemid=132 [sidefx.com]

check out video 9
Stephen Tucker
VFXTD
User Avatar
Member
34 posts
Joined: Feb. 2008
Offline
hi allegro… yes in fact the problem cropped up only after seeing this video no.9 ) …now if my grid is red and am transferring the color to the points while calling the IF() function in the red channel of the point sop then yes we can maintain the transferred color. But if the color to be transferred is anything other than R,G,B then i am not able to do so.
User Avatar
Member
696 posts
Joined: March 2006
Offline
post your file?
Stephen Tucker
VFXTD
User Avatar
Member
34 posts
Joined: Feb. 2008
Offline
attached …thanks

Attachments:
TansferColor.hipnc (54.9 KB)

User Avatar
Member
696 posts
Joined: March 2006
Offline
here's a few different ways it can be done.

Attachments:
tansfercolor.hipnc (186.1 KB)

Stephen Tucker
VFXTD
User Avatar
Member
34 posts
Joined: Feb. 2008
Offline
wow and i thought i was getting a grasp of expressions :shock: … guess have to work harder to follow these things

thanks for your help allegro !!

cheers
User Avatar
Member
696 posts
Joined: March 2006
Offline
No problem, it's hard to cover everything in a tutorial. One of the great things about Houdini is that there are usually multiple ways to do things.
Stephen Tucker
VFXTD
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Yep, many many ways to do things.

Yes using the Collision POP and many ways to access the numhit attribute to make the color persistent over time works fine in this specific case.

I like the more general approach solving the common problem: how to make an attribute persistent in SOPs without any crutches like numhit.

See the attached file for three ways to hold increasing values even after the source causes the attribute to decrease (without using the numhit crutch which means you can use this anywhere): SOPs, CHOPs and POPs.

These techniques would work on any SOP input with an attribute that varies.

You can even mix some of Steve's approaches with the ones in the attached file for even finer control.

Attachments:
tansfercolor_538_v02.hipnc (171.7 KB)

There's at least one school like the old school!
User Avatar
Member
696 posts
Joined: March 2006
Offline
jeff
Yep, many many ways to do things.

Yes using the Collision POP and many ways to access the numhit attribute to make the color persistent over time works fine in this specific case.

I like the more general approach solving the common problem: how to make an attribute persistent in SOPs without any crutches like numhit.

See the attached file for three ways to hold increasing values even after the source causes the attribute to decrease (without using the numhit crutch which means you can use this anywhere): SOPs, CHOPs and POPs.

These techniques would work on any SOP input with an attribute that varies.

You can even mix some of Steve's approaches with the ones in the attached file for even finer control.


You're right, the numhit is a bit of a crutch, and there are probably better ways to do this (hence the reason I threw in the sopsolver method in that file). It would be good to get the feedback sop out of the protoinstall and into the daily builds.

The problem that I with your scenarios is that that it's doing a max type operation where each of the RGB values are retaining their highest values, not simply retaining whatever value they are blending toward. If you're going from Red to Blue, this will result in Magenta rather than Blue, or in the this case the particles tend to blend to white rather than yellow.

SOP_method_file_cache yaks at me because the two inputs of the point sop have a different number of inputs. I got around that by using the Match by Attribute option to try and match by id. I also needed to throw a switch in there so that it does not try to compare with frame 0. I'm not sure exactly how to go about making this work

Your chops solution was not entirely getting the desired result either. I've reworked it with a vopchop to do a comparison. This one takes a bit more set-up for sure.

Your pop method seemed to be going from either the original color to white. Not sure what exactly you were doing there, but I swapped out your custom attribute and did an attribute transfer to make it work.

Attachments:
tansfercolor_update1.hipnc (199.1 KB)

Stephen Tucker
VFXTD
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Yep I'm mixing R, G and B separately which will give you something that goes to white.

I would actually not do that and use the switch SOP at the top set to 0 and just work on the Red channel and have it go from 0 to 1 then mix the two colors based on that later on. I threw that in there last minute after seeing your file working with the color. I put the switch in there so that you can work with Red only.

Everyone gets 0-1 in red. Mixing the two colors as was in the original file, who knows what's up, what's right and what's wrong.


As for the Point SOP bitching, no worries. Just a warning. It simply means that the first input has more points than the second. I can see any Houdini user getting their back hairs up over this but note the Group SOP feeding in to the Point SOP ensures that the two inputs will match up nicely. Plus the Point SOP simply ignores the points that don't have a match and since those lone points are not in the group ($AGE == 0), no worries.


-jeff
There's at least one school like the old school!
  • Quick Links