FAQ FAQ      Search Search      Memberlist Memberlist      Usergroups Usergroups      Register Register      Profile Profile      Check private messages Check private messages      Log in Log in     

How to share attribute with connected prims

 
Post new topic   Reply to topic    Houdini Forum Index -> Houdini Apprentice
View previous topic :: View next topic  
Author Message
90ender
Talkative


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

usa.gif
PostPosted: Wed May 30, 2012 6:43 pm GMT    Post subject: How to share attribute with connected prims Reply with quote

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?
Back to top
View user's profile Send private message
edward
Houdini Guru


Joined: 04 Jul 2002
Posts: 5005
Location: Toronto

blank.gif
PostPosted: Wed May 30, 2012 7:42 pm GMT    Post subject: Reply with quote

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. Smile
Back to top
View user's profile Send private message
rafaels
Houdini Master


Joined: 18 Mar 2009
Posts: 519
Location: Toronto

canada.gif
PostPosted: Wed May 30, 2012 8:32 pm GMT    Post subject: Reply with quote

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! Smile

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
Back to top
View user's profile Send private message Visit poster's website
90ender
Talkative


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

usa.gif
PostPosted: Wed May 30, 2012 8:42 pm GMT    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
rafaels
Houdini Master


Joined: 18 Mar 2009
Posts: 519
Location: Toronto

canada.gif
PostPosted: Wed May 30, 2012 9:26 pm GMT    Post subject: Reply with quote

Foreach can be quite tricky... Do you care posting a small test file?!

Cheers
Back to top
View user's profile Send private message Visit poster's website
90ender
Talkative


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

usa.gif
PostPosted: Wed May 30, 2012 9:50 pm GMT    Post subject: Reply with quote

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:

Download
 Filename:  RBDTests2.hipnc
 Filesize:  368.92 KB
 Downloaded:  147 Time(s)


_________________
History has been built by the right tools in the right hands.
Back to top
View user's profile Send private message
rafaels
Houdini Master


Joined: 18 Mar 2009
Posts: 519
Location: Toronto

canada.gif
PostPosted: Wed May 30, 2012 10:02 pm GMT    Post subject: Reply with quote

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... Smile

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

Cheers
Back to top
View user's profile Send private message Visit poster's website
rafaels
Houdini Master


Joined: 18 Mar 2009
Posts: 519
Location: Toronto

canada.gif
PostPosted: Thu May 31, 2012 8:24 am GMT    Post subject: Reply with quote

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

Download
 Filename:  rbdtests2_123.hipnc
 Filesize:  378.19 KB
 Downloaded:  149 Time(s)

Back to top
View user's profile Send private message Visit poster's website
90ender
Talkative


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

usa.gif
PostPosted: Thu May 31, 2012 9:49 am GMT    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
rafaels
Houdini Master


Joined: 18 Mar 2009
Posts: 519
Location: Toronto

canada.gif
PostPosted: Thu May 31, 2012 12:54 pm GMT    Post subject: Reply with quote

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! Very Happy

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... Smile

cheers
Back to top
View user's profile Send private message Visit poster's website
90ender
Talkative


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

usa.gif
PostPosted: Thu May 31, 2012 2:32 pm GMT    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
rafaels
Houdini Master


Joined: 18 Mar 2009
Posts: 519
Location: Toronto

canada.gif
PostPosted: Sat Jun 02, 2012 5:51 pm GMT    Post subject: Reply with quote

Hey, sorry for the break... I had a rough week Smile
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:

Download
 Filename:  rbdtests2_123_140.hipnc
 Filesize:  405.1 KB
 Downloaded:  147 Time(s)

Back to top
View user's profile Send private message Visit poster's website
90ender
Talkative


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

usa.gif
PostPosted: Mon Jun 04, 2012 9:30 am GMT    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
rafaels
Houdini Master


Joined: 18 Mar 2009
Posts: 519
Location: Toronto

canada.gif
PostPosted: Mon Jun 04, 2012 9:36 am GMT    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Houdini Forum Index -> Houdini Apprentice All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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
You can download files in this forum


phpBB component v1.2.4 RC3 by Adam van Dongen. Based on phpBB © 2001, 2002 phpBB Group