dyankov Posted May 8, 2010 Share Posted May 8, 2010 Hey there, first post First I'd like to say in my defence that I looked all over the docs, SideFX forum and searched this forum as well and couldn't find anything that solves this problem, but anyway sorry if this has been asked before. So, I have an RBD object containing a single geometry piece called 'cube' and on impact in the sop solver's sopnet is activated a shatter node and the resulting output is like 10+ objects (all grouped like they should, using connectivity + partition), but the problem is that they stick together after the impact. When I middle-click it still says that I have only one object ('cube') instead of all the pieces. I'm attaching the file. Please help me out here, I don't know where else to look for info on this. As far as I understand, I have to do something with the new objects that are not coming out of the SOP Network. shattering_cube.hipnc Quote Link to comment Share on other sites More sharing options...
dyankov Posted May 8, 2010 Author Share Posted May 8, 2010 Hi again, I actually found an example file showing a sphere shattering in smaller and smaller pieces. The example name is AutoFracturing. It starts with a single sphere and then the Copy Objects node creates 8 object and I don't understand how that works. If only anyone could explain this example to me, maybe I could solve the problem in my own sim? Thanks a lot! Quote Link to comment Share on other sites More sharing options...
anim Posted May 8, 2010 Share Posted May 8, 2010 middle-click on nodes in the example to see some info/explanation on how it works many examples are built this way Quote Link to comment Share on other sites More sharing options...
dyankov Posted May 8, 2010 Author Share Posted May 8, 2010 I read all the notes in that network, but it's still hard to understand what's really going on. For example, the Copy Objects node is using the group objects_to_split, which I cannot find where does it come from. Anyway, I'm not 100% sure that this example will solve my problem. I'd be happy if you gave me any directions on that issue. Thanks Quote Link to comment Share on other sites More sharing options...
sparkChan Posted May 9, 2010 Share Posted May 9, 2010 I think this is what you want. you are able to use the Copy Objcts DOP to get objects you want to copy, then use the SOP Geometry DOP to get each single primitive object, finally lay down a Delete DOP to delete source object. I referred the topic Voronoi - dynamic - location based fracture in the forum shattering_cube_correct.hipnc Quote Link to comment Share on other sites More sharing options...
dyankov Posted May 9, 2010 Author Share Posted May 9, 2010 Thank you so much, that's exactly what I needed! I noticed just one small issue - the cube falls, then bounces off the ground and 1 frame later it shatters. Shouldn't it be shattering as soon as it hits the ground and the pieces start flying in all directions? I just imagined it that way when I was starting the simulation. Thanks again! Quote Link to comment Share on other sites More sharing options...
sparkChan Posted May 9, 2010 Share Posted May 9, 2010 Thank you so much, that's exactly what I needed! I noticed just one small issue - the cube falls, then bounces off the ground and 1 frame later it shatters. Shouldn't it be shattering as soon as it hits the ground and the pieces start flying in all directions? I just imagined it that way when I was starting the simulation. Thanks again! that's because the primitive objects are created after the cube hits the ground. for the sence, the cube hits the ground at frame 16, then those objects are created at frame 17, that's why I typed the expression $OBJCF == $SF in the group1. we get the dopobjects using the SOP Geometry DOP. if you want to let the pieces start flying in all directions. Maybe you have to modify those velocity. Quote Link to comment Share on other sites More sharing options...
dyankov Posted May 9, 2010 Author Share Posted May 9, 2010 Yes, in the RBD state I put a rand() funcion for the velocity and it turned out pretty well. The reason that I wanted the cube to shatter on impact (or impulse) was different though. I was hoping that when the cube shatters, each individual piece can shatter as well, if it gets the needed impulse, say from an object falling from above, but it's not working for some reason. But I'll do my homework, thanks for the help so far Quote Link to comment Share on other sites More sharing options...
johner Posted May 9, 2010 Share Posted May 9, 2010 Thank you so much, that's exactly what I needed! I noticed just one small issue - the cube falls, then bounces off the ground and 1 frame later it shatters. Shouldn't it be shattering as soon as it hits the ground and the pieces start flying in all directions? I just imagined it that way when I was starting the simulation. Thanks again! Turning up the "Substeps" parameter on the DOP Network (anywhere from 2 to 4 or so) should make the intact / fractured transition appear smoother. Quote Link to comment Share on other sites More sharing options...
sparkChan Posted May 10, 2010 Share Posted May 10, 2010 you can modity objtocopy parameter in the Copy Objects DOP. we can use the sourceobjid value to copy each primitive group object if you want to let each primitive group object continue shattering when they have Impacts. so we must create a attribute value named sourceobjid in the fracture, then read the value in the objtocopy parameter. Quote Link to comment Share on other sites More sharing options...
sparkChan Posted May 10, 2010 Share Posted May 10, 2010 you can modity objtocopy parameter in the Copy Objects DOP. we can use the sourceobjid value to copy each primitive group object if you want to let each primitive group object continue shattering when they have Impacts. so we must create a attribute value named sourceobjid in the fracture, then read the value in the objtocopy parameter. auto_shattering_cube.hipnc Quote Link to comment Share on other sites More sharing options...
sparkChan Posted May 10, 2010 Share Posted May 10, 2010 you can modity objtocopy parameter in the Copy Objects DOP. we can use the sourceobjid value to copy each primitive group object if you want to let each primitive group object continue shattering when they have Impacts. so we must create a attribute value named sourceobjid in the fracture, then read the value in the objtocopy parameter. Quote Link to comment Share on other sites More sharing options...
dyankov Posted May 10, 2010 Author Share Posted May 10, 2010 Thanks, I will take a look at it. P.S. I took a look in the docs about the prim() and nprims() functions, but their description there says so little. For example, I'm guessing that you're using prim() to get each primitive group that comes out of the fracture SOP and copy it to a new object, right? Here's what the docs say: When given the “P” or “Pw” attribute, returns the centroid of the primitive. Quote Link to comment Share on other sites More sharing options...
sparkChan Posted May 10, 2010 Share Posted May 10, 2010 we can use a sourceobjid of dopobject to stand for this dopobject. for example, if the sourceobjid value of cube is 1, then we can use the value to stand for the cube and apply it everywhere. we want each primitive group object continuing shattering, so we must know which object is copied. so we have a sourceobjid and tell the Copy Objects DOP to copy each primitive group object, then use Delete Dop to delete source object where we also use sourceobjid. we use prim() expression to get sourceobjid value of primitive 0 in each primitive group object. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.