Author Message
90ender
Talkative

Joined: 31 Dec 2011
Posts: 29
Location: Provo, UT

 Posted: Wed May 30, 2012 6:43 pm GMT    Post subject: How to share attribute with connected prims 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?
edward
Houdini Guru

Joined: 04 Jul 2002
Posts: 5161
Location: Toronto

 Posted: Wed May 30, 2012 7:42 pm GMT    Post subject: 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.
rafaels
Houdini Master

Joined: 18 Mar 2009
Posts: 578
Location: Toronto

 Posted: Wed May 30, 2012 8:32 pm GMT    Post subject: 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
90ender
Talkative

Joined: 31 Dec 2011
Posts: 29
Location: Provo, UT

 Posted: Wed May 30, 2012 8:42 pm GMT    Post subject: 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? _________________History has been built by the right tools in the right hands.
rafaels
Houdini Master

Joined: 18 Mar 2009
Posts: 578
Location: Toronto

 Posted: Wed May 30, 2012 9:26 pm GMT    Post subject: Foreach can be quite tricky... Do you care posting a small test file?! Cheers
90ender
Talkative

Joined: 31 Dec 2011
Posts: 29
Location: Provo, UT

Posted: Wed May 30, 2012 9:50 pm GMT    Post subject:

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.

RBDTests2.hipnc
Description:
Filename:  RBDTests2.hipnc
Filesize:  368.92 KB

_________________
History has been built by the right tools in the right hands.
rafaels
Houdini Master

Joined: 18 Mar 2009
Posts: 578
Location: Toronto

Posted: Wed May 30, 2012 10:02 pm GMT    Post subject:

 90ender wrote: 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
rafaels
Houdini Master

Joined: 18 Mar 2009
Posts: 578
Location: Toronto

Posted: Thu May 31, 2012 8:24 am GMT    Post subject:

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

rbdtests2_123.hipnc
Description:
 modified example file

Filename:  rbdtests2_123.hipnc
Filesize:  378.19 KB

90ender
Talkative

Joined: 31 Dec 2011
Posts: 29
Location: Provo, UT

 Posted: Thu May 31, 2012 9:49 am GMT    Post subject: 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? _________________History has been built by the right tools in the right hands.
rafaels
Houdini Master

Joined: 18 Mar 2009
Posts: 578
Location: Toronto

 Posted: Thu May 31, 2012 12:54 pm GMT    Post subject: 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 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
90ender
Talkative

Joined: 31 Dec 2011
Posts: 29
Location: Provo, UT

 Posted: Thu May 31, 2012 2:32 pm GMT    Post subject: 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! _________________History has been built by the right tools in the right hands.
rafaels
Houdini Master

Joined: 18 Mar 2009
Posts: 578
Location: Toronto

Posted: Sat Jun 02, 2012 5:51 pm GMT    Post subject:

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

rbdtests2_123_140.hipnc
Description:
Filename:  rbdtests2_123_140.hipnc
Filesize:  405.1 KB

90ender
Talkative

Joined: 31 Dec 2011
Posts: 29
Location: Provo, UT

 Posted: Mon Jun 04, 2012 9:30 am GMT    Post subject: 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. _________________History has been built by the right tools in the right hands.
rafaels
Houdini Master

Joined: 18 Mar 2009
Posts: 578
Location: Toronto

 Posted: Mon Jun 04, 2012 9:36 am GMT    Post subject: 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
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 5 Hours Page 1 of 1

 Jump to: Select a forum Houdini----------------AnnouncementsGeneral DiscussionTechnical DiscussionHoudini ApprenticeLearning HoudiniWork in ProgressThe Orbolt Smart 3D Asset Store Houdini Engine----------------SideFX Labs
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum