How to share attribute with connected prims

   6437   13   2
User Avatar
Member
183 posts
Joined: Dec. 2011
Offline
So this is one of my first times posting on this forum I believe and I just wanted to start by thanking everyone for all the help they have been just by answering other peoples questions. I don't know how many questions I have had cleared up just by reading your guys posts.

Anyway I am still a beginner with this program and was wondering am working with breaking up mesh with voronoi fracturing and am trying to get attributes to share between connected prims so that I can treat each chunk created by the fracture as a whole rather than just a group of points and prims. For example if I had one chunk made up of 6 prims each of which had the attribute “weight” of a varying amount how would I average it so that each connected prim had the average of the overall weight on the chunk instead of a different value for each? Any suggestions on how to do this?
User Avatar
Member
7709 posts
Joined: July 2005
Online
The first naive (ie. brute force) way I can think of doing this is to use the ForEach SOP to handle each group of primitives at a time. (Create the groups using Connectivity/Partition first if you don't have them yet). Now inside, use the AttribPromote SOP to convert your attribute from Primitive to Detail, then another to convert back to Primitive again. I expect this method to be slow.
User Avatar
Member
693 posts
Joined: March 2009
Offline
Why would you set this weight attribute per prim and then average them? If all you want is to manipulate chunks as a whole you can use a Partition SOP to create prim groups on a per-chunk basis and then have fun with it!

The voronoy fracture SOP already creates an attribute that separates which primitive belongs to what chunk., just look in the attribute tab of the same.

Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
183 posts
Joined: Dec. 2011
Offline
So looks like Edward and I had the same idea. I tried using the promote attribute with the foreach sop and found that it was averaging it for all the prims and not just the ones being processed. Not sure why this happens…

As for your idea rafael, the reason I want to average the weight attribute per chunk is so that I can create a selection of chunks based on a weight paint that I used earlier in the process to create the fracture. I think your idea might have merit though if we can figure how to use it in conjunction with the weight averaging that I am going for. BTW were you the one who did the curve controlled ground fracturing on vimeo?
User Avatar
Member
693 posts
Joined: March 2009
Offline
Foreach can be quite tricky… Do you care posting a small test file?!

Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
183 posts
Joined: Dec. 2011
Offline
Sure here is my .hip that I'm working on. Sorry that it's something of a mess since I'm in the middle of working things out.

Attachments:
RBDTests2.hipnc (368.9 KB)

User Avatar
Member
693 posts
Joined: March 2009
Offline
90ender
BTW were you the one who did the curve controlled ground fracturing on vimeo?

Not sure if it's the same you saw, but I did do one of those…

Cool, I'll take a look at your file later.

Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
693 posts
Joined: March 2009
Offline
Hey!

So I looked into your file and found a much simpler answer.
Basically you already did most of the work. your template points going into the Copy node already had the weight attribute properly assigned to them, so I used the stamping functionality in the copy SOP to mirror those weights onto the metaballs and the scatter sop then takes care of sampling the weight onto the scattered points.
Lastly you enable the copy cell point attributes in the Voronoy fracture node and specify which attribute you want and where. The following two nodes I only used for visualization purposes…

All the nodes I touched or added are in red.

Cheers

Attachments:
rbdtests2_123.hipnc (378.2 KB)

Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
183 posts
Joined: Dec. 2011
Offline
Thanks rafaels! Glad that I could learn something new about the fracture sop. That is a very good feature to know and has solved the majority of the problem. I still would like to figure out how to do the averaging after the fracture so the I can paint one side of a chunk and have it average across or apply to the whole so that I can fine tune which chunks I have selected. Your solution definitely gets me 90% of the way there though. Thanks!

As for the ground fracture thing. I was very impressed by what I saw (at least the one I saw). So what's the basic idea of how it works? is it that the active state of the RBD is effected by an attribute transferred by the curve as it draws within a certain distance of the chunk?
User Avatar
Member
693 posts
Joined: March 2009
Offline
I see your point now. I think you'd invariably have to use a foreach SOP then. If you'll have thousands of elements (even a few hundreds) that'd make things slowdown for you, I think… But doable, I'll see if I can get to it later if I'm still conscious!

Regarding the ground fracture, are you talking about this:
http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=24846 [sidefx.com]

If so, there's actually no RBD sim. Only one sop solver that animates the pieces settling after they are first displaced and once they lower beyond a specific point I drop them. All done with SOPs and particles…

cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
183 posts
Joined: Dec. 2011
Offline
Yeah that's it. Wow that's pretty impressive that you where able to get that convincing of an effect out of just pops and a sop solver. Very cool!
User Avatar
Member
693 posts
Joined: March 2009
Offline
Hey, sorry for the break… I had a rough week
Here's a file with the foreach working, look for the yellow nodes and feel free to ask questions.

Cheers

Attachments:
rbdtests2_123_140.hipnc (405.1 KB)

Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
183 posts
Joined: Dec. 2011
Offline
Thanks tons Rafaels. So I need to learn my foreach node better but if I understand correctly what you are doing is promoting the value to a detail to apply the maximum value to all the prims in the group and then demote it down to the point level to avoid getting it mixed in with the next group's values. Not sure if I understand what the culling part is. I will look into that a bit more. Thanks again for all you help. I feel this method has a lot of potential and will come in handy in the future.
User Avatar
Member
693 posts
Joined: March 2009
Offline
I think you got it right.
One advice about the foreach (that I actually heard from many sources) is to make sure your “code” works outside the foreach before you move it inside. In the case of this one I'm making the foreach loop through all the groups that start with “piece” (something the voronoy fracture did for us), applying the network. The foreach is set to merge the results together in the end.

If you feel like it, there's a buncho of foreach sop videos in Peter Quint's channel.

Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
  • Quick Links